Changeset 178856 in webkit
- Timestamp:
- Jan 21, 2015 1:43:55 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r178855 r178856 1 2015-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 1 65 2015-01-21 Michael Saboff <msaboff@apple.com> 2 66 -
trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp
r178591 r178856 198 198 #if USE(JSVALUE64) 199 199 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)));202 200 jit.store64(callerFrameGPR, AssemblyHelpers::addressForByteOffset(inlineCallFrame->callerFrameOffset())); 203 201 uint32_t locationBits = CallFrame::Location::encodeAsBytecodeOffset(codeOrigin.bytecodeIndex); … … 212 210 #else // USE(JSVALUE64) // so this is the 32-bit part 213 211 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)));217 212 jit.storePtr(callerFrameGPR, AssemblyHelpers::addressForByteOffset(inlineCallFrame->callerFrameOffset())); 218 213 Instruction* instruction = baselineCodeBlock->instructions().begin() + codeOrigin.bytecodeIndex; -
trunk/Source/JavaScriptCore/dfg/DFGPreciseLocalClobberize.h
r174318 r178856 132 132 for (unsigned i = inlineCallFrame->arguments.size(); i-- > 1;) 133 133 m_read(VirtualRegister(inlineCallFrame->stackOffset + virtualRegisterForArgument(i).offset())); 134 if (inlineCallFrame->isClosureCall) { 135 m_read(VirtualRegister(inlineCallFrame->stackOffset + JSStack::ScopeChain)); 134 if (inlineCallFrame->isClosureCall) 136 135 m_read(VirtualRegister(inlineCallFrame->stackOffset + JSStack::Callee)); 137 }138 136 } 139 137 } -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
r178143 r178856 697 697 slowPath.append(branchNotCell(callee.jsValueRegs())); 698 698 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));702 699 703 700 JITCompiler::Call fastCall = m_jit.nearCall(); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r178788 r178856 676 676 677 677 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));681 678 682 679 JITCompiler::Call fastCall = m_jit.nearCall(); -
trunk/Source/JavaScriptCore/ftl/FTLJSCall.cpp
r170876 r178856 58 58 CCallHelpers::TrustedImmPtr(0)); 59 59 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 69 60 m_fastCall = jit.nearCall(); 70 61 CCallHelpers::Jump done = jit.jump(); -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp
r176771 r178856 3628 3628 callee = m_out.operation(function); 3629 3629 3630 JSScope* scope = knownFunction->scopeUnchecked();3631 3630 m_out.storePtr(m_callFrame, m_execStorage, m_heaps.CallFrame_callerFrame); 3632 3631 m_out.storePtr(constNull(m_out.intPtr), addressFor(m_execStorage, JSStack::CodeBlock)); 3633 m_out.storePtr(weakPointer(scope), addressFor(m_execStorage, JSStack::ScopeChain));3634 3632 m_out.storePtr(weakPointer(knownFunction), addressFor(m_execStorage, JSStack::Callee)); 3635 3633 … … 3679 3677 arguments.append(jsCallee); // callee -> %rax 3680 3678 arguments.append(getUndef(m_out.int64)); // code block 3681 arguments.append(getUndef(m_out.int64)); // scope chain3682 3679 arguments.append(jsCallee); // callee -> stack 3683 3680 arguments.append(m_out.constInt64(numArgs)); // argument count and zeros for the tag -
trunk/Source/JavaScriptCore/interpreter/CallFrameClosure.h
r160186 r178856 50 50 protoCallFrame->setArgument(argument, value); 51 51 } 52 53 void resetCallFrame()54 {55 protoCallFrame->setScope(scope);56 }57 52 }; 58 53 -
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r177460 r178856 901 901 902 902 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); 904 904 905 905 if (LegacyProfiler* profiler = vm.enabledProfiler()) … … 964 964 965 965 ProtoCallFrame protoCallFrame; 966 protoCallFrame.init(newCodeBlock, scope,function, thisValue, argsCount, args.data());966 protoCallFrame.init(newCodeBlock, function, thisValue, argsCount, args.data()); 967 967 968 968 if (LegacyProfiler* profiler = vm.enabledProfiler()) … … 1035 1035 1036 1036 ProtoCallFrame protoCallFrame; 1037 protoCallFrame.init(newCodeBlock, scope,constructor, jsUndefined(), argsCount, args.data());1037 protoCallFrame.init(newCodeBlock, constructor, jsUndefined(), argsCount, args.data()); 1038 1038 1039 1039 if (LegacyProfiler* profiler = vm.enabledProfiler()) … … 1084 1084 size_t argsCount = argumentCountIncludingThis; 1085 1085 1086 protoCallFrame->init(newCodeBlock, scope,function, jsUndefined(), argsCount, args);1086 protoCallFrame->init(newCodeBlock, function, jsUndefined(), argsCount, args); 1087 1087 // Return the successful closure: 1088 1088 CallFrameClosure result = { callFrame, protoCallFrame, function, functionExecutable, &vm, scope, newCodeBlock->numParameters(), argumentCountIncludingThis }; … … 1101 1101 1102 1102 StackStats::CheckPoint stackCheckPoint; 1103 closure.resetCallFrame();1104 1103 1105 1104 if (LegacyProfiler* profiler = vm.enabledProfiler()) … … 1188 1187 1189 1188 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); 1191 1190 1192 1191 if (LegacyProfiler* profiler = vm.enabledProfiler()) -
trunk/Source/JavaScriptCore/interpreter/JSStack.h
r170147 r178856 59 59 CallerFrameAndPCSize = sizeof(CallerFrameAndPC) / sizeof(Register), 60 60 CodeBlock = CallerFrameAndPCSize, 61 ScopeChain,62 61 Callee, 63 62 ArgumentCount, -
trunk/Source/JavaScriptCore/interpreter/ProtoCallFrame.cpp
r173178 r178856 33 33 namespace JSC { 34 34 35 void ProtoCallFrame::init(CodeBlock* codeBlock, JS Scope* scope, JSObject* callee, JSValue thisValue, int argCountIncludingThis, JSValue* otherArgs)35 void ProtoCallFrame::init(CodeBlock* codeBlock, JSObject* callee, JSValue thisValue, int argCountIncludingThis, JSValue* otherArgs) 36 36 { 37 37 this->args = otherArgs; 38 38 this->setCodeBlock(codeBlock); 39 this->setScope(scope);40 39 this->setCallee(callee); 41 40 this->setArgumentCountIncludingThis(argCountIncludingThis); -
trunk/Source/JavaScriptCore/interpreter/ProtoCallFrame.h
r173178 r178856 33 33 struct ProtoCallFrame { 34 34 Register codeBlockValue; 35 Register scopeChainValue;36 35 Register calleeValue; 37 36 Register argCountAndCodeOriginValue; … … 41 40 JSValue *args; 42 41 43 void init(CodeBlock*, JS Scope*, JSObject*, JSValue, int, JSValue* otherArgs = 0);42 void init(CodeBlock*, JSObject*, JSValue, int, JSValue* otherArgs = 0); 44 43 45 44 CodeBlock* codeBlock() const { return codeBlockValue.Register::codeBlock(); } 46 45 void setCodeBlock(CodeBlock* codeBlock) { codeBlockValue = codeBlock; } 47 48 JSScope* scope() const { return scopeChainValue.Register::scope(); }49 void setScope(JSScope* scope) { scopeChainValue = scope; }50 46 51 47 JSObject* callee() const { return calleeValue.Register::function(); } -
trunk/Source/JavaScriptCore/interpreter/VMInspector.cpp
r172665 r178856 74 74 printf("%s ", prefix); 75 75 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 }", 77 77 frameCount, frame, 78 78 CAST<void*>(frame[JSStack::CodeBlock].payload()), … … 80 80 CAST<void*>(frame[JSStack::ReturnPC].payload()), 81 81 getTypeName(frame[JSStack::ReturnPC].jsValue()), 82 CAST<void*>(frame[JSStack::ScopeChain].payload()),83 getTypeName(frame[JSStack::ScopeChain].jsValue()),84 82 CAST<void*>(frame[JSStack::Callee].payload()), 85 83 getTypeName(frame[JSStack::Callee].jsValue()), -
trunk/Source/JavaScriptCore/jit/JITCall.cpp
r173282 r178856 178 178 179 179 For a JS call: 180 - Caller initializes ScopeChain.181 180 - Callee initializes ReturnPC; CodeBlock. 182 181 - Callee restores callFrameRegister before return. 183 182 184 183 For a non-JS call: 185 - Caller initializes ScopeChain;ReturnPC; CodeBlock.184 - Caller initializes ReturnPC; CodeBlock. 186 185 - Caller restores callFrameRegister after return. 187 186 */ … … 237 236 m_callCompilationInfo[callLinkInfoIndex].callLinkInfo = info; 238 237 239 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_scope)), regT2);240 store64(regT2, Address(MacroAssembler::stackPointerRegister, JSStack::ScopeChain * sizeof(Register) - sizeof(CallerFrameAndPC)));241 242 238 m_callCompilationInfo[callLinkInfoIndex].hotPathOther = emitNakedCall(); 243 239 -
trunk/Source/JavaScriptCore/jit/JITCall32_64.cpp
r173282 r178856 265 265 266 266 For a JS call: 267 - Caller initializes ScopeChain.268 267 - Callee initializes ReturnPC; CodeBlock. 269 268 - Callee restores callFrameRegister before return. 270 269 271 270 For a non-JS call: 272 - Caller initializes ScopeChain;ReturnPC; CodeBlock.271 - Caller initializes ReturnPC; CodeBlock. 273 272 - Caller restores callFrameRegister after return. 274 273 */ … … 328 327 m_callCompilationInfo[callLinkInfoIndex].callLinkInfo = info; 329 328 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 334 329 checkStackPointerAlignment(); 335 330 m_callCompilationInfo[callLinkInfoIndex].hotPathOther = emitNakedCall(); -
trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r178143 r178856 58 58 59 59 #if CPU(X86) 60 // Load caller frame's scope chain into this callframe so that whatever we call can61 // get to its global data.62 emitGetCallerFrameFromCallFrameHeaderPtr(regT0);63 emitGetFromCallFrameHeaderPtr(JSStack::ScopeChain, regT1, regT0);64 emitPutCellToCallFrameHeader(regT1, JSStack::ScopeChain);65 66 60 // Calling convention: f(ecx, edx, ...); 67 61 // Host function signature: f(ExecState*); … … 77 71 78 72 #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 84 73 #if CPU(MIPS) 85 74 // Allocate stack space for (unused) 16 bytes (8-byte aligned) for 4 arguments. -
trunk/Source/JavaScriptCore/jit/Repatch.cpp
r178756 r178856 512 512 MacroAssembler::TrustedImmPtr(0)); 513 513 514 // loadedValueGPR is already burned. We can reuse it. From here on we assume that515 // 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)));521 514 fastPathCall = stubJit.nearCall(); 522 515 … … 1686 1679 CCallHelpers::TrustedImmPtr(executable))); 1687 1680 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 #else1697 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 #endif1704 1705 1681 AssemblyHelpers::Call call = stubJit.nearCall(); 1706 1682 AssemblyHelpers::Jump done = stubJit.jump(); -
trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp
r175243 r178856 215 215 // call. 216 216 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 #else223 jit.emitPutPayloadToCallFrameHeaderBeforePrologue(GPRInfo::regT1, JSStack::ScopeChain);224 jit.emitPutTagToCallFrameHeaderBeforePrologue(CCallHelpers::TrustedImm32(JSValue::CellTag),225 JSStack::ScopeChain);226 #endif227 228 217 // Make a tail call. This will return back to JIT code. 229 218 emitPointerValidation(jit, GPRInfo::regT4); … … 277 266 278 267 #if CPU(X86) 279 // Load callee's scope chain into this callframe so that whatever we call can280 // 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 285 268 // Calling convention: f(ecx, edx, ...); 286 269 // Host function signature: f(ExecState*); … … 297 280 298 281 #elif CPU(X86_64) 299 // Load callee's scope chain into this callframe so that whatever we call can300 // 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);304 282 #if !OS(WINDOWS) 305 283 // Calling convention: f(edi, esi, edx, ecx, ...); … … 334 312 COMPILE_ASSERT(ARM64Registers::x2 != JSInterfaceJIT::regT3, T3_not_trampled_by_arg_2); 335 313 336 // Load callee's scope chain into this callframe so that whatever we call can337 // 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 342 314 // Host function signature: f(ExecState*); 343 315 jit.move(JSInterfaceJIT::callFrameRegister, ARM64Registers::x0); … … 347 319 jit.call(JSInterfaceJIT::Address(ARM64Registers::x2, executableOffsetToFunction)); 348 320 #elif CPU(ARM) || CPU(SH4) || CPU(MIPS) 349 // Load callee's scope chain into this callframe so that whatever we call can350 // 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 355 321 #if CPU(MIPS) 356 322 // Allocate stack space for (unused) 16 bytes (8-byte aligned) for 4 arguments. -
trunk/Source/JavaScriptCore/llint/LLIntData.cpp
r177316 r178856 74 74 #if USE(JSVALUE64) 75 75 const ptrdiff_t PtrSize = 8; 76 const ptrdiff_t CallFrameHeaderSlots = 6;76 const ptrdiff_t CallFrameHeaderSlots = 5; 77 77 #else // USE(JSVALUE64) // i.e. 32-bit version 78 78 const ptrdiff_t PtrSize = 4; 79 const ptrdiff_t CallFrameHeaderSlots = 5;79 const ptrdiff_t CallFrameHeaderSlots = 4; 80 80 #endif 81 81 const ptrdiff_t SlotSize = 8; … … 90 90 ASSERT(CallFrame::returnPCOffset() == CallFrame::callerFrameOffset() + PtrSize); 91 91 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); 94 93 ASSERT(JSStack::ArgumentCount * sizeof(Register) == JSStack::Callee * sizeof(Register) + SlotSize); 95 94 ASSERT(JSStack::ThisArgument * sizeof(Register) == JSStack::ArgumentCount * sizeof(Register) + SlotSize); -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
r178073 r178856 35 35 if JSVALUE64 36 36 const PtrSize = 8 37 const CallFrameHeaderSlots = 637 const CallFrameHeaderSlots = 5 38 38 else 39 39 const PtrSize = 4 40 const CallFrameHeaderSlots = 540 const CallFrameHeaderSlots = 4 41 41 const CallFrameAlignSlots = 1 42 42 end … … 51 51 const ReturnPC = CallerFrame + PtrSize 52 52 const CodeBlock = ReturnPC + PtrSize 53 const ScopeChain = CodeBlock + SlotSize 54 const Callee = ScopeChain + SlotSize 53 const Callee = CodeBlock + SlotSize 55 54 const ArgumentCount = Callee + SlotSize 56 55 const ThisArgumentOffset = ArgumentCount + SlotSize -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
r178106 r178856 288 288 .stackHeightOK: 289 289 move temp1, sp 290 move 5, temp1290 move 4, temp1 291 291 292 292 .copyHeaderLoop: … … 1941 1941 negi t3 1942 1942 addp cfr, t3 # t3 contains the new value of cfr 1943 loadp JSFunction::m_scope[t2], t01944 1943 storei t2, Callee + PayloadOffset[t3] 1945 storei t0, ScopeChain + PayloadOffset[t3]1946 1944 loadi 12[PC], t2 1947 1945 storei PC, ArgumentCount + TagOffset[cfr] 1948 1946 storei t2, ArgumentCount + PayloadOffset[t3] 1949 1947 storei CellTag, Callee + TagOffset[t3] 1950 storei CellTag, ScopeChain + TagOffset[t3]1951 1948 addp CallerFrameAndPCSize, t3 1952 1949 callTargetFunction(t1, t3) … … 2030 2027 dispatch(2) 2031 2028 2032 2033 # Gives you the scope in t0, while allowing you to optionally perform additional checks on the2034 # scopes as they are traversed. scopeCheck() is called with two arguments: the register2035 # holding the scope, and a register that can be used for scratch. Note that this does not2036 # use t3, so you can hold stuff in t3 if need be.2037 macro getDeBruijnScope(deBruijinIndexOperand, scopeCheck)2038 loadp ScopeChain + PayloadOffset[cfr], t02039 loadi deBruijinIndexOperand, t22040 2041 btiz t2, .done2042 2043 loadp CodeBlock[cfr], t12044 bineq CodeBlock::m_codeType[t1], FunctionCode, .loop2045 btbz CodeBlock::m_needsActivation[t1], .loop2046 2047 loadi CodeBlock::m_lexicalEnvironmentRegister[t1], t12048 2049 # Need to conditionally skip over one scope.2050 bieq TagOffset[cfr, t1, 8], EmptyValueTag, .noActivation2051 scopeCheck(t0, t1)2052 loadp JSScope::m_next[t0], t02053 .noActivation:2054 subi 1, t22055 2056 btiz t2, .done2057 .loop:2058 scopeCheck(t0, t1)2059 loadp JSScope::m_next[t0], t02060 subi 1, t22061 btinz t2, .loop2062 2063 .done:2064 2065 end2066 2067 2029 _llint_op_end: 2068 2030 traceExecution() … … 2096 2058 storep 0, CodeBlock[cfr] 2097 2059 loadi Callee + PayloadOffset[cfr], t1 2098 loadi JSCallee::m_scope[t1], t02099 storei CellTag, ScopeChain + TagOffset[cfr]2100 storei t0, ScopeChain + PayloadOffset[cfr]2101 2060 // Callee is still in t1 for code below 2102 2061 if X86 or X86_WIN -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
r178106 r178856 227 227 .stackHeightOK: 228 228 move temp1, sp 229 move 5, temp1229 move 4, temp1 230 230 231 231 .copyHeaderLoop: … … 1800 1800 negp t3 1801 1801 addp cfr, t3 1802 loadp JSFunction::m_scope[t2], t01803 1802 storeq t2, Callee[t3] 1804 storeq t0, ScopeChain[t3]1805 1803 loadisFromInstruction(3, t2) 1806 1804 storei PC, ArgumentCount + TagOffset[cfr] … … 1931 1929 loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t1], t1 1932 1930 storep cfr, VM::topCallFrame[t1] 1933 // Callee still in t01934 loadp JSCallee::m_scope[t0], t11935 storeq t1, ScopeChain[cfr]1936 1931 move cfr, arg1 1937 1932 loadp Callee[cfr], arg2 … … 1953 1948 loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t1], t1 1954 1949 storep cfr, VM::topCallFrame[t1] 1955 // Callee still in t01956 loadp JSCallee::m_scope[t0], t11957 storep t1, ScopeChain[cfr]1958 1950 preserveReturnAddressAfterCall(t3) 1959 1951 storep t3, ReturnPC[cfr]
Note: See TracChangeset
for help on using the changeset viewer.