Changeset 203006 in webkit


Ignore:
Timestamp:
Jul 8, 2016, 3:58:15 PM (9 years ago)
Author:
mark.lam@apple.com
Message:

Move CallFrame header info from JSStack.h to CallFrame.h
https://bugs.webkit.org/show_bug.cgi?id=159549

Reviewed by Geoffrey Garen.

CallFrame.h is a much better location for CallFrame header info.

Replaced CallFrame::init() with ExecState::initGlobalExec() because normal
CallFrames are setup by a different mechanism now. Only the globalExec is still
using it. So, might as well change it to be specifically for the globalExec.

Removed the use of JSStack::containsAddress() in ExecState::initGlobalExec()
because it is not relevant to the globalExec.

Also removed some unused code: JSStack::gatherConservativeRoots() and
JSStack::sanitizeStack() is never called for JIT builds.

  • bytecode/PolymorphicAccess.cpp:

(JSC::AccessCase::generateImpl):

  • bytecode/VirtualRegister.h:

(JSC::VirtualRegister::isValid):
(JSC::VirtualRegister::isLocal):
(JSC::VirtualRegister::isArgument):
(JSC::VirtualRegister::isHeader):
(JSC::VirtualRegister::isConstant):
(JSC::VirtualRegister::toLocal):
(JSC::VirtualRegister::toArgument):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::emitCall):
(JSC::BytecodeGenerator::emitConstruct):

  • bytecompiler/BytecodeGenerator.h:

(JSC::CallArguments::thisRegister):
(JSC::CallArguments::argumentRegister):
(JSC::CallArguments::stackOffset):
(JSC::CallArguments::argumentCountIncludingThis):
(JSC::CallArguments::argumentsNode):
(JSC::BytecodeGenerator::registerFor):

  • bytecompiler/NodesCodegen.cpp:

(JSC::emitHomeObjectForCallee):
(JSC::emitGetSuperFunctionForConstruct):
(JSC::CallArguments::CallArguments):

  • dfg/DFGArgumentsEliminationPhase.cpp:
  • dfg/DFGArgumentsUtilities.cpp:

(JSC::DFG::argumentsInvolveStackSlot):
(JSC::DFG::emitCodeToGetArgumentsArrayLength):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::get):
(JSC::DFG::ByteCodeParser::findArgumentPositionForLocal):
(JSC::DFG::ByteCodeParser::flush):
(JSC::DFG::ByteCodeParser::addCallWithoutSettingResult):
(JSC::DFG::ByteCodeParser::getArgumentCount):
(JSC::DFG::ByteCodeParser::inlineCall):
(JSC::DFG::ByteCodeParser::handleInlining):
(JSC::DFG::ByteCodeParser::handleGetById):
(JSC::DFG::ByteCodeParser::handlePutById):
(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):

  • dfg/DFGClobberize.h:

(JSC::DFG::clobberize):

  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::isLiveInBytecode):

  • dfg/DFGGraph.h:

(JSC::DFG::Graph::forAllLocalsLiveInBytecode):

  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::compileEntry):
(JSC::DFG::JITCompiler::compileSetupRegistersForEntry):
(JSC::DFG::JITCompiler::compileFunction):

  • dfg/DFGJITCompiler.h:

(JSC::DFG::JITCompiler::emitStoreCallSiteIndex):

  • dfg/DFGOSRAvailabilityAnalysisPhase.cpp:

(JSC::DFG::LocalOSRAvailabilityCalculator::executeNode):

  • dfg/DFGOSREntry.cpp:

(JSC::DFG::prepareOSREntry):

  • dfg/DFGOSRExitCompiler.cpp:

(JSC::DFG::OSRExitCompiler::emitRestoreArguments):

  • dfg/DFGOSRExitCompilerCommon.cpp:

(JSC::DFG::reifyInlinedCallFrames):

  • dfg/DFGOSRExitCompilerCommon.h:

(JSC::DFG::adjustFrameAndStackInOSRExitCompilerThunk):

  • dfg/DFGPreciseLocalClobberize.h:

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

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::emitGetLength):
(JSC::DFG::SpeculativeJIT::emitGetCallee):
(JSC::DFG::SpeculativeJIT::emitGetArgumentStart):
(JSC::DFG::SpeculativeJIT::compileCreateDirectArguments):

  • dfg/DFGSpeculativeJIT32_64.cpp:

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

  • dfg/DFGSpeculativeJIT64.cpp:

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

  • dfg/DFGStackLayoutPhase.cpp:

(JSC::DFG::StackLayoutPhase::run):

  • dfg/DFGThunks.cpp:

(JSC::DFG::osrEntryThunkGenerator):

  • ftl/FTLLink.cpp:

(JSC::FTL::link):

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::lower):
(JSC::FTL::DFG::LowerDFGToB3::compileGetMyArgumentByVal):
(JSC::FTL::DFG::LowerDFGToB3::compileGetCallee):
(JSC::FTL::DFG::LowerDFGToB3::compileGetArgumentCountIncludingThis):
(JSC::FTL::DFG::LowerDFGToB3::compileGetScope):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::compileLogShadowChickenPrologue):
(JSC::FTL::DFG::LowerDFGToB3::getArgumentsLength):
(JSC::FTL::DFG::LowerDFGToB3::getCurrentCallee):
(JSC::FTL::DFG::LowerDFGToB3::getArgumentsStart):
(JSC::FTL::DFG::LowerDFGToB3::callPreflight):

  • ftl/FTLOSRExitCompiler.cpp:

(JSC::FTL::compileStub):

  • ftl/FTLSlowPathCall.h:

(JSC::FTL::callOperation):

  • interpreter/CallFrame.cpp:

(JSC::ExecState::initGlobalExec):
(JSC::CallFrame::callSiteBitsAreBytecodeOffset):
(JSC::CallFrame::callSiteAsRawBits):
(JSC::CallFrame::unsafeCallSiteAsRawBits):
(JSC::CallFrame::callSiteIndex):
(JSC::CallFrame::setCurrentVPC):
(JSC::CallFrame::callSiteBitsAsBytecodeOffset):

  • interpreter/CallFrame.h:

(JSC::CallSiteIndex::CallSiteIndex):
(JSC::ExecState::calleeAsValue):
(JSC::ExecState::callee):
(JSC::ExecState::unsafeCallee):
(JSC::ExecState::codeBlock):
(JSC::ExecState::unsafeCodeBlock):
(JSC::ExecState::scope):
(JSC::ExecState::setCallerFrame):
(JSC::ExecState::setScope):
(JSC::ExecState::argumentCount):
(JSC::ExecState::argumentCountIncludingThis):
(JSC::ExecState::argumentOffset):
(JSC::ExecState::argumentOffsetIncludingThis):
(JSC::ExecState::offsetFor):
(JSC::ExecState::noCaller):
(JSC::ExecState::setArgumentCountIncludingThis):
(JSC::ExecState::setCallee):
(JSC::ExecState::setCodeBlock):
(JSC::ExecState::setReturnPC):
(JSC::ExecState::argIndexForRegister):
(JSC::ExecState::callerFrameAndPC):
(JSC::ExecState::unsafeCallerFrameAndPC):
(JSC::ExecState::init): Deleted.

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::dumpRegisters):

  • interpreter/Interpreter.h:

(JSC::calleeFrameForVarargs):

  • interpreter/JSStack.h:

(JSC::JSStack::containsAddress):
(JSC::JSStack::gatherConservativeRoots): Deleted.
(JSC::JSStack::sanitizeStack): Deleted.

  • jit/AssemblyHelpers.cpp:

(JSC::AssemblyHelpers::jitAssertArgumentCountSane):
(JSC::AssemblyHelpers::emitRandomThunk):

  • jit/AssemblyHelpers.h:

(JSC::AssemblyHelpers::restoreReturnAddressBeforeReturn):
(JSC::AssemblyHelpers::emitGetFromCallFrameHeaderPtr):
(JSC::AssemblyHelpers::emitGetFromCallFrameHeader32):
(JSC::AssemblyHelpers::emitGetFromCallFrameHeader64):
(JSC::AssemblyHelpers::emitPutToCallFrameHeader):
(JSC::AssemblyHelpers::emitPutToCallFrameHeaderBeforePrologue):
(JSC::AssemblyHelpers::emitPutPayloadToCallFrameHeaderBeforePrologue):
(JSC::AssemblyHelpers::emitPutTagToCallFrameHeaderBeforePrologue):
(JSC::AssemblyHelpers::calleeFrameSlot):

  • jit/CCallHelpers.cpp:

(JSC::CCallHelpers::logShadowChickenProloguePacket):

  • jit/CCallHelpers.h:

(JSC::CCallHelpers::prepareForTailCallSlow):

  • jit/CallFrameShuffler.cpp:

(JSC::CallFrameShuffler::CallFrameShuffler):
(JSC::CallFrameShuffler::dump):
(JSC::CallFrameShuffler::extendFrameIfNeeded):
(JSC::CallFrameShuffler::prepareForSlowPath):
(JSC::CallFrameShuffler::prepareForTailCall):
(JSC::CallFrameShuffler::prepareAny):

  • jit/CallFrameShuffler.h:

(JSC::CallFrameShuffler::snapshot):
(JSC::CallFrameShuffler::setCalleeJSValueRegs):
(JSC::CallFrameShuffler::assumeCalleeIsCell):
(JSC::CallFrameShuffler::numLocals):
(JSC::CallFrameShuffler::getOld):
(JSC::CallFrameShuffler::setOld):
(JSC::CallFrameShuffler::firstOld):
(JSC::CallFrameShuffler::lastOld):
(JSC::CallFrameShuffler::isValidOld):
(JSC::CallFrameShuffler::argCount):
(JSC::CallFrameShuffler::getNew):

  • jit/JIT.cpp:

(JSC::JIT::compileWithoutLinking):

  • jit/JIT.h:
  • jit/JITCall.cpp:

(JSC::JIT::compileSetupVarargsFrame):
(JSC::JIT::compileCallEvalSlowCase):
(JSC::JIT::compileOpCall):

  • jit/JITCall32_64.cpp:

(JSC::JIT::compileSetupVarargsFrame):
(JSC::JIT::compileCallEvalSlowCase):
(JSC::JIT::compileOpCall):

  • jit/JITInlines.h:

(JSC::JIT::getConstantOperand):
(JSC::JIT::emitPutIntToCallFrameHeader):
(JSC::JIT::updateTopCallFrame):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_get_scope):
(JSC::JIT::emit_op_argument_count):
(JSC::JIT::emit_op_get_rest_length):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::privateCompileCTINativeCall):
(JSC::JIT::emit_op_get_scope):

  • jit/JSInterfaceJIT.h:

(JSC::JSInterfaceJIT::emitJumpIfNotType):
(JSC::JSInterfaceJIT::emitGetFromCallFrameHeaderPtr):
(JSC::JSInterfaceJIT::emitPutToCallFrameHeader):
(JSC::JSInterfaceJIT::emitPutCellToCallFrameHeader):

  • jit/SetupVarargsFrame.cpp:

(JSC::emitSetVarargsFrame):
(JSC::emitSetupVarargsFrameFastCase):

  • jit/SpecializedThunkJIT.h:

(JSC::SpecializedThunkJIT::SpecializedThunkJIT):

  • jit/ThunkGenerators.cpp:

(JSC::nativeForGenerator):
(JSC::arityFixupGenerator):
(JSC::boundThisNoArgsFunctionCallGenerator):

  • llint/LLIntData.cpp:

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

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::genericCall):
(JSC::LLInt::varargsSetup):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • runtime/CommonSlowPaths.h:

(JSC::CommonSlowPaths::arityCheckFor):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::init):

  • runtime/JSGlobalObject.h:
  • runtime/StackAlignment.h:

(JSC::roundArgumentCountToAlignFrame):
(JSC::roundLocalRegisterCountForFramePointerOffset):
(JSC::logStackAlignmentRegisters):

  • wasm/WASMFunctionCompiler.h:

(JSC::WASMFunctionCompiler::startFunction):
(JSC::WASMFunctionCompiler::endFunction):
(JSC::WASMFunctionCompiler::boxArgumentsAndAdjustStackPointer):
(JSC::WASMFunctionCompiler::callAndUnboxResult):

  • wasm/WASMFunctionSyntaxChecker.h:

(JSC::WASMFunctionSyntaxChecker::updateTempStackHeightForCall):

Location:
trunk/Source/JavaScriptCore
Files:
59 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r203004 r203006  
     12016-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
    12552016-07-08  Chris Dumez  <cdumez@apple.com>
    2256
  • trunk/Source/JavaScriptCore/bytecode/PolymorphicAccess.cpp

    r202214 r203006  
    948948        jit.store32(
    949949            CCallHelpers::TrustedImm32(state.callSiteIndexForExceptionHandlingOrOriginal().bits()),
    950             CCallHelpers::tagFor(static_cast<VirtualRegister>(JSStack::ArgumentCount)));
     950            CCallHelpers::tagFor(static_cast<VirtualRegister>(CallFrameSlot::argumentCount)));
    951951
    952952        if (m_type == Getter || m_type == Setter) {
     
    10031003                CCallHelpers::Zero, loadedValueGPR);
    10041004
    1005             unsigned numberOfRegsForCall = JSStack::CallFrameHeaderSize + numberOfParameters;
     1005            unsigned numberOfRegsForCall = CallFrame::headerSizeInRegisters + numberOfParameters;
    10061006
    10071007            unsigned numberOfBytesForCall =
     
    10211021            jit.store32(
    10221022                CCallHelpers::TrustedImm32(numberOfParameters),
    1023                 calleeFrame.withOffset(JSStack::ArgumentCount * sizeof(Register) + PayloadOffset));
     1023                calleeFrame.withOffset(CallFrameSlot::argumentCount * sizeof(Register) + PayloadOffset));
    10241024
    10251025            jit.storeCell(
    1026                 loadedValueGPR, calleeFrame.withOffset(JSStack::Callee * sizeof(Register)));
     1026                loadedValueGPR, calleeFrame.withOffset(CallFrameSlot::callee * sizeof(Register)));
    10271027
    10281028            jit.storeCell(
     
    12611261                    CCallHelpers::TrustedImm32(
    12621262                        state.callSiteIndexForExceptionHandlingOrOriginal().bits()),
    1263                     CCallHelpers::tagFor(static_cast<VirtualRegister>(JSStack::ArgumentCount)));
     1263                    CCallHelpers::tagFor(static_cast<VirtualRegister>(CallFrameSlot::argumentCount)));
    12641264               
    12651265                jit.makeSpaceOnStackForCCall();
  • trunk/Source/JavaScriptCore/bytecode/VirtualRegister.h

    r183207 r203006  
    11/*
    2  * Copyright (C) 2011, 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2011, 2015-2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    6060    bool isLocal() const { return operandIsLocal(m_virtualRegister); }
    6161    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; }
    6363    bool isConstant() const { return m_virtualRegister >= s_firstConstantRegisterIndex; }
    6464    int toLocal() const { ASSERT(isLocal()); return operandToLocal(m_virtualRegister); }
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r202846 r203006  
    307307    allocateAndEmitScope();
    308308
    309     m_calleeRegister.setIndex(JSStack::Callee);
     309    m_calleeRegister.setIndex(CallFrameSlot::callee);
    310310
    311311    initializeParameters(parameters);
     
    743743    allocateAndEmitScope();
    744744
    745     m_calleeRegister.setIndex(JSStack::Callee);
     745    m_calleeRegister.setIndex(CallFrameSlot::callee);
    746746
    747747    m_codeBlock->setNumParameters(1); // Allocate space for "this"
     
    31313131   
    31323132    // 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)
    31353135        callFrame.append(newTemporary());
    31363136
     
    33163316
    33173317    // 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)
    33203320        callFrame.append(newTemporary());
    33213321
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h

    r202778 r203006  
    7474        RegisterID* thisRegister() { return m_argv[0].get(); }
    7575        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; }
    7777        unsigned argumentCountIncludingThis() { return m_argv.size() - m_padding; }
    7878        ArgumentsNode* argumentsNode() { return m_argumentsNode; }
     
    810810                return m_calleeLocals[reg.toLocal()];
    811811
    812             if (reg.offset() == JSStack::Callee)
     812            if (reg.offset() == CallFrameSlot::callee)
    813813                return m_calleeRegister;
    814814
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r202680 r203006  
    166166
    167167    RegisterID callee;
    168     callee.setIndex(JSStack::Callee);
     168    callee.setIndex(CallFrameSlot::callee);
    169169    return generator.emitGetById(generator.newTemporary(), &callee, generator.propertyNames().builtinNames().homeObjectPrivateName());
    170170}
     
    182182
    183183    RegisterID callee;
    184     callee.setIndex(JSStack::Callee);
     184    callee.setIndex(CallFrameSlot::callee);
    185185    return generator.emitGetById(generator.newTemporary(), &callee, generator.propertyNames().underscoreProto);
    186186}
     
    725725
    726726    // 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()) {
    728728        m_argv.insert(0, generator.newTemporary());
    729729        m_padding++;
  • trunk/Source/JavaScriptCore/dfg/DFGArgumentsEliminationPhase.cpp

    r202003 r203006  
    304304                        if (inlineCallFrame->isVarargs()) {
    305305                            isClobberedByBlock |= clobberedByThisBlock.operand(
    306                                 inlineCallFrame->stackOffset + JSStack::ArgumentCount);
     306                                inlineCallFrame->stackOffset + CallFrameSlot::argumentCount);
    307307                        }
    308308                       
    309309                        if (!isClobberedByBlock || inlineCallFrame->isClosureCall) {
    310310                            isClobberedByBlock |= clobberedByThisBlock.operand(
    311                                 inlineCallFrame->stackOffset + JSStack::Callee);
     311                                inlineCallFrame->stackOffset + CallFrameSlot::callee);
    312312                        }
    313313                       
  • trunk/Source/JavaScriptCore/dfg/DFGArgumentsUtilities.cpp

    r201668 r203006  
    3939   
    4040    if (inlineCallFrame->isClosureCall
    41         && reg == VirtualRegister(inlineCallFrame->stackOffset + JSStack::Callee))
     41        && reg == VirtualRegister(inlineCallFrame->stackOffset + CallFrameSlot::callee))
    4242        return true;
    4343   
    4444    if (inlineCallFrame->isVarargs()
    45         && reg == VirtualRegister(inlineCallFrame->stackOffset + JSStack::ArgumentCount))
     45        && reg == VirtualRegister(inlineCallFrame->stackOffset + CallFrameSlot::argumentCount))
    4646        return true;
    4747   
     
    7979        argumentCount = insertionSet.insertNode(nodeIndex, SpecInt32Only, GetArgumentCountIncludingThis, origin);
    8080    else {
    81         VirtualRegister argumentCountRegister(inlineCallFrame->stackOffset + JSStack::ArgumentCount);
     81        VirtualRegister argumentCountRegister(inlineCallFrame->stackOffset + CallFrameSlot::argumentCount);
    8282       
    8383        argumentCount = insertionSet.insertNode(
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r202680 r203006  
    332332            if (!inlineCallFrame()->isClosureCall) {
    333333                JSFunction* callee = inlineCallFrame()->calleeConstant();
    334                 if (operand.offset() == JSStack::Callee)
     334                if (operand.offset() == CallFrameSlot::callee)
    335335                    return weakJSConstant(callee);
    336336            }
    337         } else if (operand.offset() == JSStack::Callee) {
     337        } else if (operand.offset() == CallFrameSlot::callee) {
    338338            // We have to do some constant-folding here because this enables CreateThis folding. Note
    339339            // that we don't have such watchpoint-based folding for inlined uses of Callee, since in that
     
    543543            if (!inlineCallFrame)
    544544                break;
    545             if (operand.offset() < static_cast<int>(inlineCallFrame->stackOffset + JSStack::CallFrameHeaderSize))
     545            if (operand.offset() < static_cast<int>(inlineCallFrame->stackOffset + CallFrame::headerSizeInRegisters))
    546546                continue;
    547547            if (operand.offset() == inlineCallFrame->stackOffset + CallFrame::thisArgumentOffset())
     
    598598            numArguments = inlineCallFrame->arguments.size();
    599599            if (inlineCallFrame->isClosureCall)
    600                 flushDirect(inlineStackEntry->remapOperand(VirtualRegister(JSStack::Callee)));
     600                flushDirect(inlineStackEntry->remapOperand(VirtualRegister(CallFrameSlot::callee)));
    601601            if (inlineCallFrame->isVarargs())
    602                 flushDirect(inlineStackEntry->remapOperand(VirtualRegister(JSStack::ArgumentCount)));
     602                flushDirect(inlineStackEntry->remapOperand(VirtualRegister(CallFrameSlot::argumentCount)));
    603603        } else
    604604            numArguments = inlineStackEntry->m_codeBlock->numParameters();
     
    767767    {
    768768        addVarArgChild(callee);
    769         size_t frameSize = JSStack::CallFrameHeaderSize + argCount;
     769        size_t frameSize = CallFrame::headerSizeInRegisters + argCount;
    770770        size_t alignedFrameSize = WTF::roundUpToMultipleOf(stackAlignmentRegisters(), frameSize);
    771         size_t parameterSlots = alignedFrameSize - JSStack::CallerFrameAndPCSize;
     771        size_t parameterSlots = alignedFrameSize - CallerFrameAndPC::sizeInRegisters;
    772772
    773773        if (parameterSlots > m_parameterSlots)
     
    13381338    if (m_inlineStackTop->m_inlineCallFrame) {
    13391339        if (m_inlineStackTop->m_inlineCallFrame->isVarargs())
    1340             argumentCount = get(VirtualRegister(JSStack::ArgumentCount));
     1340            argumentCount = get(VirtualRegister(CallFrameSlot::argumentCount));
    13411341        else
    13421342            argumentCount = jsConstant(m_graph.freeze(jsNumber(m_inlineStackTop->m_inlineCallFrame->arguments.size()))->value());
     
    14731473    // FIXME: Don't flush constants!
    14741474   
    1475     int inlineCallFrameStart = m_inlineStackTop->remapOperand(VirtualRegister(registerOffset)).offset() + JSStack::CallFrameHeaderSize;
     1475    int inlineCallFrameStart = m_inlineStackTop->remapOperand(VirtualRegister(registerOffset)).offset() + CallFrame::headerSizeInRegisters;
    14761476   
    14771477    ensureLocals(
    14781478        VirtualRegister(inlineCallFrameStart).toLocal() + 1 +
    1479         JSStack::CallFrameHeaderSize + codeBlock->m_numCalleeLocals);
     1479        CallFrame::headerSizeInRegisters + codeBlock->m_numCalleeLocals);
    14801480   
    14811481    size_t argumentPositionStart = m_graph.m_argumentPositions.size();
     
    14881488    if (callee.isClosureCall()) {
    14891489        Node* calleeSet = set(
    1490             VirtualRegister(registerOffset + JSStack::Callee), callTargetNode, ImmediateNakedSet);
     1490            VirtualRegister(registerOffset + CallFrameSlot::callee), callTargetNode, ImmediateNakedSet);
    14911491       
    14921492        calleeVariable = calleeSet->variableAccessData();
     
    17471747            registerOffset = registerOffsetOrFirstFreeReg + 1;
    17481748            registerOffset -= maxNumArguments; // includes "this"
    1749             registerOffset -= JSStack::CallFrameHeaderSize;
     1749            registerOffset -= CallFrame::headerSizeInRegisters;
    17501750            registerOffset = -WTF::roundUpToMultipleOf(
    17511751                stackAlignmentRegisters(),
     
    17671767                    ensureLocals(VirtualRegister(remappedRegisterOffset).toLocal());
    17681768                   
    1769                     int argumentStart = registerOffset + JSStack::CallFrameHeaderSize;
     1769                    int argumentStart = registerOffset + CallFrame::headerSizeInRegisters;
    17701770                    int remappedArgumentStart =
    17711771                        m_inlineStackTop->remapOperand(VirtualRegister(argumentStart)).offset();
     
    17731773                    LoadVarargsData* data = m_graph.m_loadVarargsData.add();
    17741774                    data->start = VirtualRegister(remappedArgumentStart + 1);
    1775                     data->count = VirtualRegister(remappedRegisterOffset + JSStack::ArgumentCount);
     1775                    data->count = VirtualRegister(remappedRegisterOffset + CallFrameSlot::argumentCount);
    17761776                    data->offset = argumentsOffset;
    17771777                    data->limit = maxNumArguments;
     
    17941794           
    17951795                    VariableAccessData* countVariable = newVariableAccessData(
    1796                         VirtualRegister(remappedRegisterOffset + JSStack::ArgumentCount));
     1796                        VirtualRegister(remappedRegisterOffset + CallFrameSlot::argumentCount));
    17971797                    // This is pretty lame, but it will force the count to be flushed as an int. This doesn't
    17981798                    // matter very much, since our use of a SetArgument and Flushes for this local slot is
     
    19051905    if (verbose)
    19061906        dataLog("Register offset: ", registerOffset);
    1907     VirtualRegister calleeReg(registerOffset + JSStack::Callee);
     1907    VirtualRegister calleeReg(registerOffset + CallFrameSlot::callee);
    19081908    calleeReg = m_inlineStackTop->remapOperand(calleeReg);
    19091909    if (verbose)
     
    32723272        m_inlineStackTop->m_profiledBlock->m_numCalleeLocals - 1).offset();
    32733273    registerOffset -= numberOfParameters;
    3274     registerOffset -= JSStack::CallFrameHeaderSize;
     3274    registerOffset -= CallFrame::headerSizeInRegisters;
    32753275   
    32763276    // Get the alignment right.
     
    32893289    //    since we only really care about 'this' in this case. But we're not going to take that
    32903290    //    shortcut.
    3291     int nextRegister = registerOffset + JSStack::CallFrameHeaderSize;
     3291    int nextRegister = registerOffset + CallFrame::headerSizeInRegisters;
    32923292    set(VirtualRegister(nextRegister++), base, ImmediateNakedSet);
    32933293
     
    34413441            m_inlineStackTop->m_profiledBlock->m_numCalleeLocals - 1).offset();
    34423442        registerOffset -= numberOfParameters;
    3443         registerOffset -= JSStack::CallFrameHeaderSize;
     3443        registerOffset -= CallFrame::headerSizeInRegisters;
    34443444   
    34453445        // Get the alignment right.
     
    34523452                VirtualRegister(registerOffset)).toLocal());
    34533453   
    3454         int nextRegister = registerOffset + JSStack::CallFrameHeaderSize;
     3454        int nextRegister = registerOffset + CallFrame::headerSizeInRegisters;
    34553455        set(VirtualRegister(nextRegister++), base, ImmediateNakedSet);
    34563456        set(VirtualRegister(nextRegister++), value, ImmediateNakedSet);
     
    49734973            // loads from the scope register later, as that would prevent the DFG from tracking the
    49744974            // bytecode-level liveness of the scope register.
    4975             Node* callee = get(VirtualRegister(JSStack::Callee));
     4975            Node* callee = get(VirtualRegister(CallFrameSlot::callee));
    49764976            Node* result;
    49774977            if (JSFunction* function = callee->dynamicCastConstant<JSFunction*>())
     
    52845284        // plan finishes.
    52855285        m_inlineCallFrame->baselineCodeBlock.setWithoutWriteBarrier(codeBlock->baselineVersion());
    5286         m_inlineCallFrame->setStackOffset(inlineCallFrameStart.offset() - JSStack::CallFrameHeaderSize);
     5286        m_inlineCallFrame->setStackOffset(inlineCallFrameStart.offset() - CallFrame::headerSizeInRegisters);
    52875287        if (callee) {
    52885288            m_inlineCallFrame->calleeRecovery = ValueRecovery::constant(callee);
  • trunk/Source/JavaScriptCore/dfg/DFGClobberize.h

    r202680 r203006  
    114114    for (InlineCallFrame* inlineCallFrame = node->origin.semantic.inlineCallFrame; inlineCallFrame; inlineCallFrame = inlineCallFrame->directCaller.inlineCallFrame) {
    115115        if (inlineCallFrame->isClosureCall)
    116             read(AbstractHeap(Stack, inlineCallFrame->stackOffset + JSStack::Callee));
     116            read(AbstractHeap(Stack, inlineCallFrame->stackOffset + CallFrameSlot::callee));
    117117        if (inlineCallFrame->isVarargs())
    118             read(AbstractHeap(Stack, inlineCallFrame->stackOffset + JSStack::ArgumentCount));
     118            read(AbstractHeap(Stack, inlineCallFrame->stackOffset + CallFrameSlot::argumentCount));
    119119    }
    120120
     
    502502       
    503503    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));
    506506        return;
    507507       
    508508    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));
    511511        return;
    512512
  • trunk/Source/JavaScriptCore/dfg/DFGGraph.cpp

    r202512 r203006  
    10131013            dataLog("reg = ", reg, "\n");
    10141014       
    1015         if (operand.offset() < codeOriginPtr->stackOffset() + JSStack::CallFrameHeaderSize) {
     1015        if (operand.offset() < codeOriginPtr->stackOffset() + CallFrame::headerSizeInRegisters) {
    10161016            if (reg.isArgument()) {
    1017                 RELEASE_ASSERT(reg.offset() < JSStack::CallFrameHeaderSize);
     1017                RELEASE_ASSERT(reg.offset() < CallFrame::headerSizeInRegisters);
    10181018               
    10191019                if (codeOriginPtr->inlineCallFrame->isClosureCall
    1020                     && reg.offset() == JSStack::Callee) {
     1020                    && reg.offset() == CallFrameSlot::callee) {
    10211021                    if (verbose)
    10221022                        dataLog("Looks like a callee.\n");
     
    10251025               
    10261026                if (codeOriginPtr->inlineCallFrame->isVarargs()
    1027                     && reg.offset() == JSStack::ArgumentCount) {
     1027                    && reg.offset() == CallFrameSlot::argumentCount) {
    10281028                    if (verbose)
    10291029                        dataLog("Looks like the argument count.\n");
  • trunk/Source/JavaScriptCore/dfg/DFGGraph.h

    r201584 r203006  
    710710            if (inlineCallFrame) {
    711711                if (inlineCallFrame->isClosureCall)
    712                     functor(stackOffset + JSStack::Callee);
     712                    functor(stackOffset + CallFrameSlot::callee);
    713713                if (inlineCallFrame->isVarargs())
    714                     functor(stackOffset + JSStack::ArgumentCount);
     714                    functor(stackOffset + CallFrameSlot::argumentCount);
    715715            }
    716716           
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp

    r202992 r203006  
    109109    // both normal return code and when jumping to an exception handler).
    110110    emitFunctionPrologue();
    111     emitPutToCallFrameHeader(m_codeBlock, JSStack::CodeBlock);
     111    emitPutToCallFrameHeader(m_codeBlock, CallFrameSlot::codeBlock);
    112112}
    113113
     
    444444    compileEntry();
    445445
    446     load32(AssemblyHelpers::payloadFor((VirtualRegister)JSStack::ArgumentCount), GPRInfo::regT1);
     446    load32(AssemblyHelpers::payloadFor((VirtualRegister)CallFrameSlot::argumentCount), GPRInfo::regT1);
    447447    branch32(AboveOrEqual, GPRInfo::regT1, TrustedImm32(m_codeBlock->numParameters())).linkTo(fromArityCheck, this);
    448448    emitStoreCodeOrigin(CodeOrigin(0));
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.h

    r200981 r203006  
    157157    void emitStoreCallSiteIndex(CallSiteIndex callSite)
    158158    {
    159         store32(TrustedImm32(callSite.bits()), tagFor(static_cast<VirtualRegister>(JSStack::ArgumentCount)));
     159        store32(TrustedImm32(callSite.bits()), tagFor(static_cast<VirtualRegister>(CallFrameSlot::argumentCount)));
    160160    }
    161161
  • trunk/Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.cpp

    r198364 r203006  
    178178            // Record how to read each argument and the argument count.
    179179            Availability argumentCount =
    180                 m_availability.m_locals.operand(inlineCallFrame->stackOffset + JSStack::ArgumentCount);
     180                m_availability.m_locals.operand(inlineCallFrame->stackOffset + CallFrameSlot::argumentCount);
    181181           
    182182            m_availability.m_heap.set(PromotedHeapLocation(ArgumentCountPLoc, node), argumentCount);
     
    185185        if (inlineCallFrame->isClosureCall) {
    186186            Availability callee = m_availability.m_locals.operand(
    187                 inlineCallFrame->stackOffset + JSStack::Callee);
     187                inlineCallFrame->stackOffset + CallFrameSlot::callee);
    188188            m_availability.m_heap.set(PromotedHeapLocation(ArgumentsCalleePLoc, node), callee);
    189189        }
  • trunk/Source/JavaScriptCore/dfg/DFGOSREntry.cpp

    r200879 r203006  
    265265    unsigned maxFrameSize = std::max(frameSize, baselineFrameSize);
    266266
    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());
    268268   
    269269    *bitwise_cast<size_t*>(scratch + 0) = frameSize;
     
    275275    *bitwise_cast<void**>(scratch + 1) = targetPC;
    276276   
    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) {
    280280        VirtualRegister reg(-1 - index);
    281281       
     
    330330    // 7) Fix the call frame to have the right code block.
    331331   
    332     *bitwise_cast<CodeBlock**>(pivot - 1 - JSStack::CodeBlock) = codeBlock;
     332    *bitwise_cast<CodeBlock**>(pivot - 1 - CallFrameSlot::codeBlock) = codeBlock;
    333333   
    334334    if (Options::verboseOSR())
  • trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp

    r200879 r203006  
    7171        if (!inlineCallFrame || inlineCallFrame->isClosureCall) {
    7272            m_jit.loadPtr(
    73                 AssemblyHelpers::addressFor(stackOffset + JSStack::Callee),
     73                AssemblyHelpers::addressFor(stackOffset + CallFrameSlot::callee),
    7474                GPRInfo::regT0);
    7575        } else {
     
    8181        if (!inlineCallFrame || inlineCallFrame->isVarargs()) {
    8282            m_jit.load32(
    83                 AssemblyHelpers::payloadFor(stackOffset + JSStack::ArgumentCount),
     83                AssemblyHelpers::payloadFor(stackOffset + CallFrameSlot::argumentCount),
    8484                GPRInfo::regT1);
    8585        } else {
  • trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp

    r202214 r203006  
    145145    // https://bugs.webkit.org/show_bug.cgi?id=147511
    146146    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));
    148148
    149149    const CodeOrigin* codeOrigin;
     
    206206        }
    207207
    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)));
    209209
    210210        // Restore the inline call frame's callee save registers.
     
    218218
    219219        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)));
    221221#if USE(JSVALUE64)
    222222        jit.store64(callerFrameGPR, AssemblyHelpers::addressForByteOffset(inlineCallFrame->callerFrameOffset()));
    223223        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)));
    225225        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)));
    227227#else // USE(JSVALUE64) // so this is the 32-bit part
    228228        jit.storePtr(callerFrameGPR, AssemblyHelpers::addressForByteOffset(inlineCallFrame->callerFrameOffset()));
    229229        Instruction* instruction = baselineCodeBlock->instructions().begin() + codeOrigin->bytecodeIndex;
    230230        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)));
    233233        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)));
    235235#endif // USE(JSVALUE64) // ending the #else part, so directly above is the 32-bit part
    236236    }
     
    244244        uint32_t locationBits = CallSiteIndex(instruction).bits();
    245245#endif
    246         jit.store32(AssemblyHelpers::TrustedImm32(locationBits), AssemblyHelpers::tagFor((VirtualRegister)(JSStack::ArgumentCount)));
     246        jit.store32(AssemblyHelpers::TrustedImm32(locationBits), AssemblyHelpers::tagFor((VirtualRegister)(CallFrameSlot::argumentCount)));
    247247    }
    248248}
  • trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.h

    r195831 r203006  
    8787    didNotHaveException.link(&jit);
    8888    // 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);
    9090    jit.loadPtr(MacroAssembler::Address(GPRInfo::regT0, CodeBlock::jitCodeOffset()), GPRInfo::regT0);
    9191    jit.addPtr(MacroAssembler::TrustedImm32(JITCodeType::commonDataOffset()), GPRInfo::regT0);
  • trunk/Source/JavaScriptCore/dfg/DFGPreciseLocalClobberize.h

    r202003 r203006  
    126126                for (unsigned i = m_graph.m_codeBlock->numParameters(); i-- > 1;)
    127127                    m_read(virtualRegisterForArgument(i));
    128                 m_read(VirtualRegister(JSStack::ArgumentCount));
     128                m_read(VirtualRegister(CallFrameSlot::argumentCount));
    129129                break;
    130130            }
     
    133133                m_read(VirtualRegister(inlineCallFrame->stackOffset + virtualRegisterForArgument(i).offset()));
    134134            if (inlineCallFrame->isVarargs())
    135                 m_read(VirtualRegister(inlineCallFrame->stackOffset + JSStack::ArgumentCount));
     135                m_read(VirtualRegister(inlineCallFrame->stackOffset + CallFrameSlot::argumentCount));
    136136            break;
    137137        }
     
    143143       
    144144            // The stack header is read.
    145             for (unsigned i = 0; i < JSStack::ThisArgument; ++i)
     145            for (unsigned i = 0; i < CallFrameSlot::thisArgument; ++i)
    146146                m_read(VirtualRegister(i));
    147147       
     
    151151                    m_read(VirtualRegister(inlineCallFrame->stackOffset + virtualRegisterForArgument(i).offset()));
    152152                if (inlineCallFrame->isClosureCall)
    153                     m_read(VirtualRegister(inlineCallFrame->stackOffset + JSStack::Callee));
     153                    m_read(VirtualRegister(inlineCallFrame->stackOffset + CallFrameSlot::callee));
    154154                if (inlineCallFrame->isVarargs())
    155                     m_read(VirtualRegister(inlineCallFrame->stackOffset + JSStack::ArgumentCount));
     155                    m_read(VirtualRegister(inlineCallFrame->stackOffset + CallFrameSlot::argumentCount));
    156156            }
    157157            break;
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r202982 r203006  
    153153        VirtualRegister argumentCountRegister;
    154154        if (!inlineCallFrame)
    155             argumentCountRegister = VirtualRegister(JSStack::ArgumentCount);
     155            argumentCountRegister = VirtualRegister(CallFrameSlot::argumentCount);
    156156        else
    157157            argumentCountRegister = inlineCallFrame->argumentCountRegister;
     
    180180        }
    181181    } else
    182         m_jit.loadPtr(JITCompiler::addressFor(JSStack::Callee), calleeGPR);
     182        m_jit.loadPtr(JITCompiler::addressFor(CallFrameSlot::callee), calleeGPR);
    183183}
    184184
     
    62186218        VirtualRegister argumentCountRegister;
    62196219        if (!node->origin.semantic.inlineCallFrame)
    6220             argumentCountRegister = VirtualRegister(JSStack::ArgumentCount);
     6220            argumentCountRegister = VirtualRegister(CallFrameSlot::argumentCount);
    62216221        else
    62226222            argumentCountRegister = node->origin.semantic.inlineCallFrame->argumentCountRegister;
     
    62936293        }
    62946294    } else
    6295         m_jit.loadPtr(JITCompiler::addressFor(JSStack::Callee), scratch1GPR);
     6295        m_jit.loadPtr(JITCompiler::addressFor(CallFrameSlot::callee), scratch1GPR);
    62966296
    62976297    // Don't need a memory barriers since we just fast-created the activation, so the
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp

    r202680 r203006  
    836836            }
    837837        } 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));
    839839       
    840840            for (int i = 0; i < numPassedArgs; i++) {
     
    856856        calleePayloadGPR = callee.payloadGPR();
    857857        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));
    860860
    861861        if (!isTail)
     
    41174117    case GetCallee: {
    41184118        GPRTemporary result(this);
    4119         m_jit.loadPtr(JITCompiler::payloadFor(JSStack::Callee), result.gpr());
     4119        m_jit.loadPtr(JITCompiler::payloadFor(CallFrameSlot::callee), result.gpr());
    41204120        cellResult(result.gpr(), node);
    41214121        break;
     
    41244124    case GetArgumentCountIncludingThis: {
    41254125        GPRTemporary result(this);
    4126         m_jit.load32(JITCompiler::payloadFor(JSStack::ArgumentCount), result.gpr());
     4126        m_jit.load32(JITCompiler::payloadFor(CallFrameSlot::argumentCount), result.gpr());
    41274127        int32Result(result.gpr(), node);
    41284128        break;
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp

    r202680 r203006  
    807807            shuffleData.setupCalleeSaveRegisters(m_jit.codeBlock());
    808808        } else {
    809             m_jit.store32(MacroAssembler::TrustedImm32(numPassedArgs), JITCompiler::calleeFramePayloadSlot(JSStack::ArgumentCount));
     809            m_jit.store32(MacroAssembler::TrustedImm32(numPassedArgs), JITCompiler::calleeFramePayloadSlot(CallFrameSlot::argumentCount));
    810810
    811811            for (int i = 0; i < numPassedArgs; i++) {
     
    825825        calleeGPR = callee.gpr();
    826826        callee.use();
    827         m_jit.store64(calleeGPR, JITCompiler::calleeFrameSlot(JSStack::Callee));
     827        m_jit.store64(calleeGPR, JITCompiler::calleeFrameSlot(CallFrameSlot::callee));
    828828
    829829        flushRegisters();
     
    40484048    case GetCallee: {
    40494049        GPRTemporary result(this);
    4050         m_jit.loadPtr(JITCompiler::addressFor(JSStack::Callee), result.gpr());
     4050        m_jit.loadPtr(JITCompiler::addressFor(CallFrameSlot::callee), result.gpr());
    40514051        cellResult(result.gpr(), node);
    40524052        break;
     
    40554055    case GetArgumentCountIncludingThis: {
    40564056        GPRTemporary result(this);
    4057         m_jit.load32(JITCompiler::payloadFor(JSStack::ArgumentCount), result.gpr());
     4057        m_jit.load32(JITCompiler::payloadFor(CallFrameSlot::argumentCount), result.gpr());
    40584058        int32Result(result.gpr(), node);
    40594059        break;
  • trunk/Source/JavaScriptCore/dfg/DFGStackLayoutPhase.cpp

    r198600 r203006  
    119119            if (inlineCallFrame->isVarargs()) {
    120120                usedLocals.set(VirtualRegister(
    121                     JSStack::ArgumentCount + inlineCallFrame->stackOffset).toLocal());
     121                    CallFrameSlot::argumentCount + inlineCallFrame->stackOffset).toLocal());
    122122            }
    123123           
     
    185185            if (inlineCallFrame->isVarargs()) {
    186186                inlineCallFrame->argumentCountRegister = assign(
    187                     allocation, VirtualRegister(inlineCallFrame->stackOffset + JSStack::ArgumentCount));
     187                    allocation, VirtualRegister(inlineCallFrame->stackOffset + CallFrameSlot::argumentCount));
    188188            }
    189189           
  • trunk/Source/JavaScriptCore/dfg/DFGThunks.cpp

    r200879 r203006  
    112112    ptrdiff_t offsetOfTargetPC = offsetOfFrameSize + sizeof(EncodedJSValue);
    113113    ptrdiff_t offsetOfPayload = offsetOfTargetPC + sizeof(EncodedJSValue);
    114     ptrdiff_t offsetOfLocals = offsetOfPayload + sizeof(Register) * JSStack::CallFrameHeaderSize;
     114    ptrdiff_t offsetOfLocals = offsetOfPayload + sizeof(Register) * CallFrame::headerSizeInRegisters;
    115115   
    116116    jit.move(GPRInfo::returnValueGPR2, GPRInfo::regT0);
     
    129129    jit.store32(GPRInfo::regT2, MacroAssembler::BaseIndex(GPRInfo::callFrameRegister, GPRInfo::regT4, MacroAssembler::TimesEight, -static_cast<intptr_t>(sizeof(Register))));
    130130    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);
    132132   
    133133    jit.loadPtr(MacroAssembler::Address(GPRInfo::regT0, offsetOfTargetPC), GPRInfo::regT1);
  • trunk/Source/JavaScriptCore/ftl/FTLLink.cpp

    r202838 r203006  
    131131   
    132132        jit.load32(
    133             frame.withOffset(sizeof(Register) * JSStack::ArgumentCount),
     133            frame.withOffset(sizeof(Register) * CallFrameSlot::argumentCount),
    134134            GPRInfo::regT1);
    135135        mainPathJumps.append(jit.branch32(
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

    r202997 r203006  
    186186        m_proc.addFastConstant(m_tagMask->key());
    187187       
    188         m_out.storePtr(m_out.constIntPtr(codeBlock()), addressFor(JSStack::CodeBlock));
     188        m_out.storePtr(m_out.constIntPtr(codeBlock()), addressFor(CallFrameSlot::codeBlock));
    189189
    190190        // Stack Overflow Check.
     
    213213                    jit.store32(
    214214                        MacroAssembler::TrustedImm32(callSiteIndex.bits()),
    215                         CCallHelpers::tagFor(VirtualRegister(JSStack::ArgumentCount)));
     215                        CCallHelpers::tagFor(VirtualRegister(CallFrameSlot::argumentCount)));
    216216                    jit.copyCalleeSavesToVMEntryFrameCalleeSavesBuffer();
    217217
     
    30473047            VirtualRegister argumentCountRegister;
    30483048            if (!inlineCallFrame)
    3049                 argumentCountRegister = VirtualRegister(JSStack::ArgumentCount);
     3049                argumentCountRegister = VirtualRegister(CallFrameSlot::argumentCount);
    30503050            else
    30513051                argumentCountRegister = inlineCallFrame->argumentCountRegister;
     
    47334733    void compileGetCallee()
    47344734    {
    4735         setJSValue(m_out.loadPtr(addressFor(JSStack::Callee)));
     4735        setJSValue(m_out.loadPtr(addressFor(CallFrameSlot::callee)));
    47364736    }
    47374737   
    47384738    void compileGetArgumentCountIncludingThis()
    47394739    {
    4740         setInt32(m_out.load32(payloadFor(JSStack::ArgumentCount)));
     4740        setInt32(m_out.load32(payloadFor(CallFrameSlot::argumentCount)));
    47414741    }
    47424742   
     
    50635063        LValue jsCallee = lowJSValue(m_graph.varArgChild(node, 0));
    50645064
    5065         unsigned frameSize = JSStack::CallFrameHeaderSize + numArgs;
     5065        unsigned frameSize = CallFrame::headerSizeInRegisters + numArgs;
    50665066        unsigned alignedFrameSize = WTF::roundUpToMultipleOf(stackAlignmentRegisters(), frameSize);
    50675067
     
    50865086        auto addArgument = [&] (LValue value, VirtualRegister reg, int offset) {
    50875087            intptr_t offsetFromSP =
    5088                 (reg.offset() - JSStack::CallerFrameAndPCSize) * sizeof(EncodedJSValue) + offset;
     5088                (reg.offset() - CallerFrameAndPC::sizeInRegisters) * sizeof(EncodedJSValue) + offset;
    50895089            arguments.append(ConstrainedValue(value, ValueRep::stackArgument(offsetFromSP)));
    50905090        };
    50915091
    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);
    50945094        for (unsigned i = 0; i < numArgs; ++i)
    50955095            addArgument(lowJSValue(m_graph.varArgChild(node, 1 + i)), virtualRegisterForArgument(i), 0);
     
    51185118                jit.store32(
    51195119                    CCallHelpers::TrustedImm32(callSiteIndex.bits()),
    5120                     CCallHelpers::tagFor(VirtualRegister(JSStack::ArgumentCount)));
     5120                    CCallHelpers::tagFor(VirtualRegister(CallFrameSlot::argumentCount)));
    51215121
    51225122                CallLinkInfo* callLinkInfo = jit.codeBlock()->addCallLinkInfo();
     
    52365236                jit.store32(
    52375237                    CCallHelpers::TrustedImm32(callSiteIndex.bits()),
    5238                     CCallHelpers::tagFor(VirtualRegister(JSStack::ArgumentCount)));
     5238                    CCallHelpers::tagFor(VirtualRegister(CallFrameSlot::argumentCount)));
    52395239
    52405240                CallFrameShuffler slowPathShuffler(jit, shuffleData);
     
    53415341                jit.store32(
    53425342                    CCallHelpers::TrustedImm32(callSiteIndex.bits()),
    5343                     CCallHelpers::tagFor(VirtualRegister(JSStack::ArgumentCount)));
     5343                    CCallHelpers::tagFor(VirtualRegister(CallFrameSlot::argumentCount)));
    53445344
    53455345                CallLinkInfo* callLinkInfo = jit.codeBlock()->addCallLinkInfo();
     
    54705470                }
    54715471               
    5472                 jit.store64(GPRInfo::regT0, CCallHelpers::calleeFrameSlot(JSStack::Callee));
     5472                jit.store64(GPRInfo::regT0, CCallHelpers::calleeFrameSlot(CallFrameSlot::callee));
    54735473                jit.store64(thisGPR, CCallHelpers::calleeArgumentSlot(0));
    54745474               
     
    71537153        m_out.storePtr(m_callFrame, packet, m_heaps.ShadowChicken_Packet_frame);
    71547154        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);
    71567156        m_out.storePtr(scope, packet, m_heaps.ShadowChicken_Packet_scope);
    71577157    }
     
    72217221            VirtualRegister argumentCountRegister;
    72227222            if (!inlineCallFrame)
    7223                 argumentCountRegister = VirtualRegister(JSStack::ArgumentCount);
     7223                argumentCountRegister = VirtualRegister(CallFrameSlot::argumentCount);
    72247224            else
    72257225                argumentCountRegister = inlineCallFrame->argumentCountRegister;
     
    72427242            return weakPointer(frame->calleeRecovery.constant().asCell());
    72437243        }
    7244         return m_out.loadPtr(addressFor(JSStack::Callee));
     7244        return m_out.loadPtr(addressFor(CallFrameSlot::callee));
    72457245    }
    72467246   
     
    1070310703        m_out.store32(
    1070410704            m_out.constInt32(callSiteIndex.bits()),
    10705             tagFor(JSStack::ArgumentCount));
     10705            tagFor(CallFrameSlot::argumentCount));
    1070610706    }
    1070710707
  • trunk/Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp

    r200879 r203006  
    395395    }
    396396   
    397     jit.load32(CCallHelpers::payloadFor(JSStack::ArgumentCount), GPRInfo::regT2);
     397    jit.load32(CCallHelpers::payloadFor(CallFrameSlot::argumentCount), GPRInfo::regT2);
    398398   
    399399    // 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  
    104104        jit.store32(
    105105            CCallHelpers::TrustedImm32(callSiteIndex.bits()),
    106             CCallHelpers::tagFor(JSStack::ArgumentCount));
     106            CCallHelpers::tagFor(CallFrameSlot::argumentCount));
    107107    }
    108108    return callOperation(usedRegisters, jit, exceptionTarget, function, resultGPR, arguments...);
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp

    r201766 r203006  
    3737namespace JSC {
    3838
     39void 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
    3948bool CallFrame::callSiteBitsAreBytecodeOffset() const
    4049{
     
    7786unsigned CallFrame::callSiteAsRawBits() const
    7887{
    79     return this[JSStack::ArgumentCount].tag();
     88    return this[CallFrameSlot::argumentCount].tag();
    8089}
    8190
    8291SUPPRESS_ASAN unsigned CallFrame::unsafeCallSiteAsRawBits() const
    8392{
    84     return this[JSStack::ArgumentCount].unsafeTag();
     93    return this[CallFrameSlot::argumentCount].unsafeTag();
    8594}
    8695
     
    112121{
    113122    CallSiteIndex callSite(vpc);
    114     this[JSStack::ArgumentCount].tag() = callSite.bits();
     123    this[CallFrameSlot::argumentCount].tag() = callSite.bits();
    115124}
    116125
     
    132141{
    133142    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());
    135144}
    136145
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.h

    r202778 r203006  
    22 *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
    33 *  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.
    55 *
    66 *  This library is free software; you can redistribute it and/or
     
    2525
    2626#include "AbstractPC.h"
    27 #include "JSStack.h"
    2827#include "MacroAssemblerCodeRef.h"
    2928#include "Register.h"
     
    3534
    3635    class Arguments;
     36    class ExecState;
    3737    class Interpreter;
     38    class JSCallee;
    3839    class JSScope;
     40
     41    struct Instruction;
     42
     43    typedef ExecState CallFrame;
    3944
    4045    struct CallSiteIndex {
     
    6166    };
    6267
     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
    6383    // Represents the current state of script execution.
    6484    // Passed as the first argument to most functions.
    6585    class ExecState : private Register {
    6686    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(); }
    7294        JSScope* scope(int scopeRegisterOffset) const
    7395        {
     
    165187        void setScope(int scopeRegisterOffset, JSScope* scope) { static_cast<Register*>(this)[scopeRegisterOffset] = scope; }
    166188
    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);
    178190
    179191        // Read a register from the codeframe (or constant from the CodeBlock).
     
    186198        // Access to arguments as passed. (After capture, arguments may move to a different location.)
    187199        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); }
    191203
    192204        // In the following (argument() and setArgument()), the 'argument'
     
    234246        JSValue argumentAfterCapture(size_t argument);
    235247
    236         static int offsetFor(size_t argumentCountIncludingThis) { return argumentCountIncludingThis + JSStack::ThisArgument - 1; }
     248        static int offsetFor(size_t argumentCountIncludingThis) { return argumentCountIncludingThis + CallFrameSlot::thisArgument - 1; }
    237249
    238250        static CallFrame* noCaller() { return 0; }
    239251
    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; }
    243255        void setReturnPC(void* value) { callerFrameAndPC().pc = reinterpret_cast<Instruction*>(value); }
    244256
     
    280292
    281293            // The offset is defined (based on argumentOffset()) to be:
    282             //       offset = JSStack::FirstArgument - argIndex;
     294            //       offset = CallFrameSlot::firstArgument - argIndex;
    283295            // 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;
    286298            return argIndex;
    287299        }
     
    291303        SUPPRESS_ASAN const CallerFrameAndPC& unsafeCallerFrameAndPC() const { return *reinterpret_cast<const CallerFrameAndPC*>(this); }
    292304
     305#if !ENABLE(JIT)
    293306        friend class JSStack;
     307#endif
    294308    };
    295309
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r202890 r203006  
    402402    const Register* end;
    403403
    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;
    406406    while (it > end) {
    407407        JSValue v = it->jsValue();
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.h

    r202003 r203006  
    263263        argumentCountIncludingThis = WTF::roundUpToMultipleOf(
    264264            stackAlignmentRegisters(),
    265             argumentCountIncludingThis + JSStack::CallFrameHeaderSize) - JSStack::CallFrameHeaderSize;
     265            argumentCountIncludingThis + CallFrame::headerSizeInRegisters) - CallFrame::headerSizeInRegisters;
    266266
    267267        // Align the frame offset here.
    268268        unsigned paddedCalleeFrameOffset = WTF::roundUpToMultipleOf(
    269269            stackAlignmentRegisters(),
    270             numUsedStackSlots + argumentCountIncludingThis + JSStack::CallFrameHeaderSize);
     270            numUsedStackSlots + argumentCountIncludingThis + CallFrame::headerSizeInRegisters);
    271271        return CallFrame::create(callFrame->registers() - paddedCalleeFrameOffset);
    272272    }
  • trunk/Source/JavaScriptCore/interpreter/JSStack.h

    r202992 r203006  
    3030#define JSStack_h
    3131
    32 #include "ExecutableAllocator.h"
    3332#include "Register.h"
    3433#include <wtf/Noncopyable.h>
     
    4039    class CodeBlockSet;
    4140    class ConservativeRoots;
    42     class ExecState;
    4341    class JITStubRoutineSet;
    4442    class VM;
    4543    class LLIntOffsetsExtractor;
    4644
    47     struct Instruction;
    48     typedef ExecState CallFrame;
    49 
    50     struct CallerFrameAndPC {
    51         CallFrame* callerFrame;
    52         Instruction* pc;
    53     };
    54 
    5545    class JSStack {
    5646        WTF_MAKE_NONCOPYABLE(JSStack);
    5747    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 
    7048        // Allow 8k of excess registers before we start trying to reap the stack
    7149        static const ptrdiff_t maxExcessCapacity = 8 * 1024;
     
    7856        static size_t committedByteCount();
    7957
    80 #if ENABLE(JIT)
    81         void gatherConservativeRoots(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&) { }
    82         void sanitizeStack() { }
    83 #else
     58#if !ENABLE(JIT)
    8459        ~JSStack();
    8560
  • trunk/Source/JavaScriptCore/jit/AssemblyHelpers.cpp

    r200879 r203006  
    294294void AssemblyHelpers::jitAssertArgumentCountSane()
    295295{
    296     Jump ok = branch32(Below, payloadFor(JSStack::ArgumentCount), TrustedImm32(10000000));
     296    Jump ok = branch32(Below, payloadFor(CallFrameSlot::argumentCount), TrustedImm32(10000000));
    297297    abortWithReason(AHInsaneArgumentCount);
    298298    ok.link(this);
     
    545545void AssemblyHelpers::emitRandomThunk(GPRReg scratch0, GPRReg scratch1, GPRReg scratch2, GPRReg scratch3, FPRReg result)
    546546{
    547     emitGetFromCallFrameHeaderPtr(JSStack::Callee, scratch3);
     547    emitGetFromCallFrameHeaderPtr(CallFrameSlot::callee, scratch3);
    548548    emitLoadStructure(scratch3, scratch3, scratch0);
    549549    loadPtr(Address(scratch3, Structure::globalObjectOffset()), scratch3);
  • trunk/Source/JavaScriptCore/jit/AssemblyHelpers.h

    r202680 r203006  
    561561#endif
    562562
    563     void emitGetFromCallFrameHeaderPtr(JSStack::CallFrameHeaderEntry entry, GPRReg to, GPRReg from = GPRInfo::callFrameRegister)
     563    void emitGetFromCallFrameHeaderPtr(int entry, GPRReg to, GPRReg from = GPRInfo::callFrameRegister)
    564564    {
    565565        loadPtr(Address(from, entry * sizeof(Register)), to);
    566566    }
    567     void emitGetFromCallFrameHeader32(JSStack::CallFrameHeaderEntry entry, GPRReg to, GPRReg from = GPRInfo::callFrameRegister)
     567    void emitGetFromCallFrameHeader32(int entry, GPRReg to, GPRReg from = GPRInfo::callFrameRegister)
    568568    {
    569569        load32(Address(from, entry * sizeof(Register)), to);
    570570    }
    571571#if USE(JSVALUE64)
    572     void emitGetFromCallFrameHeader64(JSStack::CallFrameHeaderEntry entry, GPRReg to, GPRReg from = GPRInfo::callFrameRegister)
     572    void emitGetFromCallFrameHeader64(int entry, GPRReg to, GPRReg from = GPRInfo::callFrameRegister)
    573573    {
    574574        load64(Address(from, entry * sizeof(Register)), to);
    575575    }
    576576#endif // USE(JSVALUE64)
    577     void emitPutToCallFrameHeader(GPRReg from, JSStack::CallFrameHeaderEntry entry)
     577    void emitPutToCallFrameHeader(GPRReg from, int entry)
    578578    {
    579579        storePtr(from, Address(GPRInfo::callFrameRegister, entry * sizeof(Register)));
    580580    }
    581581
    582     void emitPutToCallFrameHeader(void* value, JSStack::CallFrameHeaderEntry entry)
     582    void emitPutToCallFrameHeader(void* value, int entry)
    583583    {
    584584        storePtr(TrustedImmPtr(value), Address(GPRInfo::callFrameRegister, entry * sizeof(Register)));
     
    610610    // "link register" containing the return address in the function prologue.
    611611#if USE(JSVALUE64)
    612     void emitPutToCallFrameHeaderBeforePrologue(GPRReg from, JSStack::CallFrameHeaderEntry entry)
     612    void emitPutToCallFrameHeaderBeforePrologue(GPRReg from, int entry)
    613613    {
    614614        storePtr(from, Address(stackPointerRegister, entry * static_cast<ptrdiff_t>(sizeof(Register)) - prologueStackPointerDelta()));
    615615    }
    616616#else
    617     void emitPutPayloadToCallFrameHeaderBeforePrologue(GPRReg from, JSStack::CallFrameHeaderEntry entry)
     617    void emitPutPayloadToCallFrameHeaderBeforePrologue(GPRReg from, int entry)
    618618    {
    619619        storePtr(from, Address(stackPointerRegister, entry * static_cast<ptrdiff_t>(sizeof(Register)) - prologueStackPointerDelta() + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)));
    620620    }
    621621
    622     void emitPutTagToCallFrameHeaderBeforePrologue(TrustedImm32 tag, JSStack::CallFrameHeaderEntry entry)
     622    void emitPutTagToCallFrameHeaderBeforePrologue(TrustedImm32 tag, int entry)
    623623    {
    624624        storePtr(tag, Address(stackPointerRegister, entry * static_cast<ptrdiff_t>(sizeof(Register)) - prologueStackPointerDelta() + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)));
     
    934934    static Address calleeFrameSlot(int slot)
    935935    {
    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));
    938938    }
    939939
  • trunk/Source/JavaScriptCore/jit/CCallHelpers.cpp

    r200981 r203006  
    3838    loadPtr(Address(GPRInfo::callFrameRegister, OBJECT_OFFSETOF(CallerFrameAndPC, callerFrame)), scratch1);
    3939    storePtr(scratch1, Address(shadowPacket, OBJECT_OFFSETOF(ShadowChicken::Packet, callerFrame)));
    40     loadPtr(addressFor(JSStack::Callee), scratch1);
     40    loadPtr(addressFor(CallFrameSlot::callee), scratch1);
    4141    storePtr(scratch1, Address(shadowPacket, OBJECT_OFFSETOF(ShadowChicken::Packet, callee)));
    4242    storePtr(scope, Address(shadowPacket, OBJECT_OFFSETOF(ShadowChicken::Packet, scope)));
  • trunk/Source/JavaScriptCore/jit/CCallHelpers.h

    r201322 r203006  
    22792279            {
    22802280                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);
    22822282
    22832283                {
     
    22852285                    {
    22862286                        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);
    22882288                        load32(Address(codeBlockGPR, CodeBlock::offsetOfNumParameters()), numParametersGPR);
    22892289                    }
     
    22952295                }
    22962296
    2297                 add32(TrustedImm32(stackAlignmentRegisters() + JSStack::CallFrameHeaderSize - 1), argCountGPR, oldFrameSizeGPR);
     2297                add32(TrustedImm32(stackAlignmentRegisters() + CallFrame::headerSizeInRegisters - 1), argCountGPR, oldFrameSizeGPR);
    22982298                and32(TrustedImm32(-stackAlignmentRegisters()), oldFrameSizeGPR);
    22992299                // We assume < 2^28 arguments
     
    23082308            // frame header size, aligned
    23092309            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)),
    23112311                newFrameSizeGPR);
    2312             add32(TrustedImm32(stackAlignmentRegisters() + JSStack::CallFrameHeaderSize - 1), newFrameSizeGPR);
     2312            add32(TrustedImm32(stackAlignmentRegisters() + CallFrame::headerSizeInRegisters - 1), newFrameSizeGPR);
    23132313            and32(TrustedImm32(-stackAlignmentRegisters()), newFrameSizeGPR);
    23142314            // We assume < 2^28 arguments
  • trunk/Source/JavaScriptCore/jit/CallFrameShuffler.cpp

    r194496 r203006  
    3737CallFrameShuffler::CallFrameShuffler(CCallHelpers& jit, const CallFrameShuffleData& data)
    3838    : m_jit(jit)
    39     , m_oldFrame(data.numLocals + JSStack::CallerFrameAndPCSize, nullptr)
    40     , m_newFrame(data.args.size() + JSStack::CallFrameHeaderSize, nullptr)
    41     , m_alignedOldFrameSize(JSStack::CallFrameHeaderSize
     39    , m_oldFrame(data.numLocals + CallerFrameAndPC::sizeInRegisters, nullptr)
     40    , m_newFrame(data.args.size() + CallFrame::headerSizeInRegisters, nullptr)
     41    , m_alignedOldFrameSize(CallFrame::headerSizeInRegisters
    4242        + roundArgumentCountToAlignFrame(jit.codeBlock()->numParameters()))
    43     , m_alignedNewFrameSize(JSStack::CallFrameHeaderSize
     43    , m_alignedNewFrameSize(CallFrame::headerSizeInRegisters
    4444        + roundArgumentCountToAlignFrame(data.args.size()))
    4545    , m_frameDelta(m_alignedNewFrameSize - m_alignedOldFrameSize)
     
    5555
    5656    ASSERT(!data.callee.isInJSStack() || data.callee.virtualRegister().isLocal());
    57     addNew(VirtualRegister(JSStack::Callee), data.callee);
     57    addNew(VirtualRegister(CallFrameSlot::callee), data.callee);
    5858
    5959    for (size_t i = 0; i < data.args.size(); ++i) {
     
    146146                        recoveryStr.data(), d);
    147147                }
    148             } else if (newReg == VirtualRegister { JSStack::ArgumentCount })
     148            } else if (newReg == VirtualRegister { CallFrameSlot::argumentCount })
    149149                out.printf(" %c%8s <- %18zu %c ", d, str.data(), argCount(), d);
    150150            else
     
    324324
    325325        if (isSlowPath())
    326             m_frameDelta = numLocals() + JSStack::CallerFrameAndPCSize;
     326            m_frameDelta = numLocals() + CallerFrameAndPC::sizeInRegisters;
    327327        else
    328328            m_oldFrameOffset = numLocals();
     
    340340    emitDeltaCheck();
    341341
    342     m_frameDelta = numLocals() + JSStack::CallerFrameAndPCSize;
     342    m_frameDelta = numLocals() + CallerFrameAndPC::sizeInRegisters;
    343343    m_newFrameBase = MacroAssembler::stackPointerRegister;
    344     m_newFrameOffset = -JSStack::CallerFrameAndPCSize;
     344    m_newFrameOffset = -CallerFrameAndPC::sizeInRegisters;
    345345
    346346    if (verbose)
     
    424424    // the number of parameters), then substracting to it the aligned
    425425    // 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);
    427427    MacroAssembler::Jump argumentCountOK =
    428428        m_jit.branch32(MacroAssembler::BelowOrEqual, m_newFrameBase,
    429429            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);
    431431    m_jit.and32(MacroAssembler::TrustedImm32(-stackAlignmentRegisters()), m_newFrameBase);
    432432    m_jit.mul32(MacroAssembler::TrustedImm32(sizeof(Register)), m_newFrameBase, m_newFrameBase);
     
    744744    // m_newFrameBase, which could be a wanted register.
    745745    if (verbose)
    746         dataLog("   * Storing the argument count into ", VirtualRegister { JSStack::ArgumentCount }, "\n");
     746        dataLog("   * Storing the argument count into ", VirtualRegister { CallFrameSlot::argumentCount }, "\n");
    747747    m_jit.store32(MacroAssembler::TrustedImm32(0),
    748         addressForNew(VirtualRegister { JSStack::ArgumentCount }).withOffset(TagOffset));
     748        addressForNew(VirtualRegister { CallFrameSlot::argumentCount }).withOffset(TagOffset));
    749749    m_jit.store32(MacroAssembler::TrustedImm32(argCount()),
    750         addressForNew(VirtualRegister { JSStack::ArgumentCount }).withOffset(PayloadOffset));
     750        addressForNew(VirtualRegister { CallFrameSlot::argumentCount }).withOffset(PayloadOffset));
    751751
    752752    if (!isSlowPath()) {
  • trunk/Source/JavaScriptCore/jit/CallFrameShuffler.h

    r195440 r203006  
    104104        CallFrameShuffleData data;
    105105        data.numLocals = numLocals();
    106         data.callee = getNew(VirtualRegister { JSStack::Callee })->recovery();
     106        data.callee = getNew(VirtualRegister { CallFrameSlot::callee })->recovery();
    107107        data.args.resize(argCount());
    108108        for (size_t i = 0; i < argCount(); ++i)
     
    130130        ASSERT(isUndecided());
    131131        ASSERT(!getNew(jsValueRegs));
    132         CachedRecovery* cachedRecovery { getNew(VirtualRegister(JSStack::Callee)) };
     132        CachedRecovery* cachedRecovery { getNew(VirtualRegister(CallFrameSlot::callee)) };
    133133        ASSERT(cachedRecovery);
    134134        addNew(jsValueRegs, cachedRecovery->recovery());
     
    143143    {
    144144#if USE(JSVALUE32_64)
    145         CachedRecovery& calleeCachedRecovery = *getNew(VirtualRegister(JSStack::Callee));
     145        CachedRecovery& calleeCachedRecovery = *getNew(VirtualRegister(CallFrameSlot::callee));
    146146        switch (calleeCachedRecovery.recovery().technique()) {
    147147        case InPair:
     
    298298    int numLocals() const
    299299    {
    300         return m_oldFrame.size() - JSStack::CallerFrameAndPCSize;
     300        return m_oldFrame.size() - CallerFrameAndPC::sizeInRegisters;
    301301    }
    302302
    303303    CachedRecovery* getOld(VirtualRegister reg) const
    304304    {
    305         return m_oldFrame[JSStack::CallerFrameAndPCSize - reg.offset() - 1];
     305        return m_oldFrame[CallerFrameAndPC::sizeInRegisters - reg.offset() - 1];
    306306    }
    307307
    308308    void setOld(VirtualRegister reg, CachedRecovery* cachedRecovery)
    309309    {
    310         m_oldFrame[JSStack::CallerFrameAndPCSize - reg.offset() - 1] = cachedRecovery;
     310        m_oldFrame[CallerFrameAndPC::sizeInRegisters - reg.offset() - 1] = cachedRecovery;
    311311    }
    312312
     
    318318    VirtualRegister lastOld() const
    319319    {
    320         return VirtualRegister { JSStack::CallerFrameAndPCSize - 1 };
     320        return VirtualRegister { CallerFrameAndPC::sizeInRegisters - 1 };
    321321    }
    322322
     
    340340    size_t argCount() const
    341341    {
    342         return m_newFrame.size() - JSStack::CallFrameHeaderSize;
     342        return m_newFrame.size() - CallFrame::headerSizeInRegisters;
    343343    }
    344344
  • trunk/Source/JavaScriptCore/jit/JIT.cpp

    r202992 r203006  
    570570
    571571    emitFunctionPrologue();
    572     emitPutToCallFrameHeader(m_codeBlock, JSStack::CodeBlock);
     572    emitPutToCallFrameHeader(m_codeBlock, CallFrameSlot::codeBlock);
    573573
    574574    Label beginLabel(this);
     
    628628        store8(TrustedImm32(0), &m_codeBlock->m_shouldAlwaysBeInlined);
    629629        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);
    633633        branch32(AboveOrEqual, regT1, TrustedImm32(m_codeBlock->m_numParameters)).linkTo(beginLabel, this);
    634634
  • trunk/Source/JavaScriptCore/jit/JIT.h

    r202364 r203006  
    707707        void emitInitRegister(int dst);
    708708
    709         void emitPutIntToCallFrameHeader(RegisterID from, JSStack::CallFrameHeaderEntry);
     709        void emitPutIntToCallFrameHeader(RegisterID from, int entry);
    710710
    711711        JSValue getConstantOperand(int src);
  • trunk/Source/JavaScriptCore/jit/JITCall.cpp

    r202157 r203006  
    8181
    8282    // 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);
    8484    load8(info->addressOfMaxNumArguments(), regT0);
    8585    Jump notBiggest = branch32(Above, regT0, regT2);
     
    124124    addPtr(TrustedImm32(registerOffset * sizeof(Register) + sizeof(CallerFrameAndPC)), callFrameRegister, stackPointerRegister);
    125125
    126     load64(Address(stackPointerRegister, sizeof(Register) * JSStack::Callee - sizeof(CallerFrameAndPC)), regT0);
     126    load64(Address(stackPointerRegister, sizeof(Register) * CallFrameSlot::callee - sizeof(CallerFrameAndPC)), regT0);
    127127    move(TrustedImmPtr(info), regT2);
    128128    Call call = emitNakedCall();
     
    182182   
    183183        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)));
    185185    } // SP holds newCallFrame + sizeof(CallerFrameAndPC), with ArgumentCount initialized.
    186186   
    187187    uint32_t bytecodeOffset = instruction - m_codeBlock->instructions().begin();
    188188    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));
    190190
    191191    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)));
    193193
    194194    if (opcodeID == op_call_eval) {
  • trunk/Source/JavaScriptCore/jit/JITCall32_64.cpp

    r202003 r203006  
    171171
    172172    // 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);
    174174    load8(info->addressOfMaxNumArguments(), regT0);
    175175    Jump notBiggest = branch32(Above, regT0, regT2);
     
    215215    addPtr(TrustedImm32(registerOffset * sizeof(Register) + sizeof(CallerFrameAndPC)), callFrameRegister, stackPointerRegister);
    216216
    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);
    219219    move(TrustedImmPtr(info), regT2);
    220220
    221     emitLoad(JSStack::Callee, regT1, regT0);
     221    emitLoad(CallFrameSlot::callee, regT1, regT0);
    222222    MacroAssemblerCodeRef virtualThunk = virtualThunkFor(m_vm, *info);
    223223    info->setSlowStub(createJITStubRoutine(virtualThunk, *m_vm, nullptr, true));
     
    266266        addPtr(TrustedImm32(registerOffset * sizeof(Register) + sizeof(CallerFrameAndPC)), callFrameRegister, stackPointerRegister);
    267267
    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)));
    269269    } // SP holds newCallFrame + sizeof(CallerFrameAndPC), with ArgumentCount initialized.
    270270   
    271271    uint32_t locationBits = CallSiteIndex(instruction).bits();
    272     store32(TrustedImm32(locationBits), tagFor(JSStack::ArgumentCount, callFrameRegister));
     272    store32(TrustedImm32(locationBits), tagFor(CallFrameSlot::argumentCount, callFrameRegister));
    273273    emitLoad(callee, regT1, regT0); // regT1, regT0 holds callee.
    274274
    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)));
    277277
    278278    if (opcodeID == op_call_eval) {
  • trunk/Source/JavaScriptCore/jit/JITInlines.h

    r202157 r203006  
    8989}
    9090
    91 ALWAYS_INLINE void JIT::emitPutIntToCallFrameHeader(RegisterID from, JSStack::CallFrameHeaderEntry entry)
     91ALWAYS_INLINE void JIT::emitPutIntToCallFrameHeader(RegisterID from, int entry)
    9292{
    9393#if USE(JSVALUE32_64)
     
    143143    uint32_t locationBits = CallSiteIndex(m_bytecodeOffset + 1).bits();
    144144#endif
    145     store32(TrustedImm32(locationBits), intTagFor(JSStack::ArgumentCount));
     145    store32(TrustedImm32(locationBits), intTagFor(CallFrameSlot::argumentCount));
    146146   
    147147    // 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  
    724724{
    725725    int dst = currentInstruction[1].u.operand;
    726     emitGetFromCallFrameHeaderPtr(JSStack::Callee, regT0);
     726    emitGetFromCallFrameHeaderPtr(CallFrameSlot::callee, regT0);
    727727    loadPtr(Address(regT0, JSFunction::offsetOfScopeChain()), regT0);
    728728    emitStoreCell(dst, regT0);
     
    14451445{
    14461446    int dst = currentInstruction[1].u.operand;
    1447     load32(payloadFor(JSStack::ArgumentCount), regT0);
     1447    load32(payloadFor(CallFrameSlot::argumentCount), regT0);
    14481448    sub32(TrustedImm32(1), regT0);
    14491449    JSValueRegs result = JSValueRegs::withTwoAvailableRegs(regT0, regT1);
     
    14621462    int dst = currentInstruction[1].u.operand;
    14631463    unsigned numParamsToSkip = currentInstruction[2].u.unsignedValue;
    1464     load32(payloadFor(JSStack::ArgumentCount), regT0);
     1464    load32(payloadFor(CallFrameSlot::argumentCount), regT0);
    14651465    sub32(TrustedImm32(1), regT0);
    14661466    Jump zeroLength = branch32(LessThanOrEqual, regT0, Imm32(numParamsToSkip));
  • trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp

    r202680 r203006  
    5656
    5757    emitFunctionPrologue();
    58     emitPutToCallFrameHeader(0, JSStack::CodeBlock);
     58    emitPutToCallFrameHeader(0, CallFrameSlot::codeBlock);
    5959    storePtr(callFrameRegister, &m_vm->topCallFrame);
    6060
     
    8282    move(callFrameRegister, argumentGPR0);
    8383
    84     emitGetFromCallFrameHeaderPtr(JSStack::Callee, argumentGPR1);
     84    emitGetFromCallFrameHeaderPtr(CallFrameSlot::callee, argumentGPR1);
    8585    loadPtr(Address(argumentGPR1, OBJECT_OFFSETOF(JSFunction, m_executable)), regT2);
    8686
     
    998998{
    999999    int dst = currentInstruction[1].u.operand;
    1000     emitGetFromCallFrameHeaderPtr(JSStack::Callee, regT0);
     1000    emitGetFromCallFrameHeaderPtr(CallFrameSlot::callee, regT0);
    10011001    loadPtr(Address(regT0, JSFunction::offsetOfScopeChain()), regT0);
    10021002    emitStoreCell(dst, regT0);
  • trunk/Source/JavaScriptCore/jit/JSInterfaceJIT.h

    r191191 r203006  
    7272        Jump emitJumpIfNotType(RegisterID baseReg, JSType);
    7373
    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);
    7878
    7979        inline Address payloadFor(int index, RegisterID base = callFrameRegister);
     
    222222    }
    223223
    224     ALWAYS_INLINE void JSInterfaceJIT::emitGetFromCallFrameHeaderPtr(JSStack::CallFrameHeaderEntry entry, RegisterID to, RegisterID from)
     224    ALWAYS_INLINE void JSInterfaceJIT::emitGetFromCallFrameHeaderPtr(int entry, RegisterID to, RegisterID from)
    225225    {
    226226        loadPtr(Address(from, entry * sizeof(Register)), to);
    227227    }
    228228
    229     ALWAYS_INLINE void JSInterfaceJIT::emitPutToCallFrameHeader(RegisterID from, JSStack::CallFrameHeaderEntry entry)
     229    ALWAYS_INLINE void JSInterfaceJIT::emitPutToCallFrameHeader(RegisterID from, int entry)
    230230    {
    231231#if USE(JSVALUE32_64)
     
    236236    }
    237237
    238     ALWAYS_INLINE void JSInterfaceJIT::emitPutToCallFrameHeader(void* value, JSStack::CallFrameHeaderEntry entry)
     238    ALWAYS_INLINE void JSInterfaceJIT::emitPutToCallFrameHeader(void* value, int entry)
    239239    {
    240240        storePtr(TrustedImmPtr(value), Address(callFrameRegister, entry * sizeof(Register)));
    241241    }
    242242
    243     ALWAYS_INLINE void JSInterfaceJIT::emitPutCellToCallFrameHeader(RegisterID from, JSStack::CallFrameHeaderEntry entry)
     243    ALWAYS_INLINE void JSInterfaceJIT::emitPutCellToCallFrameHeader(RegisterID from, int entry)
    244244    {
    245245#if USE(JSVALUE32_64)
  • trunk/Source/JavaScriptCore/jit/SetupVarargsFrame.cpp

    r202992 r203006  
    4848
    4949    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);
    5151   
    5252    // resultGPR now has the required frame size in Register units
     
    8686
    8787    // 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));
    8989
    9090    // Copy arguments.
     
    132132    } else {
    133133        argumentCountRecovery = ValueRecovery::displacedInJSStack(
    134             VirtualRegister(JSStack::ArgumentCount), DataFormatInt32);
     134            VirtualRegister(CallFrameSlot::argumentCount), DataFormatInt32);
    135135        firstArgumentReg = VirtualRegister(CallFrame::argumentOffset(0));
    136136    }
  • trunk/Source/JavaScriptCore/jit/SpecializedThunkJIT.h

    r199946 r203006  
    4747            emitSaveThenMaterializeTagRegisters();
    4848            // 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)));
    5050        }
    5151       
  • trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp

    r200879 r203006  
    260260    }
    261261
    262     jit.emitPutToCallFrameHeader(0, JSStack::CodeBlock);
     262    jit.emitPutToCallFrameHeader(0, CallFrameSlot::codeBlock);
    263263    jit.storePtr(JSInterfaceJIT::callFrameRegister, &vm->topCallFrame);
    264264
     
    271271
    272272    // call the function
    273     jit.emitGetFromCallFrameHeaderPtr(JSStack::Callee, JSInterfaceJIT::regT1);
     273    jit.emitGetFromCallFrameHeaderPtr(CallFrameSlot::callee, JSInterfaceJIT::regT1);
    274274    jit.loadPtr(JSInterfaceJIT::Address(JSInterfaceJIT::regT1, JSFunction::offsetOfExecutable()), JSInterfaceJIT::regT1);
    275275    jit.call(JSInterfaceJIT::Address(JSInterfaceJIT::regT1, executableOffsetToFunction));
     
    283283    jit.move(JSInterfaceJIT::callFrameRegister, X86Registers::edi);
    284284
    285     jit.emitGetFromCallFrameHeaderPtr(JSStack::Callee, X86Registers::esi);
     285    jit.emitGetFromCallFrameHeaderPtr(CallFrameSlot::callee, X86Registers::esi);
    286286    jit.loadPtr(JSInterfaceJIT::Address(X86Registers::esi, JSFunction::offsetOfExecutable()), X86Registers::r9);
    287287    jit.call(JSInterfaceJIT::Address(X86Registers::r9, executableOffsetToFunction));
     
    296296    jit.subPtr(JSInterfaceJIT::TrustedImm32(4 * sizeof(int64_t)), JSInterfaceJIT::stackPointerRegister);
    297297
    298     jit.emitGetFromCallFrameHeaderPtr(JSStack::Callee, X86Registers::edx);
     298    jit.emitGetFromCallFrameHeaderPtr(CallFrameSlot::callee, X86Registers::edx);
    299299    jit.loadPtr(JSInterfaceJIT::Address(X86Registers::edx, JSFunction::offsetOfExecutable()), X86Registers::r9);
    300300    jit.call(JSInterfaceJIT::Address(X86Registers::r9, executableOffsetToFunction));
     
    311311    jit.move(JSInterfaceJIT::callFrameRegister, ARM64Registers::x0);
    312312
    313     jit.emitGetFromCallFrameHeaderPtr(JSStack::Callee, ARM64Registers::x1);
     313    jit.emitGetFromCallFrameHeaderPtr(CallFrameSlot::callee, ARM64Registers::x1);
    314314    jit.loadPtr(JSInterfaceJIT::Address(ARM64Registers::x1, JSFunction::offsetOfExecutable()), ARM64Registers::x2);
    315315    jit.call(JSInterfaceJIT::Address(ARM64Registers::x2, executableOffsetToFunction));
     
    324324    jit.move(JSInterfaceJIT::callFrameRegister, JSInterfaceJIT::argumentGPR0);
    325325
    326     jit.emitGetFromCallFrameHeaderPtr(JSStack::Callee, JSInterfaceJIT::argumentGPR1);
     326    jit.emitGetFromCallFrameHeaderPtr(CallFrameSlot::callee, JSInterfaceJIT::argumentGPR1);
    327327    jit.loadPtr(JSInterfaceJIT::Address(JSInterfaceJIT::argumentGPR1, JSFunction::offsetOfExecutable()), JSInterfaceJIT::regT2);
    328328    jit.call(JSInterfaceJIT::Address(JSInterfaceJIT::regT2, executableOffsetToFunction));
     
    420420#  endif
    421421    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);
    424424
    425425    // Check to see if we have extra slots we can use
     
    470470#  endif
    471471    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);
    474474
    475475    // Check to see if we have extra slots we can use
     
    10441044   
    10451045    // 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));
    10481048
    10491049    unsigned extraStackNeeded = 0;
     
    10661066    // That's really all there is to this. We have all the registers we need to do it.
    10671067   
    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);
    10701070    jit.lshift32(CCallHelpers::TrustedImm32(3), GPRInfo::regT2);
    10711071    jit.add32(CCallHelpers::TrustedImm32(stackAlignmentBytes() - 1), GPRInfo::regT2);
     
    10821082    // Do basic callee frame setup, including 'this'.
    10831083   
    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));
    10871087   
    10881088    JSValueRegs valueRegs = JSValueRegs::withTwoAvailableRegs(GPRInfo::regT0, GPRInfo::regT2);
     
    10911091
    10921092    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));
    10941094   
    10951095    // 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  
    9797    STATIC_ASSERT(sizeof(void*) == PtrSize);
    9898    STATIC_ASSERT(sizeof(Register) == SlotSize);
    99     STATIC_ASSERT(JSStack::CallFrameHeaderSize == CallFrameHeaderSlots);
     99    STATIC_ASSERT(CallFrame::headerSizeInRegisters == CallFrameHeaderSlots);
    100100
    101101    ASSERT(!CallFrame::callerFrameOffset());
    102     STATIC_ASSERT(JSStack::CallerFrameAndPCSize == (PtrSize * 2) / SlotSize);
     102    STATIC_ASSERT(CallerFrameAndPC::sizeInRegisters == (PtrSize * 2) / SlotSize);
    103103    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);
    111111
    112112#if CPU(BIG_ENDIAN)
  • trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp

    r202992 r203006  
    13271327   
    13281328    execCallee->setArgumentCountIncludingThis(pc[3].u.operand);
    1329     execCallee->uncheckedR(JSStack::Callee) = calleeAsValue;
     1329    execCallee->uncheckedR(CallFrameSlot::callee) = calleeAsValue;
    13301330    execCallee->setCallerFrame(exec);
    13311331   
     
    14061406
    14071407    execCallee->setCallerFrame(exec);
    1408     execCallee->uncheckedR(JSStack::Callee) = calleeAsValue;
     1408    execCallee->uncheckedR(CallFrameSlot::callee) = calleeAsValue;
    14091409    exec->setCurrentVPC(pc);
    14101410
     
    14371437    execCallee->setArgumentCountIncludingThis(pc[3].u.operand);
    14381438    execCallee->setCallerFrame(exec);
    1439     execCallee->uncheckedR(JSStack::Callee) = calleeAsValue;
     1439    execCallee->uncheckedR(CallFrameSlot::callee) = calleeAsValue;
    14401440    execCallee->setReturnPC(LLInt::getCodePtr(llint_generic_return_point));
    14411441    execCallee->setCodeBlock(0);
  • trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h

    r202157 r203006  
    6161   
    6262    ASSERT(argumentCountIncludingThis < newCodeBlock->numParameters());
    63     int frameSize = argumentCountIncludingThis + JSStack::CallFrameHeaderSize;
     63    int frameSize = argumentCountIncludingThis + CallFrame::headerSizeInRegisters;
    6464    int alignedFrameSizeForParameters = WTF::roundUpToMultipleOf(stackAlignmentRegisters(),
    65         newCodeBlock->numParameters() + JSStack::CallFrameHeaderSize);
     65        newCodeBlock->numParameters() + CallFrame::headerSizeInRegisters);
    6666    int paddedStackSpace = alignedFrameSizeForParameters - frameSize;
    6767
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r202680 r203006  
    321321    Base::setStructure(vm, Structure::toCacheableDictionaryTransition(vm, structure()));
    322322
    323     JSGlobalObject::globalExec()->init(0, 0, CallFrame::noCaller(), 0, 0);
    324 
    325323    m_debugger = 0;
    326324
     
    332330#endif
    333331
    334     ExecState* exec = JSGlobalObject::globalExec();
    335 
    336332    m_functionPrototype.set(vm, this, FunctionPrototype::create(vm, FunctionPrototype::createStructure(vm, this, jsNull()))); // The real prototype will be set once ObjectPrototype is created.
    337333    m_calleeStructure.set(vm, this, JSCallee::createStructure(vm, this, jsNull()));
     
    339335    m_globalLexicalEnvironment.set(vm, this, JSGlobalLexicalEnvironment::create(vm, JSGlobalLexicalEnvironment::createStructure(vm, this), this));
    340336    // 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();
    343342
    344343    m_functionStructure.set(vm, this, JSFunction::createStructure(vm, this, m_functionPrototype.get()));
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r202631 r203006  
    210210    template<typename T> using Initializer = typename LazyProperty<JSGlobalObject, T>::Initializer;
    211211   
    212     Register m_globalCallFrame[JSStack::CallFrameHeaderSize];
     212    Register m_globalCallFrame[CallFrame::headerSizeInRegisters];
    213213
    214214    WriteBarrier<JSObject> m_globalThis;
  • trunk/Source/JavaScriptCore/runtime/StackAlignment.h

    r163027 r203006  
    4545inline unsigned roundArgumentCountToAlignFrame(unsigned argumentCount)
    4646{
    47     return WTF::roundUpToMultipleOf(stackAlignmentRegisters(), argumentCount + JSStack::CallFrameHeaderSize) - JSStack::CallFrameHeaderSize;
     47    return WTF::roundUpToMultipleOf(stackAlignmentRegisters(), argumentCount + CallFrame::headerSizeInRegisters) - CallFrame::headerSizeInRegisters;
    4848}
    4949
    5050// 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::CallerFrameAndPCSize
     51// CallFrame is at an address that is stack aligned minus CallerFrameAndPC::sizeInRegisters
    5252inline unsigned roundLocalRegisterCountForFramePointerOffset(unsigned localRegisterCount)
    5353{
    54     return WTF::roundUpToMultipleOf(stackAlignmentRegisters(), localRegisterCount + JSStack::CallerFrameAndPCSize) - JSStack::CallerFrameAndPCSize;
     54    return WTF::roundUpToMultipleOf(stackAlignmentRegisters(), localRegisterCount + CallerFrameAndPC::sizeInRegisters) - CallerFrameAndPC::sizeInRegisters;
    5555}
    5656
  • trunk/Source/JavaScriptCore/wasm/WASMFunctionCompiler.h

    r202992 r203006  
    131131
    132132        emitFunctionPrologue();
    133         emitPutToCallFrameHeader(m_codeBlock, JSStack::CodeBlock);
     133        emitPutToCallFrameHeader(m_codeBlock, CallFrameSlot::codeBlock);
    134134
    135135        m_beginLabel = label();
     
    218218        Label arityCheck = label();
    219219        emitFunctionPrologue();
    220         emitPutToCallFrameHeader(m_codeBlock, JSStack::CodeBlock);
     220        emitPutToCallFrameHeader(m_codeBlock, CallFrameSlot::codeBlock);
    221221        jump(m_beginLabel);
    222222
     
    13481348    {
    13491349        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);
    13511351
    13521352        storeTrustedValue(jsUndefined(), Address(GPRInfo::callFrameRegister, (stackOffset + CallFrame::thisArgumentOffset()) * sizeof(Register)));
     
    13851385
    13861386        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)));
    13881388    }
    13891389
     
    13921392        // regT0 holds callee.
    13931393#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)));
    13981398#endif
    13991399
  • trunk/Source/JavaScriptCore/wasm/WASMFunctionSyntaxChecker.h

    r190144 r203006  
    271271    {
    272272        // 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;
    276276    }
    277277
Note: See TracChangeset for help on using the changeset viewer.