Ignore:
Timestamp:
Sep 17, 2008, 11:20:42 PM (17 years ago)
Author:
[email protected]
Message:

2008-09-17 Cameron Zwarich <[email protected]>

Reviewed by Maciej Stachowiak.

Bug 20876: REGRESSION (r36417, r36427): fast/js/exception-expression-offset.html fails
<https://bugs.webkit.org/show_bug.cgi?id=20876>

r36417 and r36427 caused an get_by_id opcode to be emitted before the
instanceof and construct opcodes, in order to enable inline caching of
the prototype property. Unfortunately, this regressed some tests dealing
with exceptions thrown by 'instanceof' and the 'new' operator. We fix
these problems by detecting whether an "is not an object" exception is
thrown before op_instanceof or op_construct, and emit the proper
exception in those cases.

  • VM/CodeGenerator.cpp: (JSC::CodeGenerator::emitConstruct):
  • VM/CodeGenerator.h:
  • VM/ExceptionHelpers.cpp: (JSC::createInvalidParamError): (JSC::createNotAConstructorError): (JSC::createNotAnObjectError):
  • VM/ExceptionHelpers.h:
  • VM/Machine.cpp: (JSC::Machine::getOpcode): (JSC::Machine::privateExecute):
  • VM/Machine.h:
  • kjs/nodes.cpp: (JSC::NewExprNode::emitCode): (JSC::InstanceOfNode::emitCode):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/CodeGenerator.h

    r36417 r36604  
    281281        RegisterID* emitEnd(RegisterID* src) { return emitUnaryNoDstOp(op_end, src); }
    282282
    283         RegisterID* emitConstruct(RegisterID* dst, RegisterID* func, ArgumentsNode*);
     283        RegisterID* emitConstruct(RegisterID* dst, RegisterID* func, ArgumentsNode*, unsigned divot, unsigned startOffset, unsigned endOffset);
    284284
    285285        PassRefPtr<LabelID> emitLabel(LabelID*);
Note: See TracChangeset for help on using the changeset viewer.