Ignore:
Timestamp:
Jan 8, 2015, 4:10:01 PM (11 years ago)
Author:
[email protected]
Message:

Make the LLINT and Baseline JIT's op_create_arguments and op_get_argument_by_val use their lexicalEnvironment operand.
<https://webkit.org/b/140236>

Reviewed by Geoffrey Garen.

Will change the DFG to use the operand on a subsequent pass. For now,
the DFG uses a temporary thunk (operationCreateArgumentsForDFG()) to
retain the old behavior of getting the lexicalEnviroment from the
ExecState.

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::emitGetArgumentByVal):
(JSC::BytecodeGenerator::createArgumentsIfNecessary):

  • When the lexicalEnvironment is not available, pass the invalid VirtualRegister instead of an empty JSValue as the lexicalEnvironment operand.
  • dfg/DFGOperations.cpp:
  • Use the lexicalEnvironment from the ExecState for now.
  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • Use the operationCreateArgumentsForDFG() thunk for now.
  • interpreter/CallFrame.cpp:

(JSC::CallFrame::lexicalEnvironmentOrNullptr):

  • interpreter/CallFrame.h:
  • Added this convenience function to return either the lexicalEnvironment or a nullptr so that we don't need to do a conditional check on codeBlock->needsActivation() at multiple sites.
  • interpreter/StackVisitor.cpp:

(JSC::StackVisitor::Frame::createArguments):

  • jit/JIT.h:
  • jit/JITInlines.h:

(JSC::JIT::callOperation):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_create_arguments):
(JSC::JIT::emitSlow_op_get_argument_by_val):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emit_op_create_arguments):
(JSC::JIT::emitSlow_op_get_argument_by_val):

  • jit/JITOperations.cpp:
  • jit/JITOperations.h:
  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • runtime/Arguments.h:

(JSC::Arguments::create):
(JSC::Arguments::finishCreation):

  • runtime/CommonSlowPaths.cpp:

(JSC::SLOW_PATH_DECL):

  • runtime/JSLexicalEnvironment.cpp:

(JSC::JSLexicalEnvironment::argumentsGetter):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITOperations.cpp

    r177675 r178143  
    14031403}
    14041404
    1405 JSCell* JIT_OPERATION operationCreateArguments(ExecState* exec)
     1405// FIXME: This is a temporary thunk for the DFG until we add the lexicalEnvironment operand to the DFG CreateArguments node.
     1406JSCell* JIT_OPERATION operationCreateArgumentsForDFG(ExecState* exec)
     1407{
     1408    JSLexicalEnvironment* lexicalEnvironment = exec->lexicalEnvironmentOrNullptr();
     1409    return operationCreateArguments(exec, lexicalEnvironment);
     1410}
     1411   
     1412JSCell* JIT_OPERATION operationCreateArguments(ExecState* exec, JSLexicalEnvironment* lexicalEnvironment)
    14061413{
    14071414    VM& vm = exec->vm();
     
    14091416    // NB: This needs to be exceedingly careful with top call frame tracking, since it
    14101417    // may be called from OSR exit, while the state of the call stack is bizarre.
    1411     Arguments* result = Arguments::create(vm, exec);
     1418    Arguments* result = Arguments::create(vm, exec, lexicalEnvironment);
    14121419    ASSERT(!vm.exception());
    14131420    return result;
     
    14171424{
    14181425    DeferGCForAWhile(exec->vm().heap);
    1419     return operationCreateArguments(exec);
     1426    JSLexicalEnvironment* lexicalEnvironment = exec->lexicalEnvironmentOrNullptr();
     1427    return operationCreateArguments(exec, lexicalEnvironment);
    14201428}
    14211429
Note: See TracChangeset for help on using the changeset viewer.