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.
Created attachment 56858 [details] The patch No performance impact
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.
Transmitting file data ................... Committed revision 60075.