Skip to content
  • cwzwarich@webkit.org's avatar
    2008-10-05 Cameron Zwarich <zwarich@apple.com> · a3b5f8a7
    cwzwarich@webkit.org authored
            Reviewed by Oliver Hunt.
    
            Bug 21364: Remove the branch in op_ret for OptionalCalleeActivation and OptionalCalleeArguments
            <https://bugs.webkit.org/show_bug.cgi?id=21364>
    
            Use information from the parser to detect whether an activation is
            needed or 'arguments' is used, and emit explicit instructions to tear
            them off before op_ret. This allows a branch to be removed from op_ret
            and simplifies some other code. This does cause a small change in the
            behaviour of 'f.arguments'; it is no longer live when 'arguments' is not
            mentioned in the lexical scope of the function.
    
            It should now be easy to remove the OptionaCalleeActivation slot in the
            call frame, but this will be done in a later patch.
    
            JavaScriptCore:
    
            * VM/CTI.cpp:
            (JSC::CTI::privateCompileMainPass):
            * VM/CodeBlock.cpp:
            (JSC::CodeBlock::dump):
            * VM/CodeGenerator.cpp:
            (JSC::CodeGenerator::emitReturn):
            * VM/CodeGenerator.h:
            * VM/Machine.cpp:
            (JSC::Machine::unwindCallFrame):
            (JSC::Machine::privateExecute):
            (JSC::Machine::retrieveArguments):
            (JSC::Machine::cti_op_create_arguments):
            (JSC::Machine::cti_op_tear_off_activation):
            (JSC::Machine::cti_op_tear_off_arguments):
            * VM/Machine.h:
            * VM/Opcode.h:
            * kjs/Arguments.cpp:
            (JSC::Arguments::mark):
            * kjs/Arguments.h:
            (JSC::Arguments::isTornOff):
            (JSC::Arguments::Arguments):
            (JSC::Arguments::copyRegisters):
            (JSC::JSActivation::copyRegisters):
            * kjs/JSActivation.cpp:
            (JSC::JSActivation::argumentsGetter):
            * kjs/JSActivation.h:
    
            LayoutTests:
    
            * fast/js/function-dot-arguments-expected.txt:
            * fast/js/resources/function-dot-arguments.js:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37324 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    a3b5f8a7