Changeset 203006 in webkit
- Timestamp:
- Jul 8, 2016, 3:58:15 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 59 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r203004 r203006 1 2016-07-08 Mark Lam <mark.lam@apple.com> 2 3 Move CallFrame header info from JSStack.h to CallFrame.h 4 https://bugs.webkit.org/show_bug.cgi?id=159549 5 6 Reviewed by Geoffrey Garen. 7 8 CallFrame.h is a much better location for CallFrame header info. 9 10 Replaced CallFrame::init() with ExecState::initGlobalExec() because normal 11 CallFrames are setup by a different mechanism now. Only the globalExec is still 12 using it. So, might as well change it to be specifically for the globalExec. 13 14 Removed the use of JSStack::containsAddress() in ExecState::initGlobalExec() 15 because it is not relevant to the globalExec. 16 17 Also removed some unused code: JSStack::gatherConservativeRoots() and 18 JSStack::sanitizeStack() is never called for JIT builds. 19 20 * bytecode/PolymorphicAccess.cpp: 21 (JSC::AccessCase::generateImpl): 22 * bytecode/VirtualRegister.h: 23 (JSC::VirtualRegister::isValid): 24 (JSC::VirtualRegister::isLocal): 25 (JSC::VirtualRegister::isArgument): 26 (JSC::VirtualRegister::isHeader): 27 (JSC::VirtualRegister::isConstant): 28 (JSC::VirtualRegister::toLocal): 29 (JSC::VirtualRegister::toArgument): 30 * bytecompiler/BytecodeGenerator.cpp: 31 (JSC::BytecodeGenerator::BytecodeGenerator): 32 (JSC::BytecodeGenerator::emitCall): 33 (JSC::BytecodeGenerator::emitConstruct): 34 * bytecompiler/BytecodeGenerator.h: 35 (JSC::CallArguments::thisRegister): 36 (JSC::CallArguments::argumentRegister): 37 (JSC::CallArguments::stackOffset): 38 (JSC::CallArguments::argumentCountIncludingThis): 39 (JSC::CallArguments::argumentsNode): 40 (JSC::BytecodeGenerator::registerFor): 41 * bytecompiler/NodesCodegen.cpp: 42 (JSC::emitHomeObjectForCallee): 43 (JSC::emitGetSuperFunctionForConstruct): 44 (JSC::CallArguments::CallArguments): 45 * dfg/DFGArgumentsEliminationPhase.cpp: 46 * dfg/DFGArgumentsUtilities.cpp: 47 (JSC::DFG::argumentsInvolveStackSlot): 48 (JSC::DFG::emitCodeToGetArgumentsArrayLength): 49 * dfg/DFGByteCodeParser.cpp: 50 (JSC::DFG::ByteCodeParser::get): 51 (JSC::DFG::ByteCodeParser::findArgumentPositionForLocal): 52 (JSC::DFG::ByteCodeParser::flush): 53 (JSC::DFG::ByteCodeParser::addCallWithoutSettingResult): 54 (JSC::DFG::ByteCodeParser::getArgumentCount): 55 (JSC::DFG::ByteCodeParser::inlineCall): 56 (JSC::DFG::ByteCodeParser::handleInlining): 57 (JSC::DFG::ByteCodeParser::handleGetById): 58 (JSC::DFG::ByteCodeParser::handlePutById): 59 (JSC::DFG::ByteCodeParser::parseBlock): 60 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): 61 * dfg/DFGClobberize.h: 62 (JSC::DFG::clobberize): 63 * dfg/DFGGraph.cpp: 64 (JSC::DFG::Graph::isLiveInBytecode): 65 * dfg/DFGGraph.h: 66 (JSC::DFG::Graph::forAllLocalsLiveInBytecode): 67 * dfg/DFGJITCompiler.cpp: 68 (JSC::DFG::JITCompiler::compileEntry): 69 (JSC::DFG::JITCompiler::compileSetupRegistersForEntry): 70 (JSC::DFG::JITCompiler::compileFunction): 71 * dfg/DFGJITCompiler.h: 72 (JSC::DFG::JITCompiler::emitStoreCallSiteIndex): 73 * dfg/DFGOSRAvailabilityAnalysisPhase.cpp: 74 (JSC::DFG::LocalOSRAvailabilityCalculator::executeNode): 75 * dfg/DFGOSREntry.cpp: 76 (JSC::DFG::prepareOSREntry): 77 * dfg/DFGOSRExitCompiler.cpp: 78 (JSC::DFG::OSRExitCompiler::emitRestoreArguments): 79 * dfg/DFGOSRExitCompilerCommon.cpp: 80 (JSC::DFG::reifyInlinedCallFrames): 81 * dfg/DFGOSRExitCompilerCommon.h: 82 (JSC::DFG::adjustFrameAndStackInOSRExitCompilerThunk): 83 * dfg/DFGPreciseLocalClobberize.h: 84 (JSC::DFG::PreciseLocalClobberizeAdaptor::readTop): 85 * dfg/DFGSpeculativeJIT.cpp: 86 (JSC::DFG::SpeculativeJIT::emitGetLength): 87 (JSC::DFG::SpeculativeJIT::emitGetCallee): 88 (JSC::DFG::SpeculativeJIT::emitGetArgumentStart): 89 (JSC::DFG::SpeculativeJIT::compileCreateDirectArguments): 90 * dfg/DFGSpeculativeJIT32_64.cpp: 91 (JSC::DFG::SpeculativeJIT::emitCall): 92 (JSC::DFG::SpeculativeJIT::compile): 93 * dfg/DFGSpeculativeJIT64.cpp: 94 (JSC::DFG::SpeculativeJIT::emitCall): 95 (JSC::DFG::SpeculativeJIT::compile): 96 * dfg/DFGStackLayoutPhase.cpp: 97 (JSC::DFG::StackLayoutPhase::run): 98 * dfg/DFGThunks.cpp: 99 (JSC::DFG::osrEntryThunkGenerator): 100 * ftl/FTLLink.cpp: 101 (JSC::FTL::link): 102 * ftl/FTLLowerDFGToB3.cpp: 103 (JSC::FTL::DFG::LowerDFGToB3::lower): 104 (JSC::FTL::DFG::LowerDFGToB3::compileGetMyArgumentByVal): 105 (JSC::FTL::DFG::LowerDFGToB3::compileGetCallee): 106 (JSC::FTL::DFG::LowerDFGToB3::compileGetArgumentCountIncludingThis): 107 (JSC::FTL::DFG::LowerDFGToB3::compileGetScope): 108 (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct): 109 (JSC::FTL::DFG::LowerDFGToB3::compileTailCall): 110 (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs): 111 (JSC::FTL::DFG::LowerDFGToB3::compileLogShadowChickenPrologue): 112 (JSC::FTL::DFG::LowerDFGToB3::getArgumentsLength): 113 (JSC::FTL::DFG::LowerDFGToB3::getCurrentCallee): 114 (JSC::FTL::DFG::LowerDFGToB3::getArgumentsStart): 115 (JSC::FTL::DFG::LowerDFGToB3::callPreflight): 116 * ftl/FTLOSRExitCompiler.cpp: 117 (JSC::FTL::compileStub): 118 * ftl/FTLSlowPathCall.h: 119 (JSC::FTL::callOperation): 120 * interpreter/CallFrame.cpp: 121 (JSC::ExecState::initGlobalExec): 122 (JSC::CallFrame::callSiteBitsAreBytecodeOffset): 123 (JSC::CallFrame::callSiteAsRawBits): 124 (JSC::CallFrame::unsafeCallSiteAsRawBits): 125 (JSC::CallFrame::callSiteIndex): 126 (JSC::CallFrame::setCurrentVPC): 127 (JSC::CallFrame::callSiteBitsAsBytecodeOffset): 128 * interpreter/CallFrame.h: 129 (JSC::CallSiteIndex::CallSiteIndex): 130 (JSC::ExecState::calleeAsValue): 131 (JSC::ExecState::callee): 132 (JSC::ExecState::unsafeCallee): 133 (JSC::ExecState::codeBlock): 134 (JSC::ExecState::unsafeCodeBlock): 135 (JSC::ExecState::scope): 136 (JSC::ExecState::setCallerFrame): 137 (JSC::ExecState::setScope): 138 (JSC::ExecState::argumentCount): 139 (JSC::ExecState::argumentCountIncludingThis): 140 (JSC::ExecState::argumentOffset): 141 (JSC::ExecState::argumentOffsetIncludingThis): 142 (JSC::ExecState::offsetFor): 143 (JSC::ExecState::noCaller): 144 (JSC::ExecState::setArgumentCountIncludingThis): 145 (JSC::ExecState::setCallee): 146 (JSC::ExecState::setCodeBlock): 147 (JSC::ExecState::setReturnPC): 148 (JSC::ExecState::argIndexForRegister): 149 (JSC::ExecState::callerFrameAndPC): 150 (JSC::ExecState::unsafeCallerFrameAndPC): 151 (JSC::ExecState::init): Deleted. 152 * interpreter/Interpreter.cpp: 153 (JSC::Interpreter::dumpRegisters): 154 * interpreter/Interpreter.h: 155 (JSC::calleeFrameForVarargs): 156 * interpreter/JSStack.h: 157 (JSC::JSStack::containsAddress): 158 (JSC::JSStack::gatherConservativeRoots): Deleted. 159 (JSC::JSStack::sanitizeStack): Deleted. 160 * jit/AssemblyHelpers.cpp: 161 (JSC::AssemblyHelpers::jitAssertArgumentCountSane): 162 (JSC::AssemblyHelpers::emitRandomThunk): 163 * jit/AssemblyHelpers.h: 164 (JSC::AssemblyHelpers::restoreReturnAddressBeforeReturn): 165 (JSC::AssemblyHelpers::emitGetFromCallFrameHeaderPtr): 166 (JSC::AssemblyHelpers::emitGetFromCallFrameHeader32): 167 (JSC::AssemblyHelpers::emitGetFromCallFrameHeader64): 168 (JSC::AssemblyHelpers::emitPutToCallFrameHeader): 169 (JSC::AssemblyHelpers::emitPutToCallFrameHeaderBeforePrologue): 170 (JSC::AssemblyHelpers::emitPutPayloadToCallFrameHeaderBeforePrologue): 171 (JSC::AssemblyHelpers::emitPutTagToCallFrameHeaderBeforePrologue): 172 (JSC::AssemblyHelpers::calleeFrameSlot): 173 * jit/CCallHelpers.cpp: 174 (JSC::CCallHelpers::logShadowChickenProloguePacket): 175 * jit/CCallHelpers.h: 176 (JSC::CCallHelpers::prepareForTailCallSlow): 177 * jit/CallFrameShuffler.cpp: 178 (JSC::CallFrameShuffler::CallFrameShuffler): 179 (JSC::CallFrameShuffler::dump): 180 (JSC::CallFrameShuffler::extendFrameIfNeeded): 181 (JSC::CallFrameShuffler::prepareForSlowPath): 182 (JSC::CallFrameShuffler::prepareForTailCall): 183 (JSC::CallFrameShuffler::prepareAny): 184 * jit/CallFrameShuffler.h: 185 (JSC::CallFrameShuffler::snapshot): 186 (JSC::CallFrameShuffler::setCalleeJSValueRegs): 187 (JSC::CallFrameShuffler::assumeCalleeIsCell): 188 (JSC::CallFrameShuffler::numLocals): 189 (JSC::CallFrameShuffler::getOld): 190 (JSC::CallFrameShuffler::setOld): 191 (JSC::CallFrameShuffler::firstOld): 192 (JSC::CallFrameShuffler::lastOld): 193 (JSC::CallFrameShuffler::isValidOld): 194 (JSC::CallFrameShuffler::argCount): 195 (JSC::CallFrameShuffler::getNew): 196 * jit/JIT.cpp: 197 (JSC::JIT::compileWithoutLinking): 198 * jit/JIT.h: 199 * jit/JITCall.cpp: 200 (JSC::JIT::compileSetupVarargsFrame): 201 (JSC::JIT::compileCallEvalSlowCase): 202 (JSC::JIT::compileOpCall): 203 * jit/JITCall32_64.cpp: 204 (JSC::JIT::compileSetupVarargsFrame): 205 (JSC::JIT::compileCallEvalSlowCase): 206 (JSC::JIT::compileOpCall): 207 * jit/JITInlines.h: 208 (JSC::JIT::getConstantOperand): 209 (JSC::JIT::emitPutIntToCallFrameHeader): 210 (JSC::JIT::updateTopCallFrame): 211 * jit/JITOpcodes.cpp: 212 (JSC::JIT::emit_op_get_scope): 213 (JSC::JIT::emit_op_argument_count): 214 (JSC::JIT::emit_op_get_rest_length): 215 * jit/JITOpcodes32_64.cpp: 216 (JSC::JIT::privateCompileCTINativeCall): 217 (JSC::JIT::emit_op_get_scope): 218 * jit/JSInterfaceJIT.h: 219 (JSC::JSInterfaceJIT::emitJumpIfNotType): 220 (JSC::JSInterfaceJIT::emitGetFromCallFrameHeaderPtr): 221 (JSC::JSInterfaceJIT::emitPutToCallFrameHeader): 222 (JSC::JSInterfaceJIT::emitPutCellToCallFrameHeader): 223 * jit/SetupVarargsFrame.cpp: 224 (JSC::emitSetVarargsFrame): 225 (JSC::emitSetupVarargsFrameFastCase): 226 * jit/SpecializedThunkJIT.h: 227 (JSC::SpecializedThunkJIT::SpecializedThunkJIT): 228 * jit/ThunkGenerators.cpp: 229 (JSC::nativeForGenerator): 230 (JSC::arityFixupGenerator): 231 (JSC::boundThisNoArgsFunctionCallGenerator): 232 * llint/LLIntData.cpp: 233 (JSC::LLInt::Data::performAssertions): 234 * llint/LLIntSlowPaths.cpp: 235 (JSC::LLInt::genericCall): 236 (JSC::LLInt::varargsSetup): 237 (JSC::LLInt::LLINT_SLOW_PATH_DECL): 238 * runtime/CommonSlowPaths.h: 239 (JSC::CommonSlowPaths::arityCheckFor): 240 * runtime/JSGlobalObject.cpp: 241 (JSC::JSGlobalObject::init): 242 * runtime/JSGlobalObject.h: 243 * runtime/StackAlignment.h: 244 (JSC::roundArgumentCountToAlignFrame): 245 (JSC::roundLocalRegisterCountForFramePointerOffset): 246 (JSC::logStackAlignmentRegisters): 247 * wasm/WASMFunctionCompiler.h: 248 (JSC::WASMFunctionCompiler::startFunction): 249 (JSC::WASMFunctionCompiler::endFunction): 250 (JSC::WASMFunctionCompiler::boxArgumentsAndAdjustStackPointer): 251 (JSC::WASMFunctionCompiler::callAndUnboxResult): 252 * wasm/WASMFunctionSyntaxChecker.h: 253 (JSC::WASMFunctionSyntaxChecker::updateTempStackHeightForCall): 254 1 255 2016-07-08 Chris Dumez <cdumez@apple.com> 2 256 -
trunk/Source/JavaScriptCore/bytecode/PolymorphicAccess.cpp
r202214 r203006 948 948 jit.store32( 949 949 CCallHelpers::TrustedImm32(state.callSiteIndexForExceptionHandlingOrOriginal().bits()), 950 CCallHelpers::tagFor(static_cast<VirtualRegister>( JSStack::ArgumentCount)));950 CCallHelpers::tagFor(static_cast<VirtualRegister>(CallFrameSlot::argumentCount))); 951 951 952 952 if (m_type == Getter || m_type == Setter) { … … 1003 1003 CCallHelpers::Zero, loadedValueGPR); 1004 1004 1005 unsigned numberOfRegsForCall = JSStack::CallFrameHeaderSize+ numberOfParameters;1005 unsigned numberOfRegsForCall = CallFrame::headerSizeInRegisters + numberOfParameters; 1006 1006 1007 1007 unsigned numberOfBytesForCall = … … 1021 1021 jit.store32( 1022 1022 CCallHelpers::TrustedImm32(numberOfParameters), 1023 calleeFrame.withOffset( JSStack::ArgumentCount * sizeof(Register) + PayloadOffset));1023 calleeFrame.withOffset(CallFrameSlot::argumentCount * sizeof(Register) + PayloadOffset)); 1024 1024 1025 1025 jit.storeCell( 1026 loadedValueGPR, calleeFrame.withOffset( JSStack::Callee * sizeof(Register)));1026 loadedValueGPR, calleeFrame.withOffset(CallFrameSlot::callee * sizeof(Register))); 1027 1027 1028 1028 jit.storeCell( … … 1261 1261 CCallHelpers::TrustedImm32( 1262 1262 state.callSiteIndexForExceptionHandlingOrOriginal().bits()), 1263 CCallHelpers::tagFor(static_cast<VirtualRegister>( JSStack::ArgumentCount)));1263 CCallHelpers::tagFor(static_cast<VirtualRegister>(CallFrameSlot::argumentCount))); 1264 1264 1265 1265 jit.makeSpaceOnStackForCCall(); -
trunk/Source/JavaScriptCore/bytecode/VirtualRegister.h
r183207 r203006 1 1 /* 2 * Copyright (C) 2011, 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2011, 2015-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 60 60 bool isLocal() const { return operandIsLocal(m_virtualRegister); } 61 61 bool isArgument() const { return operandIsArgument(m_virtualRegister); } 62 bool isHeader() const { return m_virtualRegister >= 0 && m_virtualRegister < JSStack::ThisArgument; }62 bool isHeader() const { return m_virtualRegister >= 0 && m_virtualRegister < CallFrameSlot::thisArgument; } 63 63 bool isConstant() const { return m_virtualRegister >= s_firstConstantRegisterIndex; } 64 64 int toLocal() const { ASSERT(isLocal()); return operandToLocal(m_virtualRegister); } -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r202846 r203006 307 307 allocateAndEmitScope(); 308 308 309 m_calleeRegister.setIndex( JSStack::Callee);309 m_calleeRegister.setIndex(CallFrameSlot::callee); 310 310 311 311 initializeParameters(parameters); … … 743 743 allocateAndEmitScope(); 744 744 745 m_calleeRegister.setIndex( JSStack::Callee);745 m_calleeRegister.setIndex(CallFrameSlot::callee); 746 746 747 747 m_codeBlock->setNumParameters(1); // Allocate space for "this" … … 3131 3131 3132 3132 // Reserve space for call frame. 3133 Vector<RefPtr<RegisterID>, JSStack::CallFrameHeaderSize, UnsafeVectorOverflow> callFrame;3134 for (int i = 0; i < JSStack::CallFrameHeaderSize; ++i)3133 Vector<RefPtr<RegisterID>, CallFrame::headerSizeInRegisters, UnsafeVectorOverflow> callFrame; 3134 for (int i = 0; i < CallFrame::headerSizeInRegisters; ++i) 3135 3135 callFrame.append(newTemporary()); 3136 3136 … … 3316 3316 3317 3317 // Reserve space for call frame. 3318 Vector<RefPtr<RegisterID>, JSStack::CallFrameHeaderSize, UnsafeVectorOverflow> callFrame;3319 for (int i = 0; i < JSStack::CallFrameHeaderSize; ++i)3318 Vector<RefPtr<RegisterID>, CallFrame::headerSizeInRegisters, UnsafeVectorOverflow> callFrame; 3319 for (int i = 0; i < CallFrame::headerSizeInRegisters; ++i) 3320 3320 callFrame.append(newTemporary()); 3321 3321 -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
r202778 r203006 74 74 RegisterID* thisRegister() { return m_argv[0].get(); } 75 75 RegisterID* argumentRegister(unsigned i) { return m_argv[i + 1].get(); } 76 unsigned stackOffset() { return -m_argv[0]->index() + JSStack::CallFrameHeaderSize; }76 unsigned stackOffset() { return -m_argv[0]->index() + CallFrame::headerSizeInRegisters; } 77 77 unsigned argumentCountIncludingThis() { return m_argv.size() - m_padding; } 78 78 ArgumentsNode* argumentsNode() { return m_argumentsNode; } … … 810 810 return m_calleeLocals[reg.toLocal()]; 811 811 812 if (reg.offset() == JSStack::Callee)812 if (reg.offset() == CallFrameSlot::callee) 813 813 return m_calleeRegister; 814 814 -
trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
r202680 r203006 166 166 167 167 RegisterID callee; 168 callee.setIndex( JSStack::Callee);168 callee.setIndex(CallFrameSlot::callee); 169 169 return generator.emitGetById(generator.newTemporary(), &callee, generator.propertyNames().builtinNames().homeObjectPrivateName()); 170 170 } … … 182 182 183 183 RegisterID callee; 184 callee.setIndex( JSStack::Callee);184 callee.setIndex(CallFrameSlot::callee); 185 185 return generator.emitGetById(generator.newTemporary(), &callee, generator.propertyNames().underscoreProto); 186 186 } … … 725 725 726 726 // We need to ensure that the frame size is stack-aligned 727 while (( JSStack::CallFrameHeaderSize+ m_argv.size()) % stackAlignmentRegisters()) {727 while ((CallFrame::headerSizeInRegisters + m_argv.size()) % stackAlignmentRegisters()) { 728 728 m_argv.insert(0, generator.newTemporary()); 729 729 m_padding++; -
trunk/Source/JavaScriptCore/dfg/DFGArgumentsEliminationPhase.cpp
r202003 r203006 304 304 if (inlineCallFrame->isVarargs()) { 305 305 isClobberedByBlock |= clobberedByThisBlock.operand( 306 inlineCallFrame->stackOffset + JSStack::ArgumentCount);306 inlineCallFrame->stackOffset + CallFrameSlot::argumentCount); 307 307 } 308 308 309 309 if (!isClobberedByBlock || inlineCallFrame->isClosureCall) { 310 310 isClobberedByBlock |= clobberedByThisBlock.operand( 311 inlineCallFrame->stackOffset + JSStack::Callee);311 inlineCallFrame->stackOffset + CallFrameSlot::callee); 312 312 } 313 313 -
trunk/Source/JavaScriptCore/dfg/DFGArgumentsUtilities.cpp
r201668 r203006 39 39 40 40 if (inlineCallFrame->isClosureCall 41 && reg == VirtualRegister(inlineCallFrame->stackOffset + JSStack::Callee))41 && reg == VirtualRegister(inlineCallFrame->stackOffset + CallFrameSlot::callee)) 42 42 return true; 43 43 44 44 if (inlineCallFrame->isVarargs() 45 && reg == VirtualRegister(inlineCallFrame->stackOffset + JSStack::ArgumentCount))45 && reg == VirtualRegister(inlineCallFrame->stackOffset + CallFrameSlot::argumentCount)) 46 46 return true; 47 47 … … 79 79 argumentCount = insertionSet.insertNode(nodeIndex, SpecInt32Only, GetArgumentCountIncludingThis, origin); 80 80 else { 81 VirtualRegister argumentCountRegister(inlineCallFrame->stackOffset + JSStack::ArgumentCount);81 VirtualRegister argumentCountRegister(inlineCallFrame->stackOffset + CallFrameSlot::argumentCount); 82 82 83 83 argumentCount = insertionSet.insertNode( -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r202680 r203006 332 332 if (!inlineCallFrame()->isClosureCall) { 333 333 JSFunction* callee = inlineCallFrame()->calleeConstant(); 334 if (operand.offset() == JSStack::Callee)334 if (operand.offset() == CallFrameSlot::callee) 335 335 return weakJSConstant(callee); 336 336 } 337 } else if (operand.offset() == JSStack::Callee) {337 } else if (operand.offset() == CallFrameSlot::callee) { 338 338 // We have to do some constant-folding here because this enables CreateThis folding. Note 339 339 // that we don't have such watchpoint-based folding for inlined uses of Callee, since in that … … 543 543 if (!inlineCallFrame) 544 544 break; 545 if (operand.offset() < static_cast<int>(inlineCallFrame->stackOffset + JSStack::CallFrameHeaderSize))545 if (operand.offset() < static_cast<int>(inlineCallFrame->stackOffset + CallFrame::headerSizeInRegisters)) 546 546 continue; 547 547 if (operand.offset() == inlineCallFrame->stackOffset + CallFrame::thisArgumentOffset()) … … 598 598 numArguments = inlineCallFrame->arguments.size(); 599 599 if (inlineCallFrame->isClosureCall) 600 flushDirect(inlineStackEntry->remapOperand(VirtualRegister( JSStack::Callee)));600 flushDirect(inlineStackEntry->remapOperand(VirtualRegister(CallFrameSlot::callee))); 601 601 if (inlineCallFrame->isVarargs()) 602 flushDirect(inlineStackEntry->remapOperand(VirtualRegister( JSStack::ArgumentCount)));602 flushDirect(inlineStackEntry->remapOperand(VirtualRegister(CallFrameSlot::argumentCount))); 603 603 } else 604 604 numArguments = inlineStackEntry->m_codeBlock->numParameters(); … … 767 767 { 768 768 addVarArgChild(callee); 769 size_t frameSize = JSStack::CallFrameHeaderSize+ argCount;769 size_t frameSize = CallFrame::headerSizeInRegisters + argCount; 770 770 size_t alignedFrameSize = WTF::roundUpToMultipleOf(stackAlignmentRegisters(), frameSize); 771 size_t parameterSlots = alignedFrameSize - JSStack::CallerFrameAndPCSize;771 size_t parameterSlots = alignedFrameSize - CallerFrameAndPC::sizeInRegisters; 772 772 773 773 if (parameterSlots > m_parameterSlots) … … 1338 1338 if (m_inlineStackTop->m_inlineCallFrame) { 1339 1339 if (m_inlineStackTop->m_inlineCallFrame->isVarargs()) 1340 argumentCount = get(VirtualRegister( JSStack::ArgumentCount));1340 argumentCount = get(VirtualRegister(CallFrameSlot::argumentCount)); 1341 1341 else 1342 1342 argumentCount = jsConstant(m_graph.freeze(jsNumber(m_inlineStackTop->m_inlineCallFrame->arguments.size()))->value()); … … 1473 1473 // FIXME: Don't flush constants! 1474 1474 1475 int inlineCallFrameStart = m_inlineStackTop->remapOperand(VirtualRegister(registerOffset)).offset() + JSStack::CallFrameHeaderSize;1475 int inlineCallFrameStart = m_inlineStackTop->remapOperand(VirtualRegister(registerOffset)).offset() + CallFrame::headerSizeInRegisters; 1476 1476 1477 1477 ensureLocals( 1478 1478 VirtualRegister(inlineCallFrameStart).toLocal() + 1 + 1479 JSStack::CallFrameHeaderSize+ codeBlock->m_numCalleeLocals);1479 CallFrame::headerSizeInRegisters + codeBlock->m_numCalleeLocals); 1480 1480 1481 1481 size_t argumentPositionStart = m_graph.m_argumentPositions.size(); … … 1488 1488 if (callee.isClosureCall()) { 1489 1489 Node* calleeSet = set( 1490 VirtualRegister(registerOffset + JSStack::Callee), callTargetNode, ImmediateNakedSet);1490 VirtualRegister(registerOffset + CallFrameSlot::callee), callTargetNode, ImmediateNakedSet); 1491 1491 1492 1492 calleeVariable = calleeSet->variableAccessData(); … … 1747 1747 registerOffset = registerOffsetOrFirstFreeReg + 1; 1748 1748 registerOffset -= maxNumArguments; // includes "this" 1749 registerOffset -= JSStack::CallFrameHeaderSize;1749 registerOffset -= CallFrame::headerSizeInRegisters; 1750 1750 registerOffset = -WTF::roundUpToMultipleOf( 1751 1751 stackAlignmentRegisters(), … … 1767 1767 ensureLocals(VirtualRegister(remappedRegisterOffset).toLocal()); 1768 1768 1769 int argumentStart = registerOffset + JSStack::CallFrameHeaderSize;1769 int argumentStart = registerOffset + CallFrame::headerSizeInRegisters; 1770 1770 int remappedArgumentStart = 1771 1771 m_inlineStackTop->remapOperand(VirtualRegister(argumentStart)).offset(); … … 1773 1773 LoadVarargsData* data = m_graph.m_loadVarargsData.add(); 1774 1774 data->start = VirtualRegister(remappedArgumentStart + 1); 1775 data->count = VirtualRegister(remappedRegisterOffset + JSStack::ArgumentCount);1775 data->count = VirtualRegister(remappedRegisterOffset + CallFrameSlot::argumentCount); 1776 1776 data->offset = argumentsOffset; 1777 1777 data->limit = maxNumArguments; … … 1794 1794 1795 1795 VariableAccessData* countVariable = newVariableAccessData( 1796 VirtualRegister(remappedRegisterOffset + JSStack::ArgumentCount));1796 VirtualRegister(remappedRegisterOffset + CallFrameSlot::argumentCount)); 1797 1797 // This is pretty lame, but it will force the count to be flushed as an int. This doesn't 1798 1798 // matter very much, since our use of a SetArgument and Flushes for this local slot is … … 1905 1905 if (verbose) 1906 1906 dataLog("Register offset: ", registerOffset); 1907 VirtualRegister calleeReg(registerOffset + JSStack::Callee);1907 VirtualRegister calleeReg(registerOffset + CallFrameSlot::callee); 1908 1908 calleeReg = m_inlineStackTop->remapOperand(calleeReg); 1909 1909 if (verbose) … … 3272 3272 m_inlineStackTop->m_profiledBlock->m_numCalleeLocals - 1).offset(); 3273 3273 registerOffset -= numberOfParameters; 3274 registerOffset -= JSStack::CallFrameHeaderSize;3274 registerOffset -= CallFrame::headerSizeInRegisters; 3275 3275 3276 3276 // Get the alignment right. … … 3289 3289 // since we only really care about 'this' in this case. But we're not going to take that 3290 3290 // shortcut. 3291 int nextRegister = registerOffset + JSStack::CallFrameHeaderSize;3291 int nextRegister = registerOffset + CallFrame::headerSizeInRegisters; 3292 3292 set(VirtualRegister(nextRegister++), base, ImmediateNakedSet); 3293 3293 … … 3441 3441 m_inlineStackTop->m_profiledBlock->m_numCalleeLocals - 1).offset(); 3442 3442 registerOffset -= numberOfParameters; 3443 registerOffset -= JSStack::CallFrameHeaderSize;3443 registerOffset -= CallFrame::headerSizeInRegisters; 3444 3444 3445 3445 // Get the alignment right. … … 3452 3452 VirtualRegister(registerOffset)).toLocal()); 3453 3453 3454 int nextRegister = registerOffset + JSStack::CallFrameHeaderSize;3454 int nextRegister = registerOffset + CallFrame::headerSizeInRegisters; 3455 3455 set(VirtualRegister(nextRegister++), base, ImmediateNakedSet); 3456 3456 set(VirtualRegister(nextRegister++), value, ImmediateNakedSet); … … 4973 4973 // loads from the scope register later, as that would prevent the DFG from tracking the 4974 4974 // bytecode-level liveness of the scope register. 4975 Node* callee = get(VirtualRegister( JSStack::Callee));4975 Node* callee = get(VirtualRegister(CallFrameSlot::callee)); 4976 4976 Node* result; 4977 4977 if (JSFunction* function = callee->dynamicCastConstant<JSFunction*>()) … … 5284 5284 // plan finishes. 5285 5285 m_inlineCallFrame->baselineCodeBlock.setWithoutWriteBarrier(codeBlock->baselineVersion()); 5286 m_inlineCallFrame->setStackOffset(inlineCallFrameStart.offset() - JSStack::CallFrameHeaderSize);5286 m_inlineCallFrame->setStackOffset(inlineCallFrameStart.offset() - CallFrame::headerSizeInRegisters); 5287 5287 if (callee) { 5288 5288 m_inlineCallFrame->calleeRecovery = ValueRecovery::constant(callee); -
trunk/Source/JavaScriptCore/dfg/DFGClobberize.h
r202680 r203006 114 114 for (InlineCallFrame* inlineCallFrame = node->origin.semantic.inlineCallFrame; inlineCallFrame; inlineCallFrame = inlineCallFrame->directCaller.inlineCallFrame) { 115 115 if (inlineCallFrame->isClosureCall) 116 read(AbstractHeap(Stack, inlineCallFrame->stackOffset + JSStack::Callee));116 read(AbstractHeap(Stack, inlineCallFrame->stackOffset + CallFrameSlot::callee)); 117 117 if (inlineCallFrame->isVarargs()) 118 read(AbstractHeap(Stack, inlineCallFrame->stackOffset + JSStack::ArgumentCount));118 read(AbstractHeap(Stack, inlineCallFrame->stackOffset + CallFrameSlot::argumentCount)); 119 119 } 120 120 … … 502 502 503 503 case GetCallee: 504 read(AbstractHeap(Stack, JSStack::Callee));505 def(HeapLocation(StackLoc, AbstractHeap(Stack, JSStack::Callee)), LazyNode(node));504 read(AbstractHeap(Stack, CallFrameSlot::callee)); 505 def(HeapLocation(StackLoc, AbstractHeap(Stack, CallFrameSlot::callee)), LazyNode(node)); 506 506 return; 507 507 508 508 case GetArgumentCountIncludingThis: 509 read(AbstractHeap(Stack, JSStack::ArgumentCount));510 def(HeapLocation(StackPayloadLoc, AbstractHeap(Stack, JSStack::ArgumentCount)), LazyNode(node));509 read(AbstractHeap(Stack, CallFrameSlot::argumentCount)); 510 def(HeapLocation(StackPayloadLoc, AbstractHeap(Stack, CallFrameSlot::argumentCount)), LazyNode(node)); 511 511 return; 512 512 -
trunk/Source/JavaScriptCore/dfg/DFGGraph.cpp
r202512 r203006 1013 1013 dataLog("reg = ", reg, "\n"); 1014 1014 1015 if (operand.offset() < codeOriginPtr->stackOffset() + JSStack::CallFrameHeaderSize) {1015 if (operand.offset() < codeOriginPtr->stackOffset() + CallFrame::headerSizeInRegisters) { 1016 1016 if (reg.isArgument()) { 1017 RELEASE_ASSERT(reg.offset() < JSStack::CallFrameHeaderSize);1017 RELEASE_ASSERT(reg.offset() < CallFrame::headerSizeInRegisters); 1018 1018 1019 1019 if (codeOriginPtr->inlineCallFrame->isClosureCall 1020 && reg.offset() == JSStack::Callee) {1020 && reg.offset() == CallFrameSlot::callee) { 1021 1021 if (verbose) 1022 1022 dataLog("Looks like a callee.\n"); … … 1025 1025 1026 1026 if (codeOriginPtr->inlineCallFrame->isVarargs() 1027 && reg.offset() == JSStack::ArgumentCount) {1027 && reg.offset() == CallFrameSlot::argumentCount) { 1028 1028 if (verbose) 1029 1029 dataLog("Looks like the argument count.\n"); -
trunk/Source/JavaScriptCore/dfg/DFGGraph.h
r201584 r203006 710 710 if (inlineCallFrame) { 711 711 if (inlineCallFrame->isClosureCall) 712 functor(stackOffset + JSStack::Callee);712 functor(stackOffset + CallFrameSlot::callee); 713 713 if (inlineCallFrame->isVarargs()) 714 functor(stackOffset + JSStack::ArgumentCount);714 functor(stackOffset + CallFrameSlot::argumentCount); 715 715 } 716 716 -
trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
r202992 r203006 109 109 // both normal return code and when jumping to an exception handler). 110 110 emitFunctionPrologue(); 111 emitPutToCallFrameHeader(m_codeBlock, JSStack::CodeBlock);111 emitPutToCallFrameHeader(m_codeBlock, CallFrameSlot::codeBlock); 112 112 } 113 113 … … 444 444 compileEntry(); 445 445 446 load32(AssemblyHelpers::payloadFor((VirtualRegister) JSStack::ArgumentCount), GPRInfo::regT1);446 load32(AssemblyHelpers::payloadFor((VirtualRegister)CallFrameSlot::argumentCount), GPRInfo::regT1); 447 447 branch32(AboveOrEqual, GPRInfo::regT1, TrustedImm32(m_codeBlock->numParameters())).linkTo(fromArityCheck, this); 448 448 emitStoreCodeOrigin(CodeOrigin(0)); -
trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.h
r200981 r203006 157 157 void emitStoreCallSiteIndex(CallSiteIndex callSite) 158 158 { 159 store32(TrustedImm32(callSite.bits()), tagFor(static_cast<VirtualRegister>( JSStack::ArgumentCount)));159 store32(TrustedImm32(callSite.bits()), tagFor(static_cast<VirtualRegister>(CallFrameSlot::argumentCount))); 160 160 } 161 161 -
trunk/Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.cpp
r198364 r203006 178 178 // Record how to read each argument and the argument count. 179 179 Availability argumentCount = 180 m_availability.m_locals.operand(inlineCallFrame->stackOffset + JSStack::ArgumentCount);180 m_availability.m_locals.operand(inlineCallFrame->stackOffset + CallFrameSlot::argumentCount); 181 181 182 182 m_availability.m_heap.set(PromotedHeapLocation(ArgumentCountPLoc, node), argumentCount); … … 185 185 if (inlineCallFrame->isClosureCall) { 186 186 Availability callee = m_availability.m_locals.operand( 187 inlineCallFrame->stackOffset + JSStack::Callee);187 inlineCallFrame->stackOffset + CallFrameSlot::callee); 188 188 m_availability.m_heap.set(PromotedHeapLocation(ArgumentsCalleePLoc, node), callee); 189 189 } -
trunk/Source/JavaScriptCore/dfg/DFGOSREntry.cpp
r200879 r203006 265 265 unsigned maxFrameSize = std::max(frameSize, baselineFrameSize); 266 266 267 Register* scratch = bitwise_cast<Register*>(vm->scratchBufferForSize(sizeof(Register) * (2 + JSStack::CallFrameHeaderSize+ maxFrameSize))->dataBuffer());267 Register* scratch = bitwise_cast<Register*>(vm->scratchBufferForSize(sizeof(Register) * (2 + CallFrame::headerSizeInRegisters + maxFrameSize))->dataBuffer()); 268 268 269 269 *bitwise_cast<size_t*>(scratch + 0) = frameSize; … … 275 275 *bitwise_cast<void**>(scratch + 1) = targetPC; 276 276 277 Register* pivot = scratch + 2 + JSStack::CallFrameHeaderSize;278 279 for (int index = - JSStack::CallFrameHeaderSize; index < static_cast<int>(baselineFrameSize); ++index) {277 Register* pivot = scratch + 2 + CallFrame::headerSizeInRegisters; 278 279 for (int index = -CallFrame::headerSizeInRegisters; index < static_cast<int>(baselineFrameSize); ++index) { 280 280 VirtualRegister reg(-1 - index); 281 281 … … 330 330 // 7) Fix the call frame to have the right code block. 331 331 332 *bitwise_cast<CodeBlock**>(pivot - 1 - JSStack::CodeBlock) = codeBlock;332 *bitwise_cast<CodeBlock**>(pivot - 1 - CallFrameSlot::codeBlock) = codeBlock; 333 333 334 334 if (Options::verboseOSR()) -
trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp
r200879 r203006 71 71 if (!inlineCallFrame || inlineCallFrame->isClosureCall) { 72 72 m_jit.loadPtr( 73 AssemblyHelpers::addressFor(stackOffset + JSStack::Callee),73 AssemblyHelpers::addressFor(stackOffset + CallFrameSlot::callee), 74 74 GPRInfo::regT0); 75 75 } else { … … 81 81 if (!inlineCallFrame || inlineCallFrame->isVarargs()) { 82 82 m_jit.load32( 83 AssemblyHelpers::payloadFor(stackOffset + JSStack::ArgumentCount),83 AssemblyHelpers::payloadFor(stackOffset + CallFrameSlot::argumentCount), 84 84 GPRInfo::regT1); 85 85 } else { -
trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp
r202214 r203006 145 145 // https://bugs.webkit.org/show_bug.cgi?id=147511 146 146 ASSERT(jit.baselineCodeBlock()->jitType() == JITCode::BaselineJIT); 147 jit.storePtr(AssemblyHelpers::TrustedImmPtr(jit.baselineCodeBlock()), AssemblyHelpers::addressFor((VirtualRegister) JSStack::CodeBlock));147 jit.storePtr(AssemblyHelpers::TrustedImmPtr(jit.baselineCodeBlock()), AssemblyHelpers::addressFor((VirtualRegister)CallFrameSlot::codeBlock)); 148 148 149 149 const CodeOrigin* codeOrigin; … … 206 206 } 207 207 208 jit.storePtr(AssemblyHelpers::TrustedImmPtr(baselineCodeBlock), AssemblyHelpers::addressFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::CodeBlock)));208 jit.storePtr(AssemblyHelpers::TrustedImmPtr(baselineCodeBlock), AssemblyHelpers::addressFor((VirtualRegister)(inlineCallFrame->stackOffset + CallFrameSlot::codeBlock))); 209 209 210 210 // Restore the inline call frame's callee save registers. … … 218 218 219 219 if (!inlineCallFrame->isVarargs()) 220 jit.store32(AssemblyHelpers::TrustedImm32(inlineCallFrame->arguments.size()), AssemblyHelpers::payloadFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::ArgumentCount)));220 jit.store32(AssemblyHelpers::TrustedImm32(inlineCallFrame->arguments.size()), AssemblyHelpers::payloadFor((VirtualRegister)(inlineCallFrame->stackOffset + CallFrameSlot::argumentCount))); 221 221 #if USE(JSVALUE64) 222 222 jit.store64(callerFrameGPR, AssemblyHelpers::addressForByteOffset(inlineCallFrame->callerFrameOffset())); 223 223 uint32_t locationBits = CallSiteIndex(codeOrigin->bytecodeIndex).bits(); 224 jit.store32(AssemblyHelpers::TrustedImm32(locationBits), AssemblyHelpers::tagFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::ArgumentCount)));224 jit.store32(AssemblyHelpers::TrustedImm32(locationBits), AssemblyHelpers::tagFor((VirtualRegister)(inlineCallFrame->stackOffset + CallFrameSlot::argumentCount))); 225 225 if (!inlineCallFrame->isClosureCall) 226 jit.store64(AssemblyHelpers::TrustedImm64(JSValue::encode(JSValue(inlineCallFrame->calleeConstant()))), AssemblyHelpers::addressFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::Callee)));226 jit.store64(AssemblyHelpers::TrustedImm64(JSValue::encode(JSValue(inlineCallFrame->calleeConstant()))), AssemblyHelpers::addressFor((VirtualRegister)(inlineCallFrame->stackOffset + CallFrameSlot::callee))); 227 227 #else // USE(JSVALUE64) // so this is the 32-bit part 228 228 jit.storePtr(callerFrameGPR, AssemblyHelpers::addressForByteOffset(inlineCallFrame->callerFrameOffset())); 229 229 Instruction* instruction = baselineCodeBlock->instructions().begin() + codeOrigin->bytecodeIndex; 230 230 uint32_t locationBits = CallSiteIndex(instruction).bits(); 231 jit.store32(AssemblyHelpers::TrustedImm32(locationBits), AssemblyHelpers::tagFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::ArgumentCount)));232 jit.store32(AssemblyHelpers::TrustedImm32(JSValue::CellTag), AssemblyHelpers::tagFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::Callee)));231 jit.store32(AssemblyHelpers::TrustedImm32(locationBits), AssemblyHelpers::tagFor((VirtualRegister)(inlineCallFrame->stackOffset + CallFrameSlot::argumentCount))); 232 jit.store32(AssemblyHelpers::TrustedImm32(JSValue::CellTag), AssemblyHelpers::tagFor((VirtualRegister)(inlineCallFrame->stackOffset + CallFrameSlot::callee))); 233 233 if (!inlineCallFrame->isClosureCall) 234 jit.storePtr(AssemblyHelpers::TrustedImmPtr(inlineCallFrame->calleeConstant()), AssemblyHelpers::payloadFor((VirtualRegister)(inlineCallFrame->stackOffset + JSStack::Callee)));234 jit.storePtr(AssemblyHelpers::TrustedImmPtr(inlineCallFrame->calleeConstant()), AssemblyHelpers::payloadFor((VirtualRegister)(inlineCallFrame->stackOffset + CallFrameSlot::callee))); 235 235 #endif // USE(JSVALUE64) // ending the #else part, so directly above is the 32-bit part 236 236 } … … 244 244 uint32_t locationBits = CallSiteIndex(instruction).bits(); 245 245 #endif 246 jit.store32(AssemblyHelpers::TrustedImm32(locationBits), AssemblyHelpers::tagFor((VirtualRegister)( JSStack::ArgumentCount)));246 jit.store32(AssemblyHelpers::TrustedImm32(locationBits), AssemblyHelpers::tagFor((VirtualRegister)(CallFrameSlot::argumentCount))); 247 247 } 248 248 } -
trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.h
r195831 r203006 87 87 didNotHaveException.link(&jit); 88 88 // We need to make sure SP is correct in case of an exception. 89 jit.loadPtr(MacroAssembler::Address(GPRInfo::callFrameRegister, JSStack::CodeBlock * static_cast<int>(sizeof(Register))), GPRInfo::regT0);89 jit.loadPtr(MacroAssembler::Address(GPRInfo::callFrameRegister, CallFrameSlot::codeBlock * static_cast<int>(sizeof(Register))), GPRInfo::regT0); 90 90 jit.loadPtr(MacroAssembler::Address(GPRInfo::regT0, CodeBlock::jitCodeOffset()), GPRInfo::regT0); 91 91 jit.addPtr(MacroAssembler::TrustedImm32(JITCodeType::commonDataOffset()), GPRInfo::regT0); -
trunk/Source/JavaScriptCore/dfg/DFGPreciseLocalClobberize.h
r202003 r203006 126 126 for (unsigned i = m_graph.m_codeBlock->numParameters(); i-- > 1;) 127 127 m_read(virtualRegisterForArgument(i)); 128 m_read(VirtualRegister( JSStack::ArgumentCount));128 m_read(VirtualRegister(CallFrameSlot::argumentCount)); 129 129 break; 130 130 } … … 133 133 m_read(VirtualRegister(inlineCallFrame->stackOffset + virtualRegisterForArgument(i).offset())); 134 134 if (inlineCallFrame->isVarargs()) 135 m_read(VirtualRegister(inlineCallFrame->stackOffset + JSStack::ArgumentCount));135 m_read(VirtualRegister(inlineCallFrame->stackOffset + CallFrameSlot::argumentCount)); 136 136 break; 137 137 } … … 143 143 144 144 // The stack header is read. 145 for (unsigned i = 0; i < JSStack::ThisArgument; ++i)145 for (unsigned i = 0; i < CallFrameSlot::thisArgument; ++i) 146 146 m_read(VirtualRegister(i)); 147 147 … … 151 151 m_read(VirtualRegister(inlineCallFrame->stackOffset + virtualRegisterForArgument(i).offset())); 152 152 if (inlineCallFrame->isClosureCall) 153 m_read(VirtualRegister(inlineCallFrame->stackOffset + JSStack::Callee));153 m_read(VirtualRegister(inlineCallFrame->stackOffset + CallFrameSlot::callee)); 154 154 if (inlineCallFrame->isVarargs()) 155 m_read(VirtualRegister(inlineCallFrame->stackOffset + JSStack::ArgumentCount));155 m_read(VirtualRegister(inlineCallFrame->stackOffset + CallFrameSlot::argumentCount)); 156 156 } 157 157 break; -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r202982 r203006 153 153 VirtualRegister argumentCountRegister; 154 154 if (!inlineCallFrame) 155 argumentCountRegister = VirtualRegister( JSStack::ArgumentCount);155 argumentCountRegister = VirtualRegister(CallFrameSlot::argumentCount); 156 156 else 157 157 argumentCountRegister = inlineCallFrame->argumentCountRegister; … … 180 180 } 181 181 } else 182 m_jit.loadPtr(JITCompiler::addressFor( JSStack::Callee), calleeGPR);182 m_jit.loadPtr(JITCompiler::addressFor(CallFrameSlot::callee), calleeGPR); 183 183 } 184 184 … … 6218 6218 VirtualRegister argumentCountRegister; 6219 6219 if (!node->origin.semantic.inlineCallFrame) 6220 argumentCountRegister = VirtualRegister( JSStack::ArgumentCount);6220 argumentCountRegister = VirtualRegister(CallFrameSlot::argumentCount); 6221 6221 else 6222 6222 argumentCountRegister = node->origin.semantic.inlineCallFrame->argumentCountRegister; … … 6293 6293 } 6294 6294 } else 6295 m_jit.loadPtr(JITCompiler::addressFor( JSStack::Callee), scratch1GPR);6295 m_jit.loadPtr(JITCompiler::addressFor(CallFrameSlot::callee), scratch1GPR); 6296 6296 6297 6297 // Don't need a memory barriers since we just fast-created the activation, so the -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
r202680 r203006 836 836 } 837 837 } else { 838 m_jit.store32(MacroAssembler::TrustedImm32(numPassedArgs), m_jit.calleeFramePayloadSlot( JSStack::ArgumentCount));838 m_jit.store32(MacroAssembler::TrustedImm32(numPassedArgs), m_jit.calleeFramePayloadSlot(CallFrameSlot::argumentCount)); 839 839 840 840 for (int i = 0; i < numPassedArgs; i++) { … … 856 856 calleePayloadGPR = callee.payloadGPR(); 857 857 use(calleeEdge); 858 m_jit.store32(calleePayloadGPR, m_jit.calleeFramePayloadSlot( JSStack::Callee));859 m_jit.store32(calleeTagGPR, m_jit.calleeFrameTagSlot( JSStack::Callee));858 m_jit.store32(calleePayloadGPR, m_jit.calleeFramePayloadSlot(CallFrameSlot::callee)); 859 m_jit.store32(calleeTagGPR, m_jit.calleeFrameTagSlot(CallFrameSlot::callee)); 860 860 861 861 if (!isTail) … … 4117 4117 case GetCallee: { 4118 4118 GPRTemporary result(this); 4119 m_jit.loadPtr(JITCompiler::payloadFor( JSStack::Callee), result.gpr());4119 m_jit.loadPtr(JITCompiler::payloadFor(CallFrameSlot::callee), result.gpr()); 4120 4120 cellResult(result.gpr(), node); 4121 4121 break; … … 4124 4124 case GetArgumentCountIncludingThis: { 4125 4125 GPRTemporary result(this); 4126 m_jit.load32(JITCompiler::payloadFor( JSStack::ArgumentCount), result.gpr());4126 m_jit.load32(JITCompiler::payloadFor(CallFrameSlot::argumentCount), result.gpr()); 4127 4127 int32Result(result.gpr(), node); 4128 4128 break; -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r202680 r203006 807 807 shuffleData.setupCalleeSaveRegisters(m_jit.codeBlock()); 808 808 } else { 809 m_jit.store32(MacroAssembler::TrustedImm32(numPassedArgs), JITCompiler::calleeFramePayloadSlot( JSStack::ArgumentCount));809 m_jit.store32(MacroAssembler::TrustedImm32(numPassedArgs), JITCompiler::calleeFramePayloadSlot(CallFrameSlot::argumentCount)); 810 810 811 811 for (int i = 0; i < numPassedArgs; i++) { … … 825 825 calleeGPR = callee.gpr(); 826 826 callee.use(); 827 m_jit.store64(calleeGPR, JITCompiler::calleeFrameSlot( JSStack::Callee));827 m_jit.store64(calleeGPR, JITCompiler::calleeFrameSlot(CallFrameSlot::callee)); 828 828 829 829 flushRegisters(); … … 4048 4048 case GetCallee: { 4049 4049 GPRTemporary result(this); 4050 m_jit.loadPtr(JITCompiler::addressFor( JSStack::Callee), result.gpr());4050 m_jit.loadPtr(JITCompiler::addressFor(CallFrameSlot::callee), result.gpr()); 4051 4051 cellResult(result.gpr(), node); 4052 4052 break; … … 4055 4055 case GetArgumentCountIncludingThis: { 4056 4056 GPRTemporary result(this); 4057 m_jit.load32(JITCompiler::payloadFor( JSStack::ArgumentCount), result.gpr());4057 m_jit.load32(JITCompiler::payloadFor(CallFrameSlot::argumentCount), result.gpr()); 4058 4058 int32Result(result.gpr(), node); 4059 4059 break; -
trunk/Source/JavaScriptCore/dfg/DFGStackLayoutPhase.cpp
r198600 r203006 119 119 if (inlineCallFrame->isVarargs()) { 120 120 usedLocals.set(VirtualRegister( 121 JSStack::ArgumentCount + inlineCallFrame->stackOffset).toLocal());121 CallFrameSlot::argumentCount + inlineCallFrame->stackOffset).toLocal()); 122 122 } 123 123 … … 185 185 if (inlineCallFrame->isVarargs()) { 186 186 inlineCallFrame->argumentCountRegister = assign( 187 allocation, VirtualRegister(inlineCallFrame->stackOffset + JSStack::ArgumentCount));187 allocation, VirtualRegister(inlineCallFrame->stackOffset + CallFrameSlot::argumentCount)); 188 188 } 189 189 -
trunk/Source/JavaScriptCore/dfg/DFGThunks.cpp
r200879 r203006 112 112 ptrdiff_t offsetOfTargetPC = offsetOfFrameSize + sizeof(EncodedJSValue); 113 113 ptrdiff_t offsetOfPayload = offsetOfTargetPC + sizeof(EncodedJSValue); 114 ptrdiff_t offsetOfLocals = offsetOfPayload + sizeof(Register) * JSStack::CallFrameHeaderSize;114 ptrdiff_t offsetOfLocals = offsetOfPayload + sizeof(Register) * CallFrame::headerSizeInRegisters; 115 115 116 116 jit.move(GPRInfo::returnValueGPR2, GPRInfo::regT0); … … 129 129 jit.store32(GPRInfo::regT2, MacroAssembler::BaseIndex(GPRInfo::callFrameRegister, GPRInfo::regT4, MacroAssembler::TimesEight, -static_cast<intptr_t>(sizeof(Register)))); 130 130 jit.store32(GPRInfo::regT3, MacroAssembler::BaseIndex(GPRInfo::callFrameRegister, GPRInfo::regT4, MacroAssembler::TimesEight, -static_cast<intptr_t>(sizeof(Register)) + static_cast<intptr_t>(sizeof(int32_t)))); 131 jit.branchPtr(MacroAssembler::NotEqual, GPRInfo::regT1, MacroAssembler::TrustedImmPtr(bitwise_cast<void*>(-static_cast<intptr_t>( JSStack::CallFrameHeaderSize)))).linkTo(loop, &jit);131 jit.branchPtr(MacroAssembler::NotEqual, GPRInfo::regT1, MacroAssembler::TrustedImmPtr(bitwise_cast<void*>(-static_cast<intptr_t>(CallFrame::headerSizeInRegisters)))).linkTo(loop, &jit); 132 132 133 133 jit.loadPtr(MacroAssembler::Address(GPRInfo::regT0, offsetOfTargetPC), GPRInfo::regT1); -
trunk/Source/JavaScriptCore/ftl/FTLLink.cpp
r202838 r203006 131 131 132 132 jit.load32( 133 frame.withOffset(sizeof(Register) * JSStack::ArgumentCount),133 frame.withOffset(sizeof(Register) * CallFrameSlot::argumentCount), 134 134 GPRInfo::regT1); 135 135 mainPathJumps.append(jit.branch32( -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r202997 r203006 186 186 m_proc.addFastConstant(m_tagMask->key()); 187 187 188 m_out.storePtr(m_out.constIntPtr(codeBlock()), addressFor( JSStack::CodeBlock));188 m_out.storePtr(m_out.constIntPtr(codeBlock()), addressFor(CallFrameSlot::codeBlock)); 189 189 190 190 // Stack Overflow Check. … … 213 213 jit.store32( 214 214 MacroAssembler::TrustedImm32(callSiteIndex.bits()), 215 CCallHelpers::tagFor(VirtualRegister( JSStack::ArgumentCount)));215 CCallHelpers::tagFor(VirtualRegister(CallFrameSlot::argumentCount))); 216 216 jit.copyCalleeSavesToVMEntryFrameCalleeSavesBuffer(); 217 217 … … 3047 3047 VirtualRegister argumentCountRegister; 3048 3048 if (!inlineCallFrame) 3049 argumentCountRegister = VirtualRegister( JSStack::ArgumentCount);3049 argumentCountRegister = VirtualRegister(CallFrameSlot::argumentCount); 3050 3050 else 3051 3051 argumentCountRegister = inlineCallFrame->argumentCountRegister; … … 4733 4733 void compileGetCallee() 4734 4734 { 4735 setJSValue(m_out.loadPtr(addressFor( JSStack::Callee)));4735 setJSValue(m_out.loadPtr(addressFor(CallFrameSlot::callee))); 4736 4736 } 4737 4737 4738 4738 void compileGetArgumentCountIncludingThis() 4739 4739 { 4740 setInt32(m_out.load32(payloadFor( JSStack::ArgumentCount)));4740 setInt32(m_out.load32(payloadFor(CallFrameSlot::argumentCount))); 4741 4741 } 4742 4742 … … 5063 5063 LValue jsCallee = lowJSValue(m_graph.varArgChild(node, 0)); 5064 5064 5065 unsigned frameSize = JSStack::CallFrameHeaderSize+ numArgs;5065 unsigned frameSize = CallFrame::headerSizeInRegisters + numArgs; 5066 5066 unsigned alignedFrameSize = WTF::roundUpToMultipleOf(stackAlignmentRegisters(), frameSize); 5067 5067 … … 5086 5086 auto addArgument = [&] (LValue value, VirtualRegister reg, int offset) { 5087 5087 intptr_t offsetFromSP = 5088 (reg.offset() - JSStack::CallerFrameAndPCSize) * sizeof(EncodedJSValue) + offset;5088 (reg.offset() - CallerFrameAndPC::sizeInRegisters) * sizeof(EncodedJSValue) + offset; 5089 5089 arguments.append(ConstrainedValue(value, ValueRep::stackArgument(offsetFromSP))); 5090 5090 }; 5091 5091 5092 addArgument(jsCallee, VirtualRegister( JSStack::Callee), 0);5093 addArgument(m_out.constInt32(numArgs), VirtualRegister( JSStack::ArgumentCount), PayloadOffset);5092 addArgument(jsCallee, VirtualRegister(CallFrameSlot::callee), 0); 5093 addArgument(m_out.constInt32(numArgs), VirtualRegister(CallFrameSlot::argumentCount), PayloadOffset); 5094 5094 for (unsigned i = 0; i < numArgs; ++i) 5095 5095 addArgument(lowJSValue(m_graph.varArgChild(node, 1 + i)), virtualRegisterForArgument(i), 0); … … 5118 5118 jit.store32( 5119 5119 CCallHelpers::TrustedImm32(callSiteIndex.bits()), 5120 CCallHelpers::tagFor(VirtualRegister( JSStack::ArgumentCount)));5120 CCallHelpers::tagFor(VirtualRegister(CallFrameSlot::argumentCount))); 5121 5121 5122 5122 CallLinkInfo* callLinkInfo = jit.codeBlock()->addCallLinkInfo(); … … 5236 5236 jit.store32( 5237 5237 CCallHelpers::TrustedImm32(callSiteIndex.bits()), 5238 CCallHelpers::tagFor(VirtualRegister( JSStack::ArgumentCount)));5238 CCallHelpers::tagFor(VirtualRegister(CallFrameSlot::argumentCount))); 5239 5239 5240 5240 CallFrameShuffler slowPathShuffler(jit, shuffleData); … … 5341 5341 jit.store32( 5342 5342 CCallHelpers::TrustedImm32(callSiteIndex.bits()), 5343 CCallHelpers::tagFor(VirtualRegister( JSStack::ArgumentCount)));5343 CCallHelpers::tagFor(VirtualRegister(CallFrameSlot::argumentCount))); 5344 5344 5345 5345 CallLinkInfo* callLinkInfo = jit.codeBlock()->addCallLinkInfo(); … … 5470 5470 } 5471 5471 5472 jit.store64(GPRInfo::regT0, CCallHelpers::calleeFrameSlot( JSStack::Callee));5472 jit.store64(GPRInfo::regT0, CCallHelpers::calleeFrameSlot(CallFrameSlot::callee)); 5473 5473 jit.store64(thisGPR, CCallHelpers::calleeArgumentSlot(0)); 5474 5474 … … 7153 7153 m_out.storePtr(m_callFrame, packet, m_heaps.ShadowChicken_Packet_frame); 7154 7154 m_out.storePtr(m_out.loadPtr(addressFor(0)), packet, m_heaps.ShadowChicken_Packet_callerFrame); 7155 m_out.storePtr(m_out.loadPtr(payloadFor( JSStack::Callee)), packet, m_heaps.ShadowChicken_Packet_callee);7155 m_out.storePtr(m_out.loadPtr(payloadFor(CallFrameSlot::callee)), packet, m_heaps.ShadowChicken_Packet_callee); 7156 7156 m_out.storePtr(scope, packet, m_heaps.ShadowChicken_Packet_scope); 7157 7157 } … … 7221 7221 VirtualRegister argumentCountRegister; 7222 7222 if (!inlineCallFrame) 7223 argumentCountRegister = VirtualRegister( JSStack::ArgumentCount);7223 argumentCountRegister = VirtualRegister(CallFrameSlot::argumentCount); 7224 7224 else 7225 7225 argumentCountRegister = inlineCallFrame->argumentCountRegister; … … 7242 7242 return weakPointer(frame->calleeRecovery.constant().asCell()); 7243 7243 } 7244 return m_out.loadPtr(addressFor( JSStack::Callee));7244 return m_out.loadPtr(addressFor(CallFrameSlot::callee)); 7245 7245 } 7246 7246 … … 10703 10703 m_out.store32( 10704 10704 m_out.constInt32(callSiteIndex.bits()), 10705 tagFor( JSStack::ArgumentCount));10705 tagFor(CallFrameSlot::argumentCount)); 10706 10706 } 10707 10707 -
trunk/Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp
r200879 r203006 395 395 } 396 396 397 jit.load32(CCallHelpers::payloadFor( JSStack::ArgumentCount), GPRInfo::regT2);397 jit.load32(CCallHelpers::payloadFor(CallFrameSlot::argumentCount), GPRInfo::regT2); 398 398 399 399 // Let's say that the FTL function had failed its arity check. In that case, the stack will -
trunk/Source/JavaScriptCore/ftl/FTLSlowPathCall.h
r199303 r203006 104 104 jit.store32( 105 105 CCallHelpers::TrustedImm32(callSiteIndex.bits()), 106 CCallHelpers::tagFor( JSStack::ArgumentCount));106 CCallHelpers::tagFor(CallFrameSlot::argumentCount)); 107 107 } 108 108 return callOperation(usedRegisters, jit, exceptionTarget, function, resultGPR, arguments...); -
trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp
r201766 r203006 37 37 namespace JSC { 38 38 39 void ExecState::initGlobalExec(ExecState* globalExec, JSCallee* globalCallee) 40 { 41 globalExec->setCodeBlock(nullptr); 42 globalExec->setCallerFrame(noCaller()); 43 globalExec->setReturnPC(0); 44 globalExec->setArgumentCountIncludingThis(0); 45 globalExec->setCallee(globalCallee); 46 } 47 39 48 bool CallFrame::callSiteBitsAreBytecodeOffset() const 40 49 { … … 77 86 unsigned CallFrame::callSiteAsRawBits() const 78 87 { 79 return this[ JSStack::ArgumentCount].tag();88 return this[CallFrameSlot::argumentCount].tag(); 80 89 } 81 90 82 91 SUPPRESS_ASAN unsigned CallFrame::unsafeCallSiteAsRawBits() const 83 92 { 84 return this[ JSStack::ArgumentCount].unsafeTag();93 return this[CallFrameSlot::argumentCount].unsafeTag(); 85 94 } 86 95 … … 112 121 { 113 122 CallSiteIndex callSite(vpc); 114 this[ JSStack::ArgumentCount].tag() = callSite.bits();123 this[CallFrameSlot::argumentCount].tag() = callSite.bits(); 115 124 } 116 125 … … 132 141 { 133 142 CallSiteIndex callSite(vpc - codeBlock()->instructions().begin()); 134 this[ JSStack::ArgumentCount].tag() = static_cast<int32_t>(callSite.bits());143 this[CallFrameSlot::argumentCount].tag() = static_cast<int32_t>(callSite.bits()); 135 144 } 136 145 -
trunk/Source/JavaScriptCore/interpreter/CallFrame.h
r202778 r203006 2 2 * Copyright (C) 1999-2001 Harri Porten (porten@kde.org) 3 3 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 4 * Copyright (C) 2003, 2007 ,2008, 2011, 2013-2016 Apple Inc. All rights reserved.4 * Copyright (C) 2003, 2007-2008, 2011, 2013-2016 Apple Inc. All rights reserved. 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 25 25 26 26 #include "AbstractPC.h" 27 #include "JSStack.h"28 27 #include "MacroAssemblerCodeRef.h" 29 28 #include "Register.h" … … 35 34 36 35 class Arguments; 36 class ExecState; 37 37 class Interpreter; 38 class JSCallee; 38 39 class JSScope; 40 41 struct Instruction; 42 43 typedef ExecState CallFrame; 39 44 40 45 struct CallSiteIndex { … … 61 66 }; 62 67 68 struct CallerFrameAndPC { 69 CallFrame* callerFrame; 70 Instruction* pc; 71 static const int sizeInRegisters = 2 * sizeof(void*) / sizeof(Register); 72 }; 73 static_assert(CallerFrameAndPC::sizeInRegisters == sizeof(CallerFrameAndPC) / sizeof(Register), "CallerFrameAndPC::sizeInRegisters is incorrect."); 74 75 struct CallFrameSlot { 76 static const int codeBlock = CallerFrameAndPC::sizeInRegisters; 77 static const int callee = codeBlock + 1; 78 static const int argumentCount = callee + 1; 79 static const int thisArgument = argumentCount + 1; 80 static const int firstArgument = thisArgument + 1; 81 }; 82 63 83 // Represents the current state of script execution. 64 84 // Passed as the first argument to most functions. 65 85 class ExecState : private Register { 66 86 public: 67 JSValue calleeAsValue() const { return this[JSStack::Callee].jsValue(); } 68 JSObject* callee() const { return this[JSStack::Callee].object(); } 69 SUPPRESS_ASAN JSValue unsafeCallee() const { return this[JSStack::Callee].asanUnsafeJSValue(); } 70 CodeBlock* codeBlock() const { return this[JSStack::CodeBlock].Register::codeBlock(); } 71 SUPPRESS_ASAN CodeBlock* unsafeCodeBlock() const { return this[JSStack::CodeBlock].Register::asanUnsafeCodeBlock(); } 87 static const int headerSizeInRegisters = CallFrameSlot::argumentCount + 1; 88 89 JSValue calleeAsValue() const { return this[CallFrameSlot::callee].jsValue(); } 90 JSObject* callee() const { return this[CallFrameSlot::callee].object(); } 91 SUPPRESS_ASAN JSValue unsafeCallee() const { return this[CallFrameSlot::callee].asanUnsafeJSValue(); } 92 CodeBlock* codeBlock() const { return this[CallFrameSlot::codeBlock].Register::codeBlock(); } 93 SUPPRESS_ASAN CodeBlock* unsafeCodeBlock() const { return this[CallFrameSlot::codeBlock].Register::asanUnsafeCodeBlock(); } 72 94 JSScope* scope(int scopeRegisterOffset) const 73 95 { … … 165 187 void setScope(int scopeRegisterOffset, JSScope* scope) { static_cast<Register*>(this)[scopeRegisterOffset] = scope; } 166 188 167 ALWAYS_INLINE void init(CodeBlock* codeBlock, Instruction* vPC, 168 CallFrame* callerFrame, int argc, JSObject* callee) 169 { 170 ASSERT(callerFrame == noCaller() || callerFrame->stack()->containsAddress(this)); 171 172 setCodeBlock(codeBlock); 173 setCallerFrame(callerFrame); 174 setReturnPC(vPC); // This is either an Instruction* or a pointer into JIT generated code stored as an Instruction*. 175 setArgumentCountIncludingThis(argc); // original argument count (for the sake of the "arguments" object) 176 setCallee(callee); 177 } 189 static void initGlobalExec(ExecState* globalExec, JSCallee* globalCallee); 178 190 179 191 // Read a register from the codeframe (or constant from the CodeBlock). … … 186 198 // Access to arguments as passed. (After capture, arguments may move to a different location.) 187 199 size_t argumentCount() const { return argumentCountIncludingThis() - 1; } 188 size_t argumentCountIncludingThis() const { return this[ JSStack::ArgumentCount].payload(); }189 static int argumentOffset(int argument) { return ( JSStack::FirstArgument + argument); }190 static int argumentOffsetIncludingThis(int argument) { return ( JSStack::ThisArgument + argument); }200 size_t argumentCountIncludingThis() const { return this[CallFrameSlot::argumentCount].payload(); } 201 static int argumentOffset(int argument) { return (CallFrameSlot::firstArgument + argument); } 202 static int argumentOffsetIncludingThis(int argument) { return (CallFrameSlot::thisArgument + argument); } 191 203 192 204 // In the following (argument() and setArgument()), the 'argument' … … 234 246 JSValue argumentAfterCapture(size_t argument); 235 247 236 static int offsetFor(size_t argumentCountIncludingThis) { return argumentCountIncludingThis + JSStack::ThisArgument - 1; }248 static int offsetFor(size_t argumentCountIncludingThis) { return argumentCountIncludingThis + CallFrameSlot::thisArgument - 1; } 237 249 238 250 static CallFrame* noCaller() { return 0; } 239 251 240 void setArgumentCountIncludingThis(int count) { static_cast<Register*>(this)[ JSStack::ArgumentCount].payload() = count; }241 void setCallee(JSObject* callee) { static_cast<Register*>(this)[ JSStack::Callee] = callee; }242 void setCodeBlock(CodeBlock* codeBlock) { static_cast<Register*>(this)[ JSStack::CodeBlock] = codeBlock; }252 void setArgumentCountIncludingThis(int count) { static_cast<Register*>(this)[CallFrameSlot::argumentCount].payload() = count; } 253 void setCallee(JSObject* callee) { static_cast<Register*>(this)[CallFrameSlot::callee] = callee; } 254 void setCodeBlock(CodeBlock* codeBlock) { static_cast<Register*>(this)[CallFrameSlot::codeBlock] = codeBlock; } 243 255 void setReturnPC(void* value) { callerFrameAndPC().pc = reinterpret_cast<Instruction*>(value); } 244 256 … … 280 292 281 293 // The offset is defined (based on argumentOffset()) to be: 282 // offset = JSStack::FirstArgument - argIndex;294 // offset = CallFrameSlot::firstArgument - argIndex; 283 295 // Hence: 284 // argIndex = JSStack::FirstArgument - offset;285 size_t argIndex = offset - JSStack::FirstArgument;296 // argIndex = CallFrameSlot::firstArgument - offset; 297 size_t argIndex = offset - CallFrameSlot::firstArgument; 286 298 return argIndex; 287 299 } … … 291 303 SUPPRESS_ASAN const CallerFrameAndPC& unsafeCallerFrameAndPC() const { return *reinterpret_cast<const CallerFrameAndPC*>(this); } 292 304 305 #if !ENABLE(JIT) 293 306 friend class JSStack; 307 #endif 294 308 }; 295 309 -
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r202890 r203006 402 402 const Register* end; 403 403 404 it = callFrame->registers() + JSStack::ThisArgument + callFrame->argumentCount();405 end = callFrame->registers() + JSStack::ThisArgument - 1;404 it = callFrame->registers() + CallFrameSlot::thisArgument + callFrame->argumentCount(); 405 end = callFrame->registers() + CallFrameSlot::thisArgument - 1; 406 406 while (it > end) { 407 407 JSValue v = it->jsValue(); -
trunk/Source/JavaScriptCore/interpreter/Interpreter.h
r202003 r203006 263 263 argumentCountIncludingThis = WTF::roundUpToMultipleOf( 264 264 stackAlignmentRegisters(), 265 argumentCountIncludingThis + JSStack::CallFrameHeaderSize) - JSStack::CallFrameHeaderSize;265 argumentCountIncludingThis + CallFrame::headerSizeInRegisters) - CallFrame::headerSizeInRegisters; 266 266 267 267 // Align the frame offset here. 268 268 unsigned paddedCalleeFrameOffset = WTF::roundUpToMultipleOf( 269 269 stackAlignmentRegisters(), 270 numUsedStackSlots + argumentCountIncludingThis + JSStack::CallFrameHeaderSize);270 numUsedStackSlots + argumentCountIncludingThis + CallFrame::headerSizeInRegisters); 271 271 return CallFrame::create(callFrame->registers() - paddedCalleeFrameOffset); 272 272 } -
trunk/Source/JavaScriptCore/interpreter/JSStack.h
r202992 r203006 30 30 #define JSStack_h 31 31 32 #include "ExecutableAllocator.h"33 32 #include "Register.h" 34 33 #include <wtf/Noncopyable.h> … … 40 39 class CodeBlockSet; 41 40 class ConservativeRoots; 42 class ExecState;43 41 class JITStubRoutineSet; 44 42 class VM; 45 43 class LLIntOffsetsExtractor; 46 44 47 struct Instruction;48 typedef ExecState CallFrame;49 50 struct CallerFrameAndPC {51 CallFrame* callerFrame;52 Instruction* pc;53 };54 55 45 class JSStack { 56 46 WTF_MAKE_NONCOPYABLE(JSStack); 57 47 public: 58 enum CallFrameHeaderEntry {59 CallerFrameAndPCSize = sizeof(CallerFrameAndPC) / sizeof(Register),60 CodeBlock = CallerFrameAndPCSize,61 Callee,62 ArgumentCount,63 CallFrameHeaderSize,64 65 // The following entries are not part of the CallFrameHeader but are provided here as a convenience:66 ThisArgument = CallFrameHeaderSize,67 FirstArgument,68 };69 70 48 // Allow 8k of excess registers before we start trying to reap the stack 71 49 static const ptrdiff_t maxExcessCapacity = 8 * 1024; … … 78 56 static size_t committedByteCount(); 79 57 80 #if ENABLE(JIT) 81 void gatherConservativeRoots(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&) { } 82 void sanitizeStack() { } 83 #else 58 #if !ENABLE(JIT) 84 59 ~JSStack(); 85 60 -
trunk/Source/JavaScriptCore/jit/AssemblyHelpers.cpp
r200879 r203006 294 294 void AssemblyHelpers::jitAssertArgumentCountSane() 295 295 { 296 Jump ok = branch32(Below, payloadFor( JSStack::ArgumentCount), TrustedImm32(10000000));296 Jump ok = branch32(Below, payloadFor(CallFrameSlot::argumentCount), TrustedImm32(10000000)); 297 297 abortWithReason(AHInsaneArgumentCount); 298 298 ok.link(this); … … 545 545 void AssemblyHelpers::emitRandomThunk(GPRReg scratch0, GPRReg scratch1, GPRReg scratch2, GPRReg scratch3, FPRReg result) 546 546 { 547 emitGetFromCallFrameHeaderPtr( JSStack::Callee, scratch3);547 emitGetFromCallFrameHeaderPtr(CallFrameSlot::callee, scratch3); 548 548 emitLoadStructure(scratch3, scratch3, scratch0); 549 549 loadPtr(Address(scratch3, Structure::globalObjectOffset()), scratch3); -
trunk/Source/JavaScriptCore/jit/AssemblyHelpers.h
r202680 r203006 561 561 #endif 562 562 563 void emitGetFromCallFrameHeaderPtr( JSStack::CallFrameHeaderEntryentry, GPRReg to, GPRReg from = GPRInfo::callFrameRegister)563 void emitGetFromCallFrameHeaderPtr(int entry, GPRReg to, GPRReg from = GPRInfo::callFrameRegister) 564 564 { 565 565 loadPtr(Address(from, entry * sizeof(Register)), to); 566 566 } 567 void emitGetFromCallFrameHeader32( JSStack::CallFrameHeaderEntryentry, GPRReg to, GPRReg from = GPRInfo::callFrameRegister)567 void emitGetFromCallFrameHeader32(int entry, GPRReg to, GPRReg from = GPRInfo::callFrameRegister) 568 568 { 569 569 load32(Address(from, entry * sizeof(Register)), to); 570 570 } 571 571 #if USE(JSVALUE64) 572 void emitGetFromCallFrameHeader64( JSStack::CallFrameHeaderEntryentry, GPRReg to, GPRReg from = GPRInfo::callFrameRegister)572 void emitGetFromCallFrameHeader64(int entry, GPRReg to, GPRReg from = GPRInfo::callFrameRegister) 573 573 { 574 574 load64(Address(from, entry * sizeof(Register)), to); 575 575 } 576 576 #endif // USE(JSVALUE64) 577 void emitPutToCallFrameHeader(GPRReg from, JSStack::CallFrameHeaderEntryentry)577 void emitPutToCallFrameHeader(GPRReg from, int entry) 578 578 { 579 579 storePtr(from, Address(GPRInfo::callFrameRegister, entry * sizeof(Register))); 580 580 } 581 581 582 void emitPutToCallFrameHeader(void* value, JSStack::CallFrameHeaderEntryentry)582 void emitPutToCallFrameHeader(void* value, int entry) 583 583 { 584 584 storePtr(TrustedImmPtr(value), Address(GPRInfo::callFrameRegister, entry * sizeof(Register))); … … 610 610 // "link register" containing the return address in the function prologue. 611 611 #if USE(JSVALUE64) 612 void emitPutToCallFrameHeaderBeforePrologue(GPRReg from, JSStack::CallFrameHeaderEntryentry)612 void emitPutToCallFrameHeaderBeforePrologue(GPRReg from, int entry) 613 613 { 614 614 storePtr(from, Address(stackPointerRegister, entry * static_cast<ptrdiff_t>(sizeof(Register)) - prologueStackPointerDelta())); 615 615 } 616 616 #else 617 void emitPutPayloadToCallFrameHeaderBeforePrologue(GPRReg from, JSStack::CallFrameHeaderEntryentry)617 void emitPutPayloadToCallFrameHeaderBeforePrologue(GPRReg from, int entry) 618 618 { 619 619 storePtr(from, Address(stackPointerRegister, entry * static_cast<ptrdiff_t>(sizeof(Register)) - prologueStackPointerDelta() + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload))); 620 620 } 621 621 622 void emitPutTagToCallFrameHeaderBeforePrologue(TrustedImm32 tag, JSStack::CallFrameHeaderEntryentry)622 void emitPutTagToCallFrameHeaderBeforePrologue(TrustedImm32 tag, int entry) 623 623 { 624 624 storePtr(tag, Address(stackPointerRegister, entry * static_cast<ptrdiff_t>(sizeof(Register)) - prologueStackPointerDelta() + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag))); … … 934 934 static Address calleeFrameSlot(int slot) 935 935 { 936 ASSERT(slot >= JSStack::CallerFrameAndPCSize);937 return Address(stackPointerRegister, sizeof(Register) * (slot - JSStack::CallerFrameAndPCSize));936 ASSERT(slot >= CallerFrameAndPC::sizeInRegisters); 937 return Address(stackPointerRegister, sizeof(Register) * (slot - CallerFrameAndPC::sizeInRegisters)); 938 938 } 939 939 -
trunk/Source/JavaScriptCore/jit/CCallHelpers.cpp
r200981 r203006 38 38 loadPtr(Address(GPRInfo::callFrameRegister, OBJECT_OFFSETOF(CallerFrameAndPC, callerFrame)), scratch1); 39 39 storePtr(scratch1, Address(shadowPacket, OBJECT_OFFSETOF(ShadowChicken::Packet, callerFrame))); 40 loadPtr(addressFor( JSStack::Callee), scratch1);40 loadPtr(addressFor(CallFrameSlot::callee), scratch1); 41 41 storePtr(scratch1, Address(shadowPacket, OBJECT_OFFSETOF(ShadowChicken::Packet, callee))); 42 42 storePtr(scope, Address(shadowPacket, OBJECT_OFFSETOF(ShadowChicken::Packet, scope))); -
trunk/Source/JavaScriptCore/jit/CCallHelpers.h
r201322 r203006 2279 2279 { 2280 2280 GPRReg argCountGPR = oldFrameSizeGPR; 2281 load32(Address(framePointerRegister, JSStack::ArgumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset), argCountGPR);2281 load32(Address(framePointerRegister, CallFrameSlot::argumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset), argCountGPR); 2282 2282 2283 2283 { … … 2285 2285 { 2286 2286 GPRReg codeBlockGPR = numParametersGPR; 2287 loadPtr(Address(framePointerRegister, JSStack::CodeBlock * static_cast<int>(sizeof(Register))), codeBlockGPR);2287 loadPtr(Address(framePointerRegister, CallFrameSlot::codeBlock * static_cast<int>(sizeof(Register))), codeBlockGPR); 2288 2288 load32(Address(codeBlockGPR, CodeBlock::offsetOfNumParameters()), numParametersGPR); 2289 2289 } … … 2295 2295 } 2296 2296 2297 add32(TrustedImm32(stackAlignmentRegisters() + JSStack::CallFrameHeaderSize- 1), argCountGPR, oldFrameSizeGPR);2297 add32(TrustedImm32(stackAlignmentRegisters() + CallFrame::headerSizeInRegisters - 1), argCountGPR, oldFrameSizeGPR); 2298 2298 and32(TrustedImm32(-stackAlignmentRegisters()), oldFrameSizeGPR); 2299 2299 // We assume < 2^28 arguments … … 2308 2308 // frame header size, aligned 2309 2309 ASSERT(newFrameSizeGPR != newFramePointer); 2310 load32(Address(stackPointerRegister, JSStack::ArgumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset - sizeof(CallerFrameAndPC)),2310 load32(Address(stackPointerRegister, CallFrameSlot::argumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset - sizeof(CallerFrameAndPC)), 2311 2311 newFrameSizeGPR); 2312 add32(TrustedImm32(stackAlignmentRegisters() + JSStack::CallFrameHeaderSize- 1), newFrameSizeGPR);2312 add32(TrustedImm32(stackAlignmentRegisters() + CallFrame::headerSizeInRegisters - 1), newFrameSizeGPR); 2313 2313 and32(TrustedImm32(-stackAlignmentRegisters()), newFrameSizeGPR); 2314 2314 // We assume < 2^28 arguments -
trunk/Source/JavaScriptCore/jit/CallFrameShuffler.cpp
r194496 r203006 37 37 CallFrameShuffler::CallFrameShuffler(CCallHelpers& jit, const CallFrameShuffleData& data) 38 38 : m_jit(jit) 39 , m_oldFrame(data.numLocals + JSStack::CallerFrameAndPCSize, nullptr)40 , m_newFrame(data.args.size() + JSStack::CallFrameHeaderSize, nullptr)41 , m_alignedOldFrameSize( JSStack::CallFrameHeaderSize39 , m_oldFrame(data.numLocals + CallerFrameAndPC::sizeInRegisters, nullptr) 40 , m_newFrame(data.args.size() + CallFrame::headerSizeInRegisters, nullptr) 41 , m_alignedOldFrameSize(CallFrame::headerSizeInRegisters 42 42 + roundArgumentCountToAlignFrame(jit.codeBlock()->numParameters())) 43 , m_alignedNewFrameSize( JSStack::CallFrameHeaderSize43 , m_alignedNewFrameSize(CallFrame::headerSizeInRegisters 44 44 + roundArgumentCountToAlignFrame(data.args.size())) 45 45 , m_frameDelta(m_alignedNewFrameSize - m_alignedOldFrameSize) … … 55 55 56 56 ASSERT(!data.callee.isInJSStack() || data.callee.virtualRegister().isLocal()); 57 addNew(VirtualRegister( JSStack::Callee), data.callee);57 addNew(VirtualRegister(CallFrameSlot::callee), data.callee); 58 58 59 59 for (size_t i = 0; i < data.args.size(); ++i) { … … 146 146 recoveryStr.data(), d); 147 147 } 148 } else if (newReg == VirtualRegister { JSStack::ArgumentCount })148 } else if (newReg == VirtualRegister { CallFrameSlot::argumentCount }) 149 149 out.printf(" %c%8s <- %18zu %c ", d, str.data(), argCount(), d); 150 150 else … … 324 324 325 325 if (isSlowPath()) 326 m_frameDelta = numLocals() + JSStack::CallerFrameAndPCSize;326 m_frameDelta = numLocals() + CallerFrameAndPC::sizeInRegisters; 327 327 else 328 328 m_oldFrameOffset = numLocals(); … … 340 340 emitDeltaCheck(); 341 341 342 m_frameDelta = numLocals() + JSStack::CallerFrameAndPCSize;342 m_frameDelta = numLocals() + CallerFrameAndPC::sizeInRegisters; 343 343 m_newFrameBase = MacroAssembler::stackPointerRegister; 344 m_newFrameOffset = - JSStack::CallerFrameAndPCSize;344 m_newFrameOffset = -CallerFrameAndPC::sizeInRegisters; 345 345 346 346 if (verbose) … … 424 424 // the number of parameters), then substracting to it the aligned 425 425 // new frame size (adjusted). 426 m_jit.load32(MacroAssembler::Address(GPRInfo::callFrameRegister, JSStack::ArgumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset), m_newFrameBase);426 m_jit.load32(MacroAssembler::Address(GPRInfo::callFrameRegister, CallFrameSlot::argumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset), m_newFrameBase); 427 427 MacroAssembler::Jump argumentCountOK = 428 428 m_jit.branch32(MacroAssembler::BelowOrEqual, m_newFrameBase, 429 429 MacroAssembler::TrustedImm32(m_jit.codeBlock()->numParameters())); 430 m_jit.add32(MacroAssembler::TrustedImm32(stackAlignmentRegisters() - 1 + JSStack::CallFrameHeaderSize), m_newFrameBase);430 m_jit.add32(MacroAssembler::TrustedImm32(stackAlignmentRegisters() - 1 + CallFrame::headerSizeInRegisters), m_newFrameBase); 431 431 m_jit.and32(MacroAssembler::TrustedImm32(-stackAlignmentRegisters()), m_newFrameBase); 432 432 m_jit.mul32(MacroAssembler::TrustedImm32(sizeof(Register)), m_newFrameBase, m_newFrameBase); … … 744 744 // m_newFrameBase, which could be a wanted register. 745 745 if (verbose) 746 dataLog(" * Storing the argument count into ", VirtualRegister { JSStack::ArgumentCount }, "\n");746 dataLog(" * Storing the argument count into ", VirtualRegister { CallFrameSlot::argumentCount }, "\n"); 747 747 m_jit.store32(MacroAssembler::TrustedImm32(0), 748 addressForNew(VirtualRegister { JSStack::ArgumentCount }).withOffset(TagOffset));748 addressForNew(VirtualRegister { CallFrameSlot::argumentCount }).withOffset(TagOffset)); 749 749 m_jit.store32(MacroAssembler::TrustedImm32(argCount()), 750 addressForNew(VirtualRegister { JSStack::ArgumentCount }).withOffset(PayloadOffset));750 addressForNew(VirtualRegister { CallFrameSlot::argumentCount }).withOffset(PayloadOffset)); 751 751 752 752 if (!isSlowPath()) { -
trunk/Source/JavaScriptCore/jit/CallFrameShuffler.h
r195440 r203006 104 104 CallFrameShuffleData data; 105 105 data.numLocals = numLocals(); 106 data.callee = getNew(VirtualRegister { JSStack::Callee })->recovery();106 data.callee = getNew(VirtualRegister { CallFrameSlot::callee })->recovery(); 107 107 data.args.resize(argCount()); 108 108 for (size_t i = 0; i < argCount(); ++i) … … 130 130 ASSERT(isUndecided()); 131 131 ASSERT(!getNew(jsValueRegs)); 132 CachedRecovery* cachedRecovery { getNew(VirtualRegister( JSStack::Callee)) };132 CachedRecovery* cachedRecovery { getNew(VirtualRegister(CallFrameSlot::callee)) }; 133 133 ASSERT(cachedRecovery); 134 134 addNew(jsValueRegs, cachedRecovery->recovery()); … … 143 143 { 144 144 #if USE(JSVALUE32_64) 145 CachedRecovery& calleeCachedRecovery = *getNew(VirtualRegister( JSStack::Callee));145 CachedRecovery& calleeCachedRecovery = *getNew(VirtualRegister(CallFrameSlot::callee)); 146 146 switch (calleeCachedRecovery.recovery().technique()) { 147 147 case InPair: … … 298 298 int numLocals() const 299 299 { 300 return m_oldFrame.size() - JSStack::CallerFrameAndPCSize;300 return m_oldFrame.size() - CallerFrameAndPC::sizeInRegisters; 301 301 } 302 302 303 303 CachedRecovery* getOld(VirtualRegister reg) const 304 304 { 305 return m_oldFrame[ JSStack::CallerFrameAndPCSize- reg.offset() - 1];305 return m_oldFrame[CallerFrameAndPC::sizeInRegisters - reg.offset() - 1]; 306 306 } 307 307 308 308 void setOld(VirtualRegister reg, CachedRecovery* cachedRecovery) 309 309 { 310 m_oldFrame[ JSStack::CallerFrameAndPCSize- reg.offset() - 1] = cachedRecovery;310 m_oldFrame[CallerFrameAndPC::sizeInRegisters - reg.offset() - 1] = cachedRecovery; 311 311 } 312 312 … … 318 318 VirtualRegister lastOld() const 319 319 { 320 return VirtualRegister { JSStack::CallerFrameAndPCSize- 1 };320 return VirtualRegister { CallerFrameAndPC::sizeInRegisters - 1 }; 321 321 } 322 322 … … 340 340 size_t argCount() const 341 341 { 342 return m_newFrame.size() - JSStack::CallFrameHeaderSize;342 return m_newFrame.size() - CallFrame::headerSizeInRegisters; 343 343 } 344 344 -
trunk/Source/JavaScriptCore/jit/JIT.cpp
r202992 r203006 570 570 571 571 emitFunctionPrologue(); 572 emitPutToCallFrameHeader(m_codeBlock, JSStack::CodeBlock);572 emitPutToCallFrameHeader(m_codeBlock, CallFrameSlot::codeBlock); 573 573 574 574 Label beginLabel(this); … … 628 628 store8(TrustedImm32(0), &m_codeBlock->m_shouldAlwaysBeInlined); 629 629 emitFunctionPrologue(); 630 emitPutToCallFrameHeader(m_codeBlock, JSStack::CodeBlock);631 632 load32(payloadFor( JSStack::ArgumentCount), regT1);630 emitPutToCallFrameHeader(m_codeBlock, CallFrameSlot::codeBlock); 631 632 load32(payloadFor(CallFrameSlot::argumentCount), regT1); 633 633 branch32(AboveOrEqual, regT1, TrustedImm32(m_codeBlock->m_numParameters)).linkTo(beginLabel, this); 634 634 -
trunk/Source/JavaScriptCore/jit/JIT.h
r202364 r203006 707 707 void emitInitRegister(int dst); 708 708 709 void emitPutIntToCallFrameHeader(RegisterID from, JSStack::CallFrameHeaderEntry);709 void emitPutIntToCallFrameHeader(RegisterID from, int entry); 710 710 711 711 JSValue getConstantOperand(int src); -
trunk/Source/JavaScriptCore/jit/JITCall.cpp
r202157 r203006 81 81 82 82 // Profile the argument count. 83 load32(Address(regT1, JSStack::ArgumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset), regT2);83 load32(Address(regT1, CallFrameSlot::argumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset), regT2); 84 84 load8(info->addressOfMaxNumArguments(), regT0); 85 85 Jump notBiggest = branch32(Above, regT0, regT2); … … 124 124 addPtr(TrustedImm32(registerOffset * sizeof(Register) + sizeof(CallerFrameAndPC)), callFrameRegister, stackPointerRegister); 125 125 126 load64(Address(stackPointerRegister, sizeof(Register) * JSStack::Callee - sizeof(CallerFrameAndPC)), regT0);126 load64(Address(stackPointerRegister, sizeof(Register) * CallFrameSlot::callee - sizeof(CallerFrameAndPC)), regT0); 127 127 move(TrustedImmPtr(info), regT2); 128 128 Call call = emitNakedCall(); … … 182 182 183 183 addPtr(TrustedImm32(registerOffset * sizeof(Register) + sizeof(CallerFrameAndPC)), callFrameRegister, stackPointerRegister); 184 store32(TrustedImm32(argCount), Address(stackPointerRegister, JSStack::ArgumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset - sizeof(CallerFrameAndPC)));184 store32(TrustedImm32(argCount), Address(stackPointerRegister, CallFrameSlot::argumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset - sizeof(CallerFrameAndPC))); 185 185 } // SP holds newCallFrame + sizeof(CallerFrameAndPC), with ArgumentCount initialized. 186 186 187 187 uint32_t bytecodeOffset = instruction - m_codeBlock->instructions().begin(); 188 188 uint32_t locationBits = CallSiteIndex(bytecodeOffset).bits(); 189 store32(TrustedImm32(locationBits), Address(callFrameRegister, JSStack::ArgumentCount * static_cast<int>(sizeof(Register)) + TagOffset));189 store32(TrustedImm32(locationBits), Address(callFrameRegister, CallFrameSlot::argumentCount * static_cast<int>(sizeof(Register)) + TagOffset)); 190 190 191 191 emitGetVirtualRegister(callee, regT0); // regT0 holds callee. 192 store64(regT0, Address(stackPointerRegister, JSStack::Callee * static_cast<int>(sizeof(Register)) - sizeof(CallerFrameAndPC)));192 store64(regT0, Address(stackPointerRegister, CallFrameSlot::callee * static_cast<int>(sizeof(Register)) - sizeof(CallerFrameAndPC))); 193 193 194 194 if (opcodeID == op_call_eval) { -
trunk/Source/JavaScriptCore/jit/JITCall32_64.cpp
r202003 r203006 171 171 172 172 // Profile the argument count. 173 load32(Address(regT1, JSStack::ArgumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset), regT2);173 load32(Address(regT1, CallFrameSlot::argumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset), regT2); 174 174 load8(info->addressOfMaxNumArguments(), regT0); 175 175 Jump notBiggest = branch32(Above, regT0, regT2); … … 215 215 addPtr(TrustedImm32(registerOffset * sizeof(Register) + sizeof(CallerFrameAndPC)), callFrameRegister, stackPointerRegister); 216 216 217 loadPtr(Address(stackPointerRegister, sizeof(Register) * JSStack::Callee - sizeof(CallerFrameAndPC)), regT0);218 loadPtr(Address(stackPointerRegister, sizeof(Register) * JSStack::Callee - sizeof(CallerFrameAndPC)), regT1);217 loadPtr(Address(stackPointerRegister, sizeof(Register) * CallFrameSlot::callee - sizeof(CallerFrameAndPC)), regT0); 218 loadPtr(Address(stackPointerRegister, sizeof(Register) * CallFrameSlot::callee - sizeof(CallerFrameAndPC)), regT1); 219 219 move(TrustedImmPtr(info), regT2); 220 220 221 emitLoad( JSStack::Callee, regT1, regT0);221 emitLoad(CallFrameSlot::callee, regT1, regT0); 222 222 MacroAssemblerCodeRef virtualThunk = virtualThunkFor(m_vm, *info); 223 223 info->setSlowStub(createJITStubRoutine(virtualThunk, *m_vm, nullptr, true)); … … 266 266 addPtr(TrustedImm32(registerOffset * sizeof(Register) + sizeof(CallerFrameAndPC)), callFrameRegister, stackPointerRegister); 267 267 268 store32(TrustedImm32(argCount), Address(stackPointerRegister, JSStack::ArgumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset - sizeof(CallerFrameAndPC)));268 store32(TrustedImm32(argCount), Address(stackPointerRegister, CallFrameSlot::argumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset - sizeof(CallerFrameAndPC))); 269 269 } // SP holds newCallFrame + sizeof(CallerFrameAndPC), with ArgumentCount initialized. 270 270 271 271 uint32_t locationBits = CallSiteIndex(instruction).bits(); 272 store32(TrustedImm32(locationBits), tagFor( JSStack::ArgumentCount, callFrameRegister));272 store32(TrustedImm32(locationBits), tagFor(CallFrameSlot::argumentCount, callFrameRegister)); 273 273 emitLoad(callee, regT1, regT0); // regT1, regT0 holds callee. 274 274 275 store32(regT0, Address(stackPointerRegister, JSStack::Callee * static_cast<int>(sizeof(Register)) + PayloadOffset - sizeof(CallerFrameAndPC)));276 store32(regT1, Address(stackPointerRegister, JSStack::Callee * static_cast<int>(sizeof(Register)) + TagOffset - sizeof(CallerFrameAndPC)));275 store32(regT0, Address(stackPointerRegister, CallFrameSlot::callee * static_cast<int>(sizeof(Register)) + PayloadOffset - sizeof(CallerFrameAndPC))); 276 store32(regT1, Address(stackPointerRegister, CallFrameSlot::callee * static_cast<int>(sizeof(Register)) + TagOffset - sizeof(CallerFrameAndPC))); 277 277 278 278 if (opcodeID == op_call_eval) { -
trunk/Source/JavaScriptCore/jit/JITInlines.h
r202157 r203006 89 89 } 90 90 91 ALWAYS_INLINE void JIT::emitPutIntToCallFrameHeader(RegisterID from, JSStack::CallFrameHeaderEntryentry)91 ALWAYS_INLINE void JIT::emitPutIntToCallFrameHeader(RegisterID from, int entry) 92 92 { 93 93 #if USE(JSVALUE32_64) … … 143 143 uint32_t locationBits = CallSiteIndex(m_bytecodeOffset + 1).bits(); 144 144 #endif 145 store32(TrustedImm32(locationBits), intTagFor( JSStack::ArgumentCount));145 store32(TrustedImm32(locationBits), intTagFor(CallFrameSlot::argumentCount)); 146 146 147 147 // FIXME: It's not clear that this is needed. JITOperations tend to update the top call frame on -
trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp
r202680 r203006 724 724 { 725 725 int dst = currentInstruction[1].u.operand; 726 emitGetFromCallFrameHeaderPtr( JSStack::Callee, regT0);726 emitGetFromCallFrameHeaderPtr(CallFrameSlot::callee, regT0); 727 727 loadPtr(Address(regT0, JSFunction::offsetOfScopeChain()), regT0); 728 728 emitStoreCell(dst, regT0); … … 1445 1445 { 1446 1446 int dst = currentInstruction[1].u.operand; 1447 load32(payloadFor( JSStack::ArgumentCount), regT0);1447 load32(payloadFor(CallFrameSlot::argumentCount), regT0); 1448 1448 sub32(TrustedImm32(1), regT0); 1449 1449 JSValueRegs result = JSValueRegs::withTwoAvailableRegs(regT0, regT1); … … 1462 1462 int dst = currentInstruction[1].u.operand; 1463 1463 unsigned numParamsToSkip = currentInstruction[2].u.unsignedValue; 1464 load32(payloadFor( JSStack::ArgumentCount), regT0);1464 load32(payloadFor(CallFrameSlot::argumentCount), regT0); 1465 1465 sub32(TrustedImm32(1), regT0); 1466 1466 Jump zeroLength = branch32(LessThanOrEqual, regT0, Imm32(numParamsToSkip)); -
trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r202680 r203006 56 56 57 57 emitFunctionPrologue(); 58 emitPutToCallFrameHeader(0, JSStack::CodeBlock);58 emitPutToCallFrameHeader(0, CallFrameSlot::codeBlock); 59 59 storePtr(callFrameRegister, &m_vm->topCallFrame); 60 60 … … 82 82 move(callFrameRegister, argumentGPR0); 83 83 84 emitGetFromCallFrameHeaderPtr( JSStack::Callee, argumentGPR1);84 emitGetFromCallFrameHeaderPtr(CallFrameSlot::callee, argumentGPR1); 85 85 loadPtr(Address(argumentGPR1, OBJECT_OFFSETOF(JSFunction, m_executable)), regT2); 86 86 … … 998 998 { 999 999 int dst = currentInstruction[1].u.operand; 1000 emitGetFromCallFrameHeaderPtr( JSStack::Callee, regT0);1000 emitGetFromCallFrameHeaderPtr(CallFrameSlot::callee, regT0); 1001 1001 loadPtr(Address(regT0, JSFunction::offsetOfScopeChain()), regT0); 1002 1002 emitStoreCell(dst, regT0); -
trunk/Source/JavaScriptCore/jit/JSInterfaceJIT.h
r191191 r203006 72 72 Jump emitJumpIfNotType(RegisterID baseReg, JSType); 73 73 74 void emitGetFromCallFrameHeaderPtr( JSStack::CallFrameHeaderEntry, RegisterID to, RegisterID from = callFrameRegister);75 void emitPutToCallFrameHeader(RegisterID from, JSStack::CallFrameHeaderEntry);76 void emitPutToCallFrameHeader(void* value, JSStack::CallFrameHeaderEntry);77 void emitPutCellToCallFrameHeader(RegisterID from, JSStack::CallFrameHeaderEntry);74 void emitGetFromCallFrameHeaderPtr(int entry, RegisterID to, RegisterID from = callFrameRegister); 75 void emitPutToCallFrameHeader(RegisterID from, int entry); 76 void emitPutToCallFrameHeader(void* value, int entry); 77 void emitPutCellToCallFrameHeader(RegisterID from, int entry); 78 78 79 79 inline Address payloadFor(int index, RegisterID base = callFrameRegister); … … 222 222 } 223 223 224 ALWAYS_INLINE void JSInterfaceJIT::emitGetFromCallFrameHeaderPtr( JSStack::CallFrameHeaderEntryentry, RegisterID to, RegisterID from)224 ALWAYS_INLINE void JSInterfaceJIT::emitGetFromCallFrameHeaderPtr(int entry, RegisterID to, RegisterID from) 225 225 { 226 226 loadPtr(Address(from, entry * sizeof(Register)), to); 227 227 } 228 228 229 ALWAYS_INLINE void JSInterfaceJIT::emitPutToCallFrameHeader(RegisterID from, JSStack::CallFrameHeaderEntryentry)229 ALWAYS_INLINE void JSInterfaceJIT::emitPutToCallFrameHeader(RegisterID from, int entry) 230 230 { 231 231 #if USE(JSVALUE32_64) … … 236 236 } 237 237 238 ALWAYS_INLINE void JSInterfaceJIT::emitPutToCallFrameHeader(void* value, JSStack::CallFrameHeaderEntryentry)238 ALWAYS_INLINE void JSInterfaceJIT::emitPutToCallFrameHeader(void* value, int entry) 239 239 { 240 240 storePtr(TrustedImmPtr(value), Address(callFrameRegister, entry * sizeof(Register))); 241 241 } 242 242 243 ALWAYS_INLINE void JSInterfaceJIT::emitPutCellToCallFrameHeader(RegisterID from, JSStack::CallFrameHeaderEntryentry)243 ALWAYS_INLINE void JSInterfaceJIT::emitPutCellToCallFrameHeader(RegisterID from, int entry) 244 244 { 245 245 #if USE(JSVALUE32_64) -
trunk/Source/JavaScriptCore/jit/SetupVarargsFrame.cpp
r202992 r203006 48 48 49 49 jit.addPtr(lengthGPR, resultGPR); 50 jit.addPtr(CCallHelpers::TrustedImm32( JSStack::CallFrameHeaderSize+ (lengthIncludesThis? 0 : 1)), resultGPR);50 jit.addPtr(CCallHelpers::TrustedImm32(CallFrame::headerSizeInRegisters + (lengthIncludesThis? 0 : 1)), resultGPR); 51 51 52 52 // resultGPR now has the required frame size in Register units … … 86 86 87 87 // Initialize ArgumentCount. 88 jit.store32(scratchGPR1, CCallHelpers::Address(scratchGPR2, JSStack::ArgumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset));88 jit.store32(scratchGPR1, CCallHelpers::Address(scratchGPR2, CallFrameSlot::argumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset)); 89 89 90 90 // Copy arguments. … … 132 132 } else { 133 133 argumentCountRecovery = ValueRecovery::displacedInJSStack( 134 VirtualRegister( JSStack::ArgumentCount), DataFormatInt32);134 VirtualRegister(CallFrameSlot::argumentCount), DataFormatInt32); 135 135 firstArgumentReg = VirtualRegister(CallFrame::argumentOffset(0)); 136 136 } -
trunk/Source/JavaScriptCore/jit/SpecializedThunkJIT.h
r199946 r203006 47 47 emitSaveThenMaterializeTagRegisters(); 48 48 // Check that we have the expected number of arguments 49 m_failures.append(branch32(NotEqual, payloadFor( JSStack::ArgumentCount), TrustedImm32(expectedArgCount + 1)));49 m_failures.append(branch32(NotEqual, payloadFor(CallFrameSlot::argumentCount), TrustedImm32(expectedArgCount + 1))); 50 50 } 51 51 -
trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp
r200879 r203006 260 260 } 261 261 262 jit.emitPutToCallFrameHeader(0, JSStack::CodeBlock);262 jit.emitPutToCallFrameHeader(0, CallFrameSlot::codeBlock); 263 263 jit.storePtr(JSInterfaceJIT::callFrameRegister, &vm->topCallFrame); 264 264 … … 271 271 272 272 // call the function 273 jit.emitGetFromCallFrameHeaderPtr( JSStack::Callee, JSInterfaceJIT::regT1);273 jit.emitGetFromCallFrameHeaderPtr(CallFrameSlot::callee, JSInterfaceJIT::regT1); 274 274 jit.loadPtr(JSInterfaceJIT::Address(JSInterfaceJIT::regT1, JSFunction::offsetOfExecutable()), JSInterfaceJIT::regT1); 275 275 jit.call(JSInterfaceJIT::Address(JSInterfaceJIT::regT1, executableOffsetToFunction)); … … 283 283 jit.move(JSInterfaceJIT::callFrameRegister, X86Registers::edi); 284 284 285 jit.emitGetFromCallFrameHeaderPtr( JSStack::Callee, X86Registers::esi);285 jit.emitGetFromCallFrameHeaderPtr(CallFrameSlot::callee, X86Registers::esi); 286 286 jit.loadPtr(JSInterfaceJIT::Address(X86Registers::esi, JSFunction::offsetOfExecutable()), X86Registers::r9); 287 287 jit.call(JSInterfaceJIT::Address(X86Registers::r9, executableOffsetToFunction)); … … 296 296 jit.subPtr(JSInterfaceJIT::TrustedImm32(4 * sizeof(int64_t)), JSInterfaceJIT::stackPointerRegister); 297 297 298 jit.emitGetFromCallFrameHeaderPtr( JSStack::Callee, X86Registers::edx);298 jit.emitGetFromCallFrameHeaderPtr(CallFrameSlot::callee, X86Registers::edx); 299 299 jit.loadPtr(JSInterfaceJIT::Address(X86Registers::edx, JSFunction::offsetOfExecutable()), X86Registers::r9); 300 300 jit.call(JSInterfaceJIT::Address(X86Registers::r9, executableOffsetToFunction)); … … 311 311 jit.move(JSInterfaceJIT::callFrameRegister, ARM64Registers::x0); 312 312 313 jit.emitGetFromCallFrameHeaderPtr( JSStack::Callee, ARM64Registers::x1);313 jit.emitGetFromCallFrameHeaderPtr(CallFrameSlot::callee, ARM64Registers::x1); 314 314 jit.loadPtr(JSInterfaceJIT::Address(ARM64Registers::x1, JSFunction::offsetOfExecutable()), ARM64Registers::x2); 315 315 jit.call(JSInterfaceJIT::Address(ARM64Registers::x2, executableOffsetToFunction)); … … 324 324 jit.move(JSInterfaceJIT::callFrameRegister, JSInterfaceJIT::argumentGPR0); 325 325 326 jit.emitGetFromCallFrameHeaderPtr( JSStack::Callee, JSInterfaceJIT::argumentGPR1);326 jit.emitGetFromCallFrameHeaderPtr(CallFrameSlot::callee, JSInterfaceJIT::argumentGPR1); 327 327 jit.loadPtr(JSInterfaceJIT::Address(JSInterfaceJIT::argumentGPR1, JSFunction::offsetOfExecutable()), JSInterfaceJIT::regT2); 328 328 jit.call(JSInterfaceJIT::Address(JSInterfaceJIT::regT2, executableOffsetToFunction)); … … 420 420 # endif 421 421 jit.move(JSInterfaceJIT::callFrameRegister, JSInterfaceJIT::regT3); 422 jit.load32(JSInterfaceJIT::Address(JSInterfaceJIT::callFrameRegister, JSStack::ArgumentCount * sizeof(Register)), JSInterfaceJIT::argumentGPR2);423 jit.add32(JSInterfaceJIT::TrustedImm32( JSStack::CallFrameHeaderSize), JSInterfaceJIT::argumentGPR2);422 jit.load32(JSInterfaceJIT::Address(JSInterfaceJIT::callFrameRegister, CallFrameSlot::argumentCount * sizeof(Register)), JSInterfaceJIT::argumentGPR2); 423 jit.add32(JSInterfaceJIT::TrustedImm32(CallFrame::headerSizeInRegisters), JSInterfaceJIT::argumentGPR2); 424 424 425 425 // Check to see if we have extra slots we can use … … 470 470 # endif 471 471 jit.move(JSInterfaceJIT::callFrameRegister, JSInterfaceJIT::regT3); 472 jit.load32(JSInterfaceJIT::Address(JSInterfaceJIT::callFrameRegister, JSStack::ArgumentCount * sizeof(Register)), JSInterfaceJIT::argumentGPR2);473 jit.add32(JSInterfaceJIT::TrustedImm32( JSStack::CallFrameHeaderSize), JSInterfaceJIT::argumentGPR2);472 jit.load32(JSInterfaceJIT::Address(JSInterfaceJIT::callFrameRegister, CallFrameSlot::argumentCount * sizeof(Register)), JSInterfaceJIT::argumentGPR2); 473 jit.add32(JSInterfaceJIT::TrustedImm32(CallFrame::headerSizeInRegisters), JSInterfaceJIT::argumentGPR2); 474 474 475 475 // Check to see if we have extra slots we can use … … 1044 1044 1045 1045 // Set up our call frame. 1046 jit.storePtr(CCallHelpers::TrustedImmPtr(nullptr), CCallHelpers::addressFor( JSStack::CodeBlock));1047 jit.store32(CCallHelpers::TrustedImm32(0), CCallHelpers::tagFor( JSStack::ArgumentCount));1046 jit.storePtr(CCallHelpers::TrustedImmPtr(nullptr), CCallHelpers::addressFor(CallFrameSlot::codeBlock)); 1047 jit.store32(CCallHelpers::TrustedImm32(0), CCallHelpers::tagFor(CallFrameSlot::argumentCount)); 1048 1048 1049 1049 unsigned extraStackNeeded = 0; … … 1066 1066 // That's really all there is to this. We have all the registers we need to do it. 1067 1067 1068 jit.load32(CCallHelpers::payloadFor( JSStack::ArgumentCount), GPRInfo::regT1);1069 jit.add32(CCallHelpers::TrustedImm32( JSStack::CallFrameHeaderSize - JSStack::CallerFrameAndPCSize), GPRInfo::regT1, GPRInfo::regT2);1068 jit.load32(CCallHelpers::payloadFor(CallFrameSlot::argumentCount), GPRInfo::regT1); 1069 jit.add32(CCallHelpers::TrustedImm32(CallFrame::headerSizeInRegisters - CallerFrameAndPC::sizeInRegisters), GPRInfo::regT1, GPRInfo::regT2); 1070 1070 jit.lshift32(CCallHelpers::TrustedImm32(3), GPRInfo::regT2); 1071 1071 jit.add32(CCallHelpers::TrustedImm32(stackAlignmentBytes() - 1), GPRInfo::regT2); … … 1082 1082 // Do basic callee frame setup, including 'this'. 1083 1083 1084 jit.loadCell(CCallHelpers::addressFor( JSStack::Callee), GPRInfo::regT3);1085 1086 jit.store32(GPRInfo::regT1, CCallHelpers::calleeFramePayloadSlot( JSStack::ArgumentCount));1084 jit.loadCell(CCallHelpers::addressFor(CallFrameSlot::callee), GPRInfo::regT3); 1085 1086 jit.store32(GPRInfo::regT1, CCallHelpers::calleeFramePayloadSlot(CallFrameSlot::argumentCount)); 1087 1087 1088 1088 JSValueRegs valueRegs = JSValueRegs::withTwoAvailableRegs(GPRInfo::regT0, GPRInfo::regT2); … … 1091 1091 1092 1092 jit.loadPtr(CCallHelpers::Address(GPRInfo::regT3, JSBoundFunction::offsetOfTargetFunction()), GPRInfo::regT3); 1093 jit.storeCell(GPRInfo::regT3, CCallHelpers::calleeFrameSlot( JSStack::Callee));1093 jit.storeCell(GPRInfo::regT3, CCallHelpers::calleeFrameSlot(CallFrameSlot::callee)); 1094 1094 1095 1095 // OK, now we can start copying. This is a simple matter of copying parameters from the caller's -
trunk/Source/JavaScriptCore/llint/LLIntData.cpp
r202650 r203006 97 97 STATIC_ASSERT(sizeof(void*) == PtrSize); 98 98 STATIC_ASSERT(sizeof(Register) == SlotSize); 99 STATIC_ASSERT( JSStack::CallFrameHeaderSize== CallFrameHeaderSlots);99 STATIC_ASSERT(CallFrame::headerSizeInRegisters == CallFrameHeaderSlots); 100 100 101 101 ASSERT(!CallFrame::callerFrameOffset()); 102 STATIC_ASSERT( JSStack::CallerFrameAndPCSize== (PtrSize * 2) / SlotSize);102 STATIC_ASSERT(CallerFrameAndPC::sizeInRegisters == (PtrSize * 2) / SlotSize); 103 103 ASSERT(CallFrame::returnPCOffset() == CallFrame::callerFrameOffset() + PtrSize); 104 ASSERT( JSStack::CodeBlock * sizeof(Register) == CallFrame::returnPCOffset() + PtrSize);105 STATIC_ASSERT( JSStack::Callee * sizeof(Register) == JSStack::CodeBlock * sizeof(Register) + SlotSize);106 STATIC_ASSERT( JSStack::ArgumentCount * sizeof(Register) == JSStack::Callee * sizeof(Register) + SlotSize);107 STATIC_ASSERT( JSStack::ThisArgument * sizeof(Register) == JSStack::ArgumentCount * sizeof(Register) + SlotSize);108 STATIC_ASSERT( JSStack::CallFrameHeaderSize == JSStack::ThisArgument);109 110 ASSERT(CallFrame::argumentOffsetIncludingThis(0) == JSStack::ThisArgument);104 ASSERT(CallFrameSlot::codeBlock * sizeof(Register) == CallFrame::returnPCOffset() + PtrSize); 105 STATIC_ASSERT(CallFrameSlot::callee * sizeof(Register) == CallFrameSlot::codeBlock * sizeof(Register) + SlotSize); 106 STATIC_ASSERT(CallFrameSlot::argumentCount * sizeof(Register) == CallFrameSlot::callee * sizeof(Register) + SlotSize); 107 STATIC_ASSERT(CallFrameSlot::thisArgument * sizeof(Register) == CallFrameSlot::argumentCount * sizeof(Register) + SlotSize); 108 STATIC_ASSERT(CallFrame::headerSizeInRegisters == CallFrameSlot::thisArgument); 109 110 ASSERT(CallFrame::argumentOffsetIncludingThis(0) == CallFrameSlot::thisArgument); 111 111 112 112 #if CPU(BIG_ENDIAN) -
trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
r202992 r203006 1327 1327 1328 1328 execCallee->setArgumentCountIncludingThis(pc[3].u.operand); 1329 execCallee->uncheckedR( JSStack::Callee) = calleeAsValue;1329 execCallee->uncheckedR(CallFrameSlot::callee) = calleeAsValue; 1330 1330 execCallee->setCallerFrame(exec); 1331 1331 … … 1406 1406 1407 1407 execCallee->setCallerFrame(exec); 1408 execCallee->uncheckedR( JSStack::Callee) = calleeAsValue;1408 execCallee->uncheckedR(CallFrameSlot::callee) = calleeAsValue; 1409 1409 exec->setCurrentVPC(pc); 1410 1410 … … 1437 1437 execCallee->setArgumentCountIncludingThis(pc[3].u.operand); 1438 1438 execCallee->setCallerFrame(exec); 1439 execCallee->uncheckedR( JSStack::Callee) = calleeAsValue;1439 execCallee->uncheckedR(CallFrameSlot::callee) = calleeAsValue; 1440 1440 execCallee->setReturnPC(LLInt::getCodePtr(llint_generic_return_point)); 1441 1441 execCallee->setCodeBlock(0); -
trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h
r202157 r203006 61 61 62 62 ASSERT(argumentCountIncludingThis < newCodeBlock->numParameters()); 63 int frameSize = argumentCountIncludingThis + JSStack::CallFrameHeaderSize;63 int frameSize = argumentCountIncludingThis + CallFrame::headerSizeInRegisters; 64 64 int alignedFrameSizeForParameters = WTF::roundUpToMultipleOf(stackAlignmentRegisters(), 65 newCodeBlock->numParameters() + JSStack::CallFrameHeaderSize);65 newCodeBlock->numParameters() + CallFrame::headerSizeInRegisters); 66 66 int paddedStackSpace = alignedFrameSizeForParameters - frameSize; 67 67 -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r202680 r203006 321 321 Base::setStructure(vm, Structure::toCacheableDictionaryTransition(vm, structure())); 322 322 323 JSGlobalObject::globalExec()->init(0, 0, CallFrame::noCaller(), 0, 0);324 325 323 m_debugger = 0; 326 324 … … 332 330 #endif 333 331 334 ExecState* exec = JSGlobalObject::globalExec();335 336 332 m_functionPrototype.set(vm, this, FunctionPrototype::create(vm, FunctionPrototype::createStructure(vm, this, jsNull()))); // The real prototype will be set once ObjectPrototype is created. 337 333 m_calleeStructure.set(vm, this, JSCallee::createStructure(vm, this, jsNull())); … … 339 335 m_globalLexicalEnvironment.set(vm, this, JSGlobalLexicalEnvironment::create(vm, JSGlobalLexicalEnvironment::createStructure(vm, this), this)); 340 336 // Need to create the callee structure (above) before creating the callee. 341 m_globalCallee.set(vm, this, JSCallee::create(vm, this, globalScope())); 342 exec->setCallee(m_globalCallee.get()); 337 JSCallee* globalCallee = JSCallee::create(vm, this, globalScope()); 338 m_globalCallee.set(vm, this, globalCallee); 339 340 ExecState::initGlobalExec(JSGlobalObject::globalExec(), globalCallee); 341 ExecState* exec = JSGlobalObject::globalExec(); 343 342 344 343 m_functionStructure.set(vm, this, JSFunction::createStructure(vm, this, m_functionPrototype.get())); -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r202631 r203006 210 210 template<typename T> using Initializer = typename LazyProperty<JSGlobalObject, T>::Initializer; 211 211 212 Register m_globalCallFrame[ JSStack::CallFrameHeaderSize];212 Register m_globalCallFrame[CallFrame::headerSizeInRegisters]; 213 213 214 214 WriteBarrier<JSObject> m_globalThis; -
trunk/Source/JavaScriptCore/runtime/StackAlignment.h
r163027 r203006 45 45 inline unsigned roundArgumentCountToAlignFrame(unsigned argumentCount) 46 46 { 47 return WTF::roundUpToMultipleOf(stackAlignmentRegisters(), argumentCount + JSStack::CallFrameHeaderSize) - JSStack::CallFrameHeaderSize;47 return WTF::roundUpToMultipleOf(stackAlignmentRegisters(), argumentCount + CallFrame::headerSizeInRegisters) - CallFrame::headerSizeInRegisters; 48 48 } 49 49 50 50 // Align local register count to make the last local end on a stack aligned address given the 51 // CallFrame is at an address that is stack aligned minus JSStack::CallerFrameAndPCSize51 // CallFrame is at an address that is stack aligned minus CallerFrameAndPC::sizeInRegisters 52 52 inline unsigned roundLocalRegisterCountForFramePointerOffset(unsigned localRegisterCount) 53 53 { 54 return WTF::roundUpToMultipleOf(stackAlignmentRegisters(), localRegisterCount + JSStack::CallerFrameAndPCSize) - JSStack::CallerFrameAndPCSize;54 return WTF::roundUpToMultipleOf(stackAlignmentRegisters(), localRegisterCount + CallerFrameAndPC::sizeInRegisters) - CallerFrameAndPC::sizeInRegisters; 55 55 } 56 56 -
trunk/Source/JavaScriptCore/wasm/WASMFunctionCompiler.h
r202992 r203006 131 131 132 132 emitFunctionPrologue(); 133 emitPutToCallFrameHeader(m_codeBlock, JSStack::CodeBlock);133 emitPutToCallFrameHeader(m_codeBlock, CallFrameSlot::codeBlock); 134 134 135 135 m_beginLabel = label(); … … 218 218 Label arityCheck = label(); 219 219 emitFunctionPrologue(); 220 emitPutToCallFrameHeader(m_codeBlock, JSStack::CodeBlock);220 emitPutToCallFrameHeader(m_codeBlock, CallFrameSlot::codeBlock); 221 221 jump(m_beginLabel); 222 222 … … 1348 1348 { 1349 1349 size_t argumentCount = arguments.size(); 1350 int stackOffset = -m_calleeSaveSpace - WTF::roundUpToMultipleOf(stackAlignmentRegisters(), m_numberOfLocals + m_tempStackTop + argumentCount + 1 + JSStack::CallFrameHeaderSize);1350 int stackOffset = -m_calleeSaveSpace - WTF::roundUpToMultipleOf(stackAlignmentRegisters(), m_numberOfLocals + m_tempStackTop + argumentCount + 1 + CallFrame::headerSizeInRegisters); 1351 1351 1352 1352 storeTrustedValue(jsUndefined(), Address(GPRInfo::callFrameRegister, (stackOffset + CallFrame::thisArgumentOffset()) * sizeof(Register))); … … 1385 1385 1386 1386 addPtr(TrustedImm32(stackOffset * sizeof(Register) + sizeof(CallerFrameAndPC)), GPRInfo::callFrameRegister, stackPointerRegister); 1387 store32(TrustedImm32(argumentCount + 1), Address(stackPointerRegister, JSStack::ArgumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset - sizeof(CallerFrameAndPC)));1387 store32(TrustedImm32(argumentCount + 1), Address(stackPointerRegister, CallFrameSlot::argumentCount * static_cast<int>(sizeof(Register)) + PayloadOffset - sizeof(CallerFrameAndPC))); 1388 1388 } 1389 1389 … … 1392 1392 // regT0 holds callee. 1393 1393 #if USE(JSVALUE64) 1394 store64(GPRInfo::regT0, Address(stackPointerRegister, JSStack::Callee * static_cast<int>(sizeof(Register)) - sizeof(CallerFrameAndPC)));1395 #else 1396 store32(GPRInfo::regT0, Address(stackPointerRegister, JSStack::Callee * static_cast<int>(sizeof(Register)) + PayloadOffset - sizeof(CallerFrameAndPC)));1397 store32(TrustedImm32(JSValue::CellTag), Address(stackPointerRegister, JSStack::Callee * static_cast<int>(sizeof(Register)) + TagOffset - sizeof(CallerFrameAndPC)));1394 store64(GPRInfo::regT0, Address(stackPointerRegister, CallFrameSlot::callee * static_cast<int>(sizeof(Register)) - sizeof(CallerFrameAndPC))); 1395 #else 1396 store32(GPRInfo::regT0, Address(stackPointerRegister, CallFrameSlot::callee * static_cast<int>(sizeof(Register)) + PayloadOffset - sizeof(CallerFrameAndPC))); 1397 store32(TrustedImm32(JSValue::CellTag), Address(stackPointerRegister, CallFrameSlot::callee * static_cast<int>(sizeof(Register)) + TagOffset - sizeof(CallerFrameAndPC))); 1398 1398 #endif 1399 1399 -
trunk/Source/JavaScriptCore/wasm/WASMFunctionSyntaxChecker.h
r190144 r203006 271 271 { 272 272 // Boxed arguments + this argument + call frame header + maximum padding. 273 m_tempStackTop += argumentCount + 1 + JSStack::CallFrameHeaderSize+ 1;274 updateTempStackHeight(); 275 m_tempStackTop -= argumentCount + 1 + JSStack::CallFrameHeaderSize+ 1;273 m_tempStackTop += argumentCount + 1 + CallFrame::headerSizeInRegisters + 1; 274 updateTempStackHeight(); 275 m_tempStackTop -= argumentCount + 1 + CallFrame::headerSizeInRegisters + 1; 276 276 } 277 277
Note:
See TracChangeset
for help on using the changeset viewer.