RESOLVED FIXED 39583
Move creation of 'this' object from caller to callee in construction.
https://bugs.webkit.org/show_bug.cgi?id=39583
Summary Move creation of 'this' object from caller to callee in construction.
Gavin Barraclough
Reported 2010-05-24 01:03:30 PDT
Presently the caller of a constructor is responsible for providing a this object. Instead, move the object creation into a new op_create_this opcode, planted in the head of the contructor bytecode for a function. Since the prototype for the object is provided by performing a get_by_id on the callee, also add a new get_callee opcode (this is used to get the callee JSFunction into a register so that a normal get_by_id can be used). Currently the caller is also responsible for detecting when op_construct is performed on a JSFunction representing a host function, in which case an exception is thrown – and this check currently takes place when constructing the this object. Instead, mirroring the recent changes for non-host functions, add a parallel code-path for native constructors to follow, with a thunk for invoking native constructors provided by JITStubs, and a constructor-specific NativeFunction on NativeExecutable. Provide an implementation of a host constructor which will throw an exception.
Attachments
The patch (56.77 KB, patch)
2010-05-24 01:05 PDT, Gavin Barraclough
sam: review+
Gavin Barraclough
Comment 1 2010-05-24 01:05:32 PDT
Created attachment 56858 [details] The patch No performance impact
WebKit Review Bot
Comment 2 2010-05-24 01:08:13 PDT
Attachment 56858 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style', '--no-squash']" exit_code: 1 JavaScriptCore/jit/JITOpcodes.cpp:221: string_failureCases1Call is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] JavaScriptCore/jit/JITOpcodes.cpp:222: string_failureCases2Call is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] JavaScriptCore/jit/JITOpcodes.cpp:223: string_failureCases3Call is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] JavaScriptCore/jit/JITOpcodes32_64.cpp:221: string_failureCases1Call is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] JavaScriptCore/jit/JITOpcodes32_64.cpp:222: string_failureCases2Call is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] JavaScriptCore/jit/JITOpcodes32_64.cpp:223: string_failureCases3Call is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4] Total errors found: 6 in 19 files If any of these errors are false positives, please file a bug against check-webkit-style.
Gavin Barraclough
Comment 3 2010-05-24 11:47:09 PDT
Transmitting file data ................... Committed revision 60075.
Note You need to log in before you can comment on or make changes to this bug.