Changeset 178856 in webkit


Ignore:
Timestamp:
Jan 21, 2015 1:43:55 PM (9 years ago)
Author:
msaboff@apple.com
Message:

Eliminate Scope slot from JavaScript CallFrame
https://bugs.webkit.org/show_bug.cgi?id=136724

Reviewed by Geoffrey Garen.

This finishes the removal of the scope chain slot from the call frame header.

  • dfg/DFGOSRExitCompilerCommon.cpp:

(JSC::DFG::reifyInlinedCallFrames):

  • dfg/DFGPreciseLocalClobberize.h:

(JSC::DFG::PreciseLocalClobberizeAdaptor::readTop):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::emitCall):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::emitCall):

  • ftl/FTLJSCall.cpp:

(JSC::FTL::JSCall::emit):

  • ftl/FTLLowerDFGToLLVM.cpp:

(JSC::FTL::LowerDFGToLLVM::compileNativeCallOrConstruct):
(JSC::FTL::LowerDFGToLLVM::compileCallOrConstruct):

  • interpreter/JSStack.h:
  • interpreter/VMInspector.cpp:

(JSC::VMInspector::dumpFrame):

  • jit/JITCall.cpp:

(JSC::JIT::compileOpCall):

  • jit/JITCall32_64.cpp:

(JSC::JIT::compileOpCall):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::privateCompileCTINativeCall):

  • jit/Repatch.cpp:

(JSC::generateByIdStub):
(JSC::linkClosureCall):

  • jit/ThunkGenerators.cpp:

(JSC::virtualForThunkGenerator):
(JSC::nativeForGenerator):
Deleted ScopeChain slot from JSStack. Removed all code where ScopeChain was being
read or set. In most cases this was where we make JS calls.

  • interpreter/CallFrameClosure.h:

(JSC::CallFrameClosure::setArgument):
(JSC::CallFrameClosure::resetCallFrame): Deleted.

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
(JSC::Interpreter::prepareForRepeatCall):

  • interpreter/ProtoCallFrame.cpp:

(JSC::ProtoCallFrame::init):

  • interpreter/ProtoCallFrame.h:

(JSC::ProtoCallFrame::scope): Deleted.
(JSC::ProtoCallFrame::setScope): Deleted.

  • llint/LLIntData.cpp:

(JSC::LLInt::Data::performAssertions):

  • llint/LowLevelInterpreter.asm:
  • llint/LowLevelInterpreter64.asm:

Removed the related scopeChainValue member from ProtoCallFrame. Reduced the number of
registers that needed to be copied from the ProtoCallFrame to a callee's frame
from 5 to 4.

  • llint/LowLevelInterpreter32_64.asm:

In addition to the prior changes, also deleted the unused macro getDeBruijnScope.

Location:
trunk/Source/JavaScriptCore
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r178855 r178856  
     12015-01-21  Michael Saboff  <msaboff@apple.com>
     2
     3        Eliminate Scope slot from JavaScript CallFrame
     4        https://bugs.webkit.org/show_bug.cgi?id=136724
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        This finishes the removal of the scope chain slot from the call frame header.
     9
     10        * dfg/DFGOSRExitCompilerCommon.cpp:
     11        (JSC::DFG::reifyInlinedCallFrames):
     12        * dfg/DFGPreciseLocalClobberize.h:
     13        (JSC::DFG::PreciseLocalClobberizeAdaptor::readTop):
     14        * dfg/DFGSpeculativeJIT32_64.cpp:
     15        (JSC::DFG::SpeculativeJIT::emitCall):
     16        * dfg/DFGSpeculativeJIT64.cpp:
     17        (JSC::DFG::SpeculativeJIT::emitCall):
     18        * ftl/FTLJSCall.cpp:
     19        (JSC::FTL::JSCall::emit):
     20        * ftl/FTLLowerDFGToLLVM.cpp:
     21        (JSC::FTL::LowerDFGToLLVM::compileNativeCallOrConstruct):
     22        (JSC::FTL::LowerDFGToLLVM::compileCallOrConstruct):
     23        * interpreter/JSStack.h:
     24        * interpreter/VMInspector.cpp:
     25        (JSC::VMInspector::dumpFrame):
     26        * jit/JITCall.cpp:
     27        (JSC::JIT::compileOpCall):
     28        * jit/JITCall32_64.cpp:
     29        (JSC::JIT::compileOpCall):
     30        * jit/JITOpcodes32_64.cpp:
     31        (JSC::JIT::privateCompileCTINativeCall):
     32        * jit/Repatch.cpp:
     33        (JSC::generateByIdStub):
     34        (JSC::linkClosureCall):
     35        * jit/ThunkGenerators.cpp:
     36        (JSC::virtualForThunkGenerator):
     37        (JSC::nativeForGenerator):
     38        Deleted ScopeChain slot from JSStack.  Removed all code where ScopeChain was being
     39        read or set.  In most cases this was where we make JS calls.
     40
     41        * interpreter/CallFrameClosure.h:
     42        (JSC::CallFrameClosure::setArgument):
     43        (JSC::CallFrameClosure::resetCallFrame): Deleted.
     44        * interpreter/Interpreter.cpp:
     45        (JSC::Interpreter::execute):
     46        (JSC::Interpreter::executeCall):
     47        (JSC::Interpreter::executeConstruct):
     48        (JSC::Interpreter::prepareForRepeatCall):
     49        * interpreter/ProtoCallFrame.cpp:
     50        (JSC::ProtoCallFrame::init):
     51        * interpreter/ProtoCallFrame.h:
     52        (JSC::ProtoCallFrame::scope): Deleted.
     53        (JSC::ProtoCallFrame::setScope): Deleted.
     54        * llint/LLIntData.cpp:
     55        (JSC::LLInt::Data::performAssertions):
     56        * llint/LowLevelInterpreter.asm:
     57        * llint/LowLevelInterpreter64.asm:
     58        Removed the related scopeChainValue member from ProtoCallFrame.  Reduced the number of
     59        registers that needed to be copied from the ProtoCallFrame to a callee's frame
     60        from 5 to 4.
     61
     62        * llint/LowLevelInterpreter32_64.asm:
     63        In addition to the prior changes, also deleted the unused macro getDeBruijnScope.
     64
    1652015-01-21  Michael Saboff  <msaboff@apple.com>
    266
  • trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp

    r178591 r178856  
    198198#if USE(JSVALUE64)
    199199        jit.storePtr(AssemblyHelpers::TrustedImmPtr(baselineCodeBlock), AssemblyHelpers::addressFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::CodeBlock)));
    200         if (!inlineCallFrame->isClosureCall)
    201             jit.store64(AssemblyHelpers::TrustedImm64(JSValue::encode(JSValue(inlineCallFrame->calleeConstant()->scope()))), AssemblyHelpers::addressFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::ScopeChain)));
    202200        jit.store64(callerFrameGPR, AssemblyHelpers::addressForByteOffset(inlineCallFrame->callerFrameOffset()));
    203201        uint32_t locationBits = CallFrame::Location::encodeAsBytecodeOffset(codeOrigin.bytecodeIndex);
     
    212210#else // USE(JSVALUE64) // so this is the 32-bit part
    213211        jit.storePtr(AssemblyHelpers::TrustedImmPtr(baselineCodeBlock), AssemblyHelpers::addressFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::CodeBlock)));
    214         jit.store32(AssemblyHelpers::TrustedImm32(JSValue::CellTag), AssemblyHelpers::tagFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::ScopeChain)));
    215         if (!inlineCallFrame->isClosureCall)
    216             jit.storePtr(AssemblyHelpers::TrustedImmPtr(inlineCallFrame->calleeConstant()->scope()), AssemblyHelpers::payloadFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::ScopeChain)));
    217212        jit.storePtr(callerFrameGPR, AssemblyHelpers::addressForByteOffset(inlineCallFrame->callerFrameOffset()));
    218213        Instruction* instruction = baselineCodeBlock->instructions().begin() + codeOrigin.bytecodeIndex;
  • trunk/Source/JavaScriptCore/dfg/DFGPreciseLocalClobberize.h

    r174318 r178856  
    132132            for (unsigned i = inlineCallFrame->arguments.size(); i-- > 1;)
    133133                m_read(VirtualRegister(inlineCallFrame->stackOffset + virtualRegisterForArgument(i).offset()));
    134             if (inlineCallFrame->isClosureCall) {
    135                 m_read(VirtualRegister(inlineCallFrame->stackOffset + JSStack::ScopeChain));
     134            if (inlineCallFrame->isClosureCall)
    136135                m_read(VirtualRegister(inlineCallFrame->stackOffset + JSStack::Callee));
    137             }
    138136        }
    139137    }
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp

    r178143 r178856  
    697697    slowPath.append(branchNotCell(callee.jsValueRegs()));
    698698    slowPath.append(m_jit.branchPtrWithPatch(MacroAssembler::NotEqual, calleePayloadGPR, targetToCheck));
    699     m_jit.loadPtr(MacroAssembler::Address(calleePayloadGPR, OBJECT_OFFSETOF(JSFunction, m_scope)), resultPayloadGPR);
    700     m_jit.storePtr(resultPayloadGPR, calleeFramePayloadSlot(JSStack::ScopeChain));
    701     m_jit.storePtr(MacroAssembler::TrustedImm32(JSValue::CellTag), calleeFrameTagSlot(JSStack::ScopeChain));
    702699
    703700    JITCompiler::Call fastCall = m_jit.nearCall();
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp

    r178788 r178856  
    676676
    677677    slowPath = m_jit.branchPtrWithPatch(MacroAssembler::NotEqual, calleeGPR, targetToCheck, MacroAssembler::TrustedImmPtr(0));
    678 
    679     m_jit.loadPtr(MacroAssembler::Address(calleeGPR, OBJECT_OFFSETOF(JSFunction, m_scope)), resultGPR);
    680     m_jit.store64(resultGPR, calleeFrameSlot(JSStack::ScopeChain));
    681678
    682679    JITCompiler::Call fastCall = m_jit.nearCall();
  • trunk/Source/JavaScriptCore/ftl/FTLJSCall.cpp

    r170876 r178856  
    5858        CCallHelpers::TrustedImmPtr(0));
    5959   
    60     jit.loadPtr(
    61         CCallHelpers::Address(GPRInfo::regT0, JSFunction::offsetOfScopeChain()),
    62         GPRInfo::regT1);
    63     jit.store64(
    64         GPRInfo::regT1,
    65         CCallHelpers::Address(
    66             CCallHelpers::stackPointerRegister,
    67             sizeof(Register) * (JSStack::ScopeChain - JSStack::CallerFrameAndPCSize)));
    68    
    6960    m_fastCall = jit.nearCall();
    7061    CCallHelpers::Jump done = jit.jump();
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp

    r176771 r178856  
    36283628            callee = m_out.operation(function);
    36293629
    3630         JSScope* scope = knownFunction->scopeUnchecked();
    36313630        m_out.storePtr(m_callFrame, m_execStorage, m_heaps.CallFrame_callerFrame);
    36323631        m_out.storePtr(constNull(m_out.intPtr), addressFor(m_execStorage, JSStack::CodeBlock));
    3633         m_out.storePtr(weakPointer(scope), addressFor(m_execStorage, JSStack::ScopeChain));
    36343632        m_out.storePtr(weakPointer(knownFunction), addressFor(m_execStorage, JSStack::Callee));
    36353633
     
    36793677        arguments.append(jsCallee); // callee -> %rax
    36803678        arguments.append(getUndef(m_out.int64)); // code block
    3681         arguments.append(getUndef(m_out.int64)); // scope chain
    36823679        arguments.append(jsCallee); // callee -> stack
    36833680        arguments.append(m_out.constInt64(numArgs)); // argument count and zeros for the tag
  • trunk/Source/JavaScriptCore/interpreter/CallFrameClosure.h

    r160186 r178856  
    5050        protoCallFrame->setArgument(argument, value);
    5151    }
    52 
    53     void resetCallFrame()
    54     {
    55         protoCallFrame->setScope(scope);
    56     }
    5752};
    5853
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r177460 r178856  
    901901
    902902    ProtoCallFrame protoCallFrame;
    903     protoCallFrame.init(codeBlock, scope, JSCallee::create(vm, scope->globalObject(), scope), thisObj, 1);
     903    protoCallFrame.init(codeBlock, JSCallee::create(vm, scope->globalObject(), scope), thisObj, 1);
    904904
    905905    if (LegacyProfiler* profiler = vm.enabledProfiler())
     
    964964
    965965    ProtoCallFrame protoCallFrame;
    966     protoCallFrame.init(newCodeBlock, scope, function, thisValue, argsCount, args.data());
     966    protoCallFrame.init(newCodeBlock, function, thisValue, argsCount, args.data());
    967967
    968968    if (LegacyProfiler* profiler = vm.enabledProfiler())
     
    10351035
    10361036    ProtoCallFrame protoCallFrame;
    1037     protoCallFrame.init(newCodeBlock, scope, constructor, jsUndefined(), argsCount, args.data());
     1037    protoCallFrame.init(newCodeBlock, constructor, jsUndefined(), argsCount, args.data());
    10381038
    10391039    if (LegacyProfiler* profiler = vm.enabledProfiler())
     
    10841084    size_t argsCount = argumentCountIncludingThis;
    10851085
    1086     protoCallFrame->init(newCodeBlock, scope, function, jsUndefined(), argsCount, args);
     1086    protoCallFrame->init(newCodeBlock, function, jsUndefined(), argsCount, args);
    10871087    // Return the successful closure:
    10881088    CallFrameClosure result = { callFrame, protoCallFrame, function, functionExecutable, &vm, scope, newCodeBlock->numParameters(), argumentCountIncludingThis };
     
    11011101
    11021102    StackStats::CheckPoint stackCheckPoint;
    1103     closure.resetCallFrame();
    11041103
    11051104    if (LegacyProfiler* profiler = vm.enabledProfiler())
     
    11881187
    11891188    ProtoCallFrame protoCallFrame;
    1190     protoCallFrame.init(codeBlock, scope, JSCallee::create(vm, scope->globalObject(), scope), thisValue, 1);
     1189    protoCallFrame.init(codeBlock, JSCallee::create(vm, scope->globalObject(), scope), thisValue, 1);
    11911190
    11921191    if (LegacyProfiler* profiler = vm.enabledProfiler())
  • trunk/Source/JavaScriptCore/interpreter/JSStack.h

    r170147 r178856  
    5959            CallerFrameAndPCSize = sizeof(CallerFrameAndPC) / sizeof(Register),
    6060            CodeBlock = CallerFrameAndPCSize,
    61             ScopeChain,
    6261            Callee,
    6362            ArgumentCount,
  • trunk/Source/JavaScriptCore/interpreter/ProtoCallFrame.cpp

    r173178 r178856  
    3333namespace JSC {
    3434
    35 void ProtoCallFrame::init(CodeBlock* codeBlock, JSScope* scope, JSObject* callee, JSValue thisValue, int argCountIncludingThis, JSValue* otherArgs)
     35void ProtoCallFrame::init(CodeBlock* codeBlock, JSObject* callee, JSValue thisValue, int argCountIncludingThis, JSValue* otherArgs)
    3636{
    3737    this->args = otherArgs;
    3838    this->setCodeBlock(codeBlock);
    39     this->setScope(scope);
    4039    this->setCallee(callee);
    4140    this->setArgumentCountIncludingThis(argCountIncludingThis);
  • trunk/Source/JavaScriptCore/interpreter/ProtoCallFrame.h

    r173178 r178856  
    3333struct ProtoCallFrame {
    3434    Register codeBlockValue;
    35     Register scopeChainValue;
    3635    Register calleeValue;
    3736    Register argCountAndCodeOriginValue;
     
    4140    JSValue *args;
    4241
    43     void init(CodeBlock*, JSScope*, JSObject*, JSValue, int, JSValue* otherArgs = 0);
     42    void init(CodeBlock*, JSObject*, JSValue, int, JSValue* otherArgs = 0);
    4443
    4544    CodeBlock* codeBlock() const { return codeBlockValue.Register::codeBlock(); }
    4645    void setCodeBlock(CodeBlock* codeBlock) { codeBlockValue = codeBlock; }
    47 
    48     JSScope* scope() const { return scopeChainValue.Register::scope(); }
    49     void setScope(JSScope* scope) { scopeChainValue = scope; }
    5046
    5147    JSObject* callee() const { return calleeValue.Register::function(); }
  • trunk/Source/JavaScriptCore/interpreter/VMInspector.cpp

    r172665 r178856  
    7474        printf("%s ", prefix);
    7575
    76     printf("frame [%d] %p { cb %p:%s, retPC %p:%s, scope %p:%s, callee %p:%s, callerFrame %p:%s, argc %d, vPC %p }",
     76    printf("frame [%d] %p { cb %p:%s, retPC %p:%s, callee %p:%s, callerFrame %p:%s, argc %d, vPC %p }",
    7777        frameCount, frame,
    7878        CAST<void*>(frame[JSStack::CodeBlock].payload()),
     
    8080        CAST<void*>(frame[JSStack::ReturnPC].payload()),
    8181        getTypeName(frame[JSStack::ReturnPC].jsValue()),
    82         CAST<void*>(frame[JSStack::ScopeChain].payload()),
    83         getTypeName(frame[JSStack::ScopeChain].jsValue()),
    8482        CAST<void*>(frame[JSStack::Callee].payload()),
    8583        getTypeName(frame[JSStack::Callee].jsValue()),
  • trunk/Source/JavaScriptCore/jit/JITCall.cpp

    r173282 r178856  
    178178
    179179       For a JS call:
    180         - Caller initializes ScopeChain.
    181180        - Callee initializes ReturnPC; CodeBlock.
    182181        - Callee restores callFrameRegister before return.
    183182
    184183       For a non-JS call:
    185         - Caller initializes ScopeChain; ReturnPC; CodeBlock.
     184        - Caller initializes ReturnPC; CodeBlock.
    186185        - Caller restores callFrameRegister after return.
    187186    */
     
    237236    m_callCompilationInfo[callLinkInfoIndex].callLinkInfo = info;
    238237
    239     loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scope)), regT2);
    240     store64(regT2, Address(MacroAssembler::stackPointerRegister, JSStack::ScopeChain * sizeof(Register) - sizeof(CallerFrameAndPC)));
    241 
    242238    m_callCompilationInfo[callLinkInfoIndex].hotPathOther = emitNakedCall();
    243239
  • trunk/Source/JavaScriptCore/jit/JITCall32_64.cpp

    r173282 r178856  
    265265
    266266       For a JS call:
    267         - Caller initializes ScopeChain.
    268267        - Callee initializes ReturnPC; CodeBlock.
    269268        - Callee restores callFrameRegister before return.
    270269
    271270       For a non-JS call:
    272         - Caller initializes ScopeChain; ReturnPC; CodeBlock.
     271        - Caller initializes ReturnPC; CodeBlock.
    273272        - Caller restores callFrameRegister after return.
    274273    */
     
    328327    m_callCompilationInfo[callLinkInfoIndex].callLinkInfo = info;
    329328
    330     loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scope)), regT2);
    331     store32(regT2, Address(MacroAssembler::stackPointerRegister, JSStack::ScopeChain * sizeof(Register) + PayloadOffset - sizeof(CallerFrameAndPC)));
    332     store32(TrustedImm32(JSValue::CellTag), Address(stackPointerRegister, JSStack::ScopeChain * sizeof(Register) + TagOffset - sizeof(CallerFrameAndPC)));
    333 
    334329    checkStackPointerAlignment();
    335330    m_callCompilationInfo[callLinkInfoIndex].hotPathOther = emitNakedCall();
  • trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp

    r178143 r178856  
    5858
    5959#if CPU(X86)
    60     // Load caller frame's scope chain into this callframe so that whatever we call can
    61     // get to its global data.
    62     emitGetCallerFrameFromCallFrameHeaderPtr(regT0);
    63     emitGetFromCallFrameHeaderPtr(JSStack::ScopeChain, regT1, regT0);
    64     emitPutCellToCallFrameHeader(regT1, JSStack::ScopeChain);
    65 
    6660    // Calling convention:      f(ecx, edx, ...);
    6761    // Host function signature: f(ExecState*);
     
    7771
    7872#elif CPU(ARM) || CPU(SH4) || CPU(MIPS)
    79     // Load caller frame's scope chain into this callframe so that whatever we call can get to its global data.
    80     emitGetCallerFrameFromCallFrameHeaderPtr(regT2);
    81     emitGetFromCallFrameHeaderPtr(JSStack::ScopeChain, regT1, regT2);
    82     emitPutCellToCallFrameHeader(regT1, JSStack::ScopeChain);
    83 
    8473#if CPU(MIPS)
    8574    // Allocate stack space for (unused) 16 bytes (8-byte aligned) for 4 arguments.
  • trunk/Source/JavaScriptCore/jit/Repatch.cpp

    r178756 r178856  
    512512                MacroAssembler::TrustedImmPtr(0));
    513513           
    514             // loadedValueGPR is already burned. We can reuse it. From here on we assume that
    515             // any volatile register will be clobbered anyway.
    516             stubJit.loadPtr(
    517                 MacroAssembler::Address(loadedValueGPR, JSFunction::offsetOfScopeChain()),
    518                 loadedValueGPR);
    519             stubJit.storeCell(
    520                 loadedValueGPR, calleeFrame.withOffset(JSStack::ScopeChain * sizeof(Register)));
    521514            fastPathCall = stubJit.nearCall();
    522515           
     
    16861679            CCallHelpers::TrustedImmPtr(executable)));
    16871680   
    1688     stubJit.loadPtr(
    1689         CCallHelpers::Address(calleeGPR, JSFunction::offsetOfScopeChain()),
    1690         GPRInfo::returnValueGPR);
    1691    
    1692 #if USE(JSVALUE64)
    1693     stubJit.store64(
    1694         GPRInfo::returnValueGPR,
    1695         CCallHelpers::Address(MacroAssembler::stackPointerRegister, static_cast<ptrdiff_t>(sizeof(Register) * JSStack::ScopeChain) + offsetToFrame));
    1696 #else
    1697     stubJit.storePtr(
    1698         GPRInfo::returnValueGPR,
    1699         CCallHelpers::Address(MacroAssembler::stackPointerRegister, static_cast<ptrdiff_t>(sizeof(Register) * JSStack::ScopeChain) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload) + offsetToFrame));
    1700     stubJit.store32(
    1701         CCallHelpers::TrustedImm32(JSValue::CellTag),
    1702         CCallHelpers::Address(MacroAssembler::stackPointerRegister, static_cast<ptrdiff_t>(sizeof(Register) * JSStack::ScopeChain) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag) + offsetToFrame));
    1703 #endif
    1704    
    17051681    AssemblyHelpers::Call call = stubJit.nearCall();
    17061682    AssemblyHelpers::Jump done = stubJit.jump();
  • trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp

    r175243 r178856  
    215215    // call.
    216216   
    217     jit.loadPtr(
    218         CCallHelpers::Address(GPRInfo::regT0, JSFunction::offsetOfScopeChain()),
    219         GPRInfo::regT1);
    220 #if USE(JSVALUE64)
    221     jit.emitPutToCallFrameHeaderBeforePrologue(GPRInfo::regT1, JSStack::ScopeChain);
    222 #else
    223     jit.emitPutPayloadToCallFrameHeaderBeforePrologue(GPRInfo::regT1, JSStack::ScopeChain);
    224     jit.emitPutTagToCallFrameHeaderBeforePrologue(CCallHelpers::TrustedImm32(JSValue::CellTag),
    225         JSStack::ScopeChain);
    226 #endif
    227    
    228217    // Make a tail call. This will return back to JIT code.
    229218    emitPointerValidation(jit, GPRInfo::regT4);
     
    277266
    278267#if CPU(X86)
    279     // Load callee's scope chain into this callframe so that whatever we call can
    280     // get to its global data.
    281     jit.emitGetFromCallFrameHeaderPtr(JSStack::Callee, JSInterfaceJIT::regT1);
    282     jit.loadPtr(JSInterfaceJIT::Address(JSInterfaceJIT::regT1, JSCallee::offsetOfScopeChain()), JSInterfaceJIT::regT1);
    283     jit.emitPutCellToCallFrameHeader(JSInterfaceJIT::regT1, JSStack::ScopeChain);
    284 
    285268    // Calling convention:      f(ecx, edx, ...);
    286269    // Host function signature: f(ExecState*);
     
    297280
    298281#elif CPU(X86_64)
    299     // Load callee's scope chain into this callframe so that whatever we call can
    300     // get to its global data.
    301     jit.emitGetFromCallFrameHeaderPtr(JSStack::Callee, JSInterfaceJIT::regT1);
    302     jit.loadPtr(JSInterfaceJIT::Address(JSInterfaceJIT::regT1, JSCallee::offsetOfScopeChain()), JSInterfaceJIT::regT1);
    303     jit.emitPutCellToCallFrameHeader(JSInterfaceJIT::regT1, JSStack::ScopeChain);
    304282#if !OS(WINDOWS)
    305283    // Calling convention:      f(edi, esi, edx, ecx, ...);
     
    334312    COMPILE_ASSERT(ARM64Registers::x2 != JSInterfaceJIT::regT3, T3_not_trampled_by_arg_2);
    335313
    336     // Load callee's scope chain into this callframe so that whatever we call can
    337     // get to its global data.
    338     jit.emitGetFromCallFrameHeaderPtr(JSStack::Callee, JSInterfaceJIT::regT1);
    339     jit.loadPtr(JSInterfaceJIT::Address(JSInterfaceJIT::regT1, JSCallee::offsetOfScopeChain()), JSInterfaceJIT::regT1);
    340     jit.emitPutCellToCallFrameHeader(JSInterfaceJIT::regT1, JSStack::ScopeChain);
    341 
    342314    // Host function signature: f(ExecState*);
    343315    jit.move(JSInterfaceJIT::callFrameRegister, ARM64Registers::x0);
     
    347319    jit.call(JSInterfaceJIT::Address(ARM64Registers::x2, executableOffsetToFunction));
    348320#elif CPU(ARM) || CPU(SH4) || CPU(MIPS)
    349     // Load callee's scope chain into this callframe so that whatever we call can
    350     // get to its global data.
    351     jit.emitGetFromCallFrameHeaderPtr(JSStack::Callee, JSInterfaceJIT::regT1);
    352     jit.loadPtr(JSInterfaceJIT::Address(JSInterfaceJIT::regT1, JSCallee::offsetOfScopeChain()), JSInterfaceJIT::regT1);
    353     jit.emitPutCellToCallFrameHeader(JSInterfaceJIT::regT1, JSStack::ScopeChain);
    354 
    355321#if CPU(MIPS)
    356322    // Allocate stack space for (unused) 16 bytes (8-byte aligned) for 4 arguments.
  • trunk/Source/JavaScriptCore/llint/LLIntData.cpp

    r177316 r178856  
    7474#if USE(JSVALUE64)
    7575    const ptrdiff_t PtrSize = 8;
    76     const ptrdiff_t CallFrameHeaderSlots = 6;
     76    const ptrdiff_t CallFrameHeaderSlots = 5;
    7777#else // USE(JSVALUE64) // i.e. 32-bit version
    7878    const ptrdiff_t PtrSize = 4;
    79     const ptrdiff_t CallFrameHeaderSlots = 5;
     79    const ptrdiff_t CallFrameHeaderSlots = 4;
    8080#endif
    8181    const ptrdiff_t SlotSize = 8;
     
    9090    ASSERT(CallFrame::returnPCOffset() == CallFrame::callerFrameOffset() + PtrSize);
    9191    ASSERT(JSStack::CodeBlock * sizeof(Register) == CallFrame::returnPCOffset() + PtrSize);
    92     ASSERT(JSStack::ScopeChain * sizeof(Register) == JSStack::CodeBlock * sizeof(Register) + SlotSize);
    93     ASSERT(JSStack::Callee * sizeof(Register) == JSStack::ScopeChain * sizeof(Register) + SlotSize);
     92    ASSERT(JSStack::Callee * sizeof(Register) == JSStack::CodeBlock * sizeof(Register) + SlotSize);
    9493    ASSERT(JSStack::ArgumentCount * sizeof(Register) == JSStack::Callee * sizeof(Register) + SlotSize);
    9594    ASSERT(JSStack::ThisArgument * sizeof(Register) == JSStack::ArgumentCount * sizeof(Register) + SlotSize);
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm

    r178073 r178856  
    3535if JSVALUE64
    3636    const PtrSize = 8
    37     const CallFrameHeaderSlots = 6
     37    const CallFrameHeaderSlots = 5
    3838else
    3939    const PtrSize = 4
    40     const CallFrameHeaderSlots = 5
     40    const CallFrameHeaderSlots = 4
    4141    const CallFrameAlignSlots = 1
    4242end
     
    5151const ReturnPC = CallerFrame + PtrSize
    5252const CodeBlock = ReturnPC + PtrSize
    53 const ScopeChain = CodeBlock + SlotSize
    54 const Callee = ScopeChain + SlotSize
     53const Callee = CodeBlock + SlotSize
    5554const ArgumentCount = Callee + SlotSize
    5655const ThisArgumentOffset = ArgumentCount + SlotSize
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm

    r178106 r178856  
    288288.stackHeightOK:
    289289    move temp1, sp
    290     move 5, temp1
     290    move 4, temp1
    291291
    292292.copyHeaderLoop:
     
    19411941    negi t3
    19421942    addp cfr, t3  # t3 contains the new value of cfr
    1943     loadp JSFunction::m_scope[t2], t0
    19441943    storei t2, Callee + PayloadOffset[t3]
    1945     storei t0, ScopeChain + PayloadOffset[t3]
    19461944    loadi 12[PC], t2
    19471945    storei PC, ArgumentCount + TagOffset[cfr]
    19481946    storei t2, ArgumentCount + PayloadOffset[t3]
    19491947    storei CellTag, Callee + TagOffset[t3]
    1950     storei CellTag, ScopeChain + TagOffset[t3]
    19511948    addp CallerFrameAndPCSize, t3
    19521949    callTargetFunction(t1, t3)
     
    20302027    dispatch(2)
    20312028
    2032 
    2033 # Gives you the scope in t0, while allowing you to optionally perform additional checks on the
    2034 # scopes as they are traversed. scopeCheck() is called with two arguments: the register
    2035 # holding the scope, and a register that can be used for scratch. Note that this does not
    2036 # use t3, so you can hold stuff in t3 if need be.
    2037 macro getDeBruijnScope(deBruijinIndexOperand, scopeCheck)
    2038     loadp ScopeChain + PayloadOffset[cfr], t0
    2039     loadi deBruijinIndexOperand, t2
    2040 
    2041     btiz t2, .done
    2042 
    2043     loadp CodeBlock[cfr], t1
    2044     bineq CodeBlock::m_codeType[t1], FunctionCode, .loop
    2045     btbz CodeBlock::m_needsActivation[t1], .loop
    2046 
    2047     loadi CodeBlock::m_lexicalEnvironmentRegister[t1], t1
    2048 
    2049     # Need to conditionally skip over one scope.
    2050     bieq TagOffset[cfr, t1, 8], EmptyValueTag, .noActivation
    2051     scopeCheck(t0, t1)
    2052     loadp JSScope::m_next[t0], t0
    2053 .noActivation:
    2054     subi 1, t2
    2055 
    2056     btiz t2, .done
    2057 .loop:
    2058     scopeCheck(t0, t1)
    2059     loadp JSScope::m_next[t0], t0
    2060     subi 1, t2
    2061     btinz t2, .loop
    2062 
    2063 .done:
    2064 
    2065 end
    2066 
    20672029_llint_op_end:
    20682030    traceExecution()
     
    20962058    storep 0, CodeBlock[cfr]
    20972059    loadi Callee + PayloadOffset[cfr], t1
    2098     loadi JSCallee::m_scope[t1], t0
    2099     storei CellTag, ScopeChain + TagOffset[cfr]
    2100     storei t0, ScopeChain + PayloadOffset[cfr]
    21012060    // Callee is still in t1 for code below
    21022061    if X86 or X86_WIN
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm

    r178106 r178856  
    227227.stackHeightOK:
    228228    move temp1, sp
    229     move 5, temp1
     229    move 4, temp1
    230230
    231231.copyHeaderLoop:
     
    18001800    negp t3
    18011801    addp cfr, t3
    1802     loadp JSFunction::m_scope[t2], t0
    18031802    storeq t2, Callee[t3]
    1804     storeq t0, ScopeChain[t3]
    18051803    loadisFromInstruction(3, t2)
    18061804    storei PC, ArgumentCount + TagOffset[cfr]
     
    19311929        loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t1], t1
    19321930        storep cfr, VM::topCallFrame[t1]
    1933         // Callee still in t0
    1934         loadp JSCallee::m_scope[t0], t1
    1935         storeq t1, ScopeChain[cfr]
    19361931        move cfr, arg1
    19371932        loadp Callee[cfr], arg2
     
    19531948        loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t1], t1
    19541949        storep cfr, VM::topCallFrame[t1]
    1955         // Callee still in t0
    1956         loadp JSCallee::m_scope[t0], t1
    1957         storep t1, ScopeChain[cfr]
    19581950        preserveReturnAddressAfterCall(t3)
    19591951        storep t3, ReturnPC[cfr]
Note: See TracChangeset for help on using the changeset viewer.