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/ExceptionHelpers.h

    r36263 r36604  
    4343    JSValue* createUndefinedVariableError(ExecState*, const Identifier&, const Instruction*, CodeBlock*);
    4444    JSNotAnObjectErrorStub* createNotAnObjectErrorStub(ExecState*, bool isNull);
    45     JSValue* createInvalidParamError(ExecState*, const char* op, JSValue*, const Instruction*, CodeBlock*);
    46     JSValue* createNotAConstructorError(ExecState*, JSValue*, const Instruction*, CodeBlock*);
     45    JSObject* createInvalidParamError(ExecState*, const char* op, JSValue*, const Instruction*, CodeBlock*);
     46    JSObject* createNotAConstructorError(ExecState*, JSValue*, const Instruction*, CodeBlock*);
    4747    JSValue* createNotAFunctionError(ExecState*, JSValue*, const Instruction*, CodeBlock*);
    4848    JSObject* createNotAnObjectError(ExecState*, JSNotAnObjectErrorStub*, const Instruction*, CodeBlock*);
Note: See TracChangeset for help on using the changeset viewer.