2008-09-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
authorcwzwarich@webkit.org <cwzwarich@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Sep 2008 06:20:42 +0000 (06:20 +0000)
committercwzwarich@webkit.org <cwzwarich@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Sep 2008 06:20:42 +0000 (06:20 +0000)
commitbe01f745025e12004df93125a910667e1de6b91e
treedfe361c630c1498391d6a7e40256bd792b5f8a2f
parent8aa7193a007183b6f6cf3b417468a226f1784f19
2008-09-17  Cameron Zwarich  <cwzwarich@uwaterloo.ca>

        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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@36604 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore/ChangeLog
JavaScriptCore/VM/CodeGenerator.cpp
JavaScriptCore/VM/CodeGenerator.h
JavaScriptCore/VM/ExceptionHelpers.cpp
JavaScriptCore/VM/ExceptionHelpers.h
JavaScriptCore/VM/Machine.cpp
JavaScriptCore/VM/Machine.h
JavaScriptCore/kjs/nodes.cpp