Ignore:
Timestamp:
Dec 23, 2019, 5:49:45 PM (5 years ago)
Author:
[email protected]
Message:

DFG/FTL should be able to exit to the middle of a bytecode
https://bugs.webkit.org/show_bug.cgi?id=205232

Reviewed by Saam Barati.

JSTests:

  • stress/apply-osr-exit-should-get-length-once-exceptions-occasionally.js: Added.

(expectedArgCount):
(callee):
(test):
(let.array.get length):

  • stress/apply-osr-exit-should-get-length-once.js: Added.

(expectedArgCount):
(callee):
(test):
(let.array.get length):

  • stress/load-varargs-then-inlined-call-and-exit-strict.js:

(checkEqual):

  • stress/recursive-tail-call-with-different-argument-count.js:
  • stress/rest-varargs-osr-exit-to-checkpoint.js: Added.

(foo):
(bar):

Source/JavaScriptCore:

It can be valuable to exit to the middle of a bytecode for a couple of reasons.
1) It can be used to combine bytecodes that share a majority of their operands, reducing bytecode steam size.
2) It enables creating bytecodes that are easier to reconstruct useful optimization information from.

To make exiting to the middle of a bytecode possible this patch
introduces the concept of a temporary operand. A temporary operand
is one that contains the result of effectful operations during the
process of executing a bytecode. tmp operands have no meaning when
executing in the LLInt or Baseline and are only used in the DFG to
preserve information for OSR exit. We use the term checkpoint to
refer to any point where an effectful component of a bytecode executes.
For example, in op_call_varargs there are two checkpoints the first is
before we have determined the number of variable arguments and the second
is the actual call.

When the DFG OSR exits if there are any active checkpoints inline
call stack we will emit a jit probe that allocates a side state
object keyed off the frame pointer of the bytecode whose
checkpoint needs to be finished. We need side state because we may
recursively inline several copies of the same
function. Alternatively, we could call back into ourselves after
OSR and exit again from optimized code before finishing the
checkpoint of our caller.

Another thing we need to be careful of is making sure we remove
side state as we unwind for an exception. To make sure we do this
correctly I've added an assertion to JSLock that there are no
pending checkpoint side states on the vm when releasing the lock.

A large amount of this patch is trying to remove as much code that
refers to virtual registers as an int as possible. Instead, this
patch replaces them with the VirtualRegister class. There are also
a couple of new classes/enums added to JSC:

1) There is now a class, Operand, that represents the combination
of a VirtualRegister and a temporary. This is handy in the DFG to
model OSR exit values all together. Additionally, Operands<T> has
been updated to work with respect to Operand values.

2) CallFrameSlot is now an enum class instead of a struct of
constexpr values. This lets us implicitly convert CallFrameSlots
to VirtualRegisters without allowing all ints to implicity
convert.

3) FTL::SelectPredictability is a new enum that describes to the
FTL whether or not we think a select is going to be
predictable. SelectPredictability has four options: Unpredictable,
Predictable, LeftLikely, and RightLikely. Unpredictable means we
think a branch predictor won't do a good job guessing this value
so we should compile the select to a cmov. The other options mean
we either think we are going to pick the same value every time or
there's a reasonable chance the branch predictor will be able to
guess the value.

In order to validate the correctness of this patch the various
varargs call opcodes have been reworked to use checkpoints. This
also fixed a long-standing issue where we could call length
getters twice if we OSR exit during LoadVarargs but before the
actually call.

Lastly, we have not enabled the probe-based OSR exit for a long
time in production, thus this patch removes that code since it
would be a non-trivial amount of work to get checkpoints working
with probe OSR.

  • CMakeLists.txt:
  • DerivedSources-input.xcfilelist:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • assembler/MacroAssemblerCodeRef.h:
  • assembler/ProbeFrame.h:

(JSC::Probe::Frame::operand):
(JSC::Probe::Frame::setOperand):

  • b3/testb3.h:

(populateWithInterestingValues):
(floatingPointOperands):

  • bytecode/AccessCase.cpp:

(JSC::AccessCase::generateImpl):

  • bytecode/AccessCaseSnippetParams.cpp:

(JSC::SlowPathCallGeneratorWithArguments::generateImpl):

  • bytecode/BytecodeDumper.cpp:

(JSC::BytecodeDumperBase::dumpValue):
(JSC::BytecodeDumper<Block>::registerName const):
(JSC::BytecodeDumper<Block>::constantName const):
(JSC::Wasm::BytecodeDumper::constantName const):

  • bytecode/BytecodeDumper.h:
  • bytecode/BytecodeIndex.cpp:

(JSC::BytecodeIndex::dump const):

  • bytecode/BytecodeIndex.h:

(JSC::BytecodeIndex::BytecodeIndex):
(JSC::BytecodeIndex::offset const):
(JSC::BytecodeIndex::checkpoint const):
(JSC::BytecodeIndex::asBits const):
(JSC::BytecodeIndex::hash const):
(JSC::BytecodeIndex::operator bool const):
(JSC::BytecodeIndex::pack):
(JSC::BytecodeIndex::fromBits):

  • bytecode/BytecodeList.rb:
  • bytecode/BytecodeLivenessAnalysis.cpp:

(JSC::enumValuesEqualAsIntegral):
(JSC::tmpLivenessForCheckpoint):

  • bytecode/BytecodeLivenessAnalysis.h:
  • bytecode/BytecodeLivenessAnalysisInlines.h:

(JSC::virtualRegisterIsAlwaysLive):
(JSC::virtualRegisterThatIsNotAlwaysLiveIsLive):
(JSC::virtualRegisterIsLive):
(JSC::operandIsAlwaysLive): Deleted.
(JSC::operandThatIsNotAlwaysLiveIsLive): Deleted.
(JSC::operandIsLive): Deleted.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::bytecodeIndexForExit const):
(JSC::CodeBlock::ensureCatchLivenessIsComputedForBytecodeIndexSlow):
(JSC::CodeBlock::updateAllValueProfilePredictionsAndCountLiveness):

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::numTmps const):
(JSC::CodeBlock::isKnownNotImmediate):
(JSC::CodeBlock::isTemporaryRegister):
(JSC::CodeBlock::constantRegister):
(JSC::CodeBlock::getConstant const):
(JSC::CodeBlock::constantSourceCodeRepresentation const):
(JSC::CodeBlock::replaceConstant):
(JSC::CodeBlock::isTemporaryRegisterIndex): Deleted.
(JSC::CodeBlock::isConstantRegisterIndex): Deleted.

  • bytecode/CodeOrigin.h:
  • bytecode/FullBytecodeLiveness.h:

(JSC::FullBytecodeLiveness::virtualRegisterIsLive const):
(JSC::FullBytecodeLiveness::operandIsLive const): Deleted.

  • bytecode/InlineCallFrame.h:

(JSC::InlineCallFrame::InlineCallFrame):
(JSC::InlineCallFrame::setTmpOffset):
(JSC::CodeOrigin::walkUpInlineStack const):
(JSC::CodeOrigin::inlineStackContainsActiveCheckpoint const):
(JSC::remapOperand):
(JSC::unmapOperand):
(JSC::CodeOrigin::walkUpInlineStack): Deleted.

  • bytecode/LazyOperandValueProfile.h:

(JSC::LazyOperandValueProfileKey::LazyOperandValueProfileKey):
(JSC::LazyOperandValueProfileKey::hash const):
(JSC::LazyOperandValueProfileKey::operand const):

  • bytecode/MethodOfGettingAValueProfile.cpp:

(JSC::MethodOfGettingAValueProfile::fromLazyOperand):
(JSC::MethodOfGettingAValueProfile::emitReportValue const):
(JSC::MethodOfGettingAValueProfile::reportValue):

  • bytecode/MethodOfGettingAValueProfile.h:
  • bytecode/Operands.h:

(JSC::Operand::Operand):
(JSC::Operand::tmp):
(JSC::Operand::kind const):
(JSC::Operand::value const):
(JSC::Operand::virtualRegister const):
(JSC::Operand::asBits const):
(JSC::Operand::isTmp const):
(JSC::Operand::isArgument const):
(JSC::Operand::isLocal const):
(JSC::Operand::isHeader const):
(JSC::Operand::isConstant const):
(JSC::Operand::toArgument const):
(JSC::Operand::toLocal const):
(JSC::Operand::operator== const):
(JSC::Operand::isValid const):
(JSC::Operand::fromBits):
(JSC::Operands::Operands):
(JSC::Operands::numberOfLocals const):
(JSC::Operands::numberOfTmps const):
(JSC::Operands::tmpIndex const):
(JSC::Operands::argumentIndex const):
(JSC::Operands::localIndex const):
(JSC::Operands::tmp):
(JSC::Operands::tmp const):
(JSC::Operands::argument):
(JSC::Operands::argument const):
(JSC::Operands::local):
(JSC::Operands::local const):
(JSC::Operands::sizeFor const):
(JSC::Operands::atFor):
(JSC::Operands::atFor const):
(JSC::Operands::ensureLocals):
(JSC::Operands::ensureTmps):
(JSC::Operands::getForOperandIndex):
(JSC::Operands::getForOperandIndex const):
(JSC::Operands::operandIndex const):
(JSC::Operands::operand):
(JSC::Operands::operand const):
(JSC::Operands::hasOperand const):
(JSC::Operands::setOperand):
(JSC::Operands::at const):
(JSC::Operands::at):
(JSC::Operands::operator[] const):
(JSC::Operands::operator[]):
(JSC::Operands::operandForIndex const):
(JSC::Operands::operator== const):
(JSC::Operands::isArgument const): Deleted.
(JSC::Operands::isLocal const): Deleted.
(JSC::Operands::virtualRegisterForIndex const): Deleted.
(JSC::Operands::setOperandFirstTime): Deleted.

  • bytecode/OperandsInlines.h:

(JSC::Operand::dump const):
(JSC::Operands<T>::dumpInContext const):
(JSC::Operands<T>::dump const):

  • bytecode/UnlinkedCodeBlock.cpp:

(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):

  • bytecode/UnlinkedCodeBlock.h:

(JSC::UnlinkedCodeBlock::hasCheckpoints const):
(JSC::UnlinkedCodeBlock::setHasCheckpoints):
(JSC::UnlinkedCodeBlock::constantRegister const):
(JSC::UnlinkedCodeBlock::getConstant const):
(JSC::UnlinkedCodeBlock::isConstantRegisterIndex const): Deleted.

  • bytecode/ValueProfile.h:

(JSC::ValueProfileAndVirtualRegisterBuffer::ValueProfileAndVirtualRegisterBuffer):
(JSC::ValueProfileAndVirtualRegisterBuffer::~ValueProfileAndVirtualRegisterBuffer):
(JSC::ValueProfileAndOperandBuffer::ValueProfileAndOperandBuffer): Deleted.
(JSC::ValueProfileAndOperandBuffer::~ValueProfileAndOperandBuffer): Deleted.
(JSC::ValueProfileAndOperandBuffer::forEach): Deleted.

  • bytecode/ValueRecovery.cpp:

(JSC::ValueRecovery::recover const):

  • bytecode/ValueRecovery.h:
  • bytecode/VirtualRegister.h:

(JSC::virtualRegisterIsLocal):
(JSC::virtualRegisterIsArgument):
(JSC::VirtualRegister::VirtualRegister):
(JSC::VirtualRegister::isValid const):
(JSC::VirtualRegister::isLocal const):
(JSC::VirtualRegister::isArgument const):
(JSC::VirtualRegister::isConstant const):
(JSC::VirtualRegister::toConstantIndex const):
(JSC::operandIsLocal): Deleted.
(JSC::operandIsArgument): Deleted.

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::initializeNextParameter):
(JSC::BytecodeGenerator::initializeParameters):
(JSC::BytecodeGenerator::emitEqualityOpImpl):
(JSC::BytecodeGenerator::emitCallVarargs):

  • bytecompiler/BytecodeGenerator.h:

(JSC::BytecodeGenerator::setUsesCheckpoints):

  • bytecompiler/RegisterID.h:

(JSC::RegisterID::setIndex):

  • dfg/DFGAbstractHeap.cpp:

(JSC::DFG::AbstractHeap::Payload::dumpAsOperand const):
(JSC::DFG::AbstractHeap::dump const):

  • dfg/DFGAbstractHeap.h:

(JSC::DFG::AbstractHeap::Payload::Payload):
(JSC::DFG::AbstractHeap::AbstractHeap):
(JSC::DFG::AbstractHeap::operand const):

  • dfg/DFGAbstractInterpreterInlines.h:

(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

  • dfg/DFGArgumentPosition.h:

(JSC::DFG::ArgumentPosition::dump):

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

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

  • dfg/DFGArgumentsUtilities.h:
  • dfg/DFGAtTailAbstractState.h:

(JSC::DFG::AtTailAbstractState::operand):

  • dfg/DFGAvailabilityMap.cpp:

(JSC::DFG::AvailabilityMap::pruneByLiveness):

  • dfg/DFGAvailabilityMap.h:

(JSC::DFG::AvailabilityMap::closeStartingWithLocal):

  • dfg/DFGBasicBlock.cpp:

(JSC::DFG::BasicBlock::BasicBlock):
(JSC::DFG::BasicBlock::ensureTmps):

  • dfg/DFGBasicBlock.h:
  • dfg/DFGBlockInsertionSet.cpp:

(JSC::DFG::BlockInsertionSet::insert):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::ByteCodeParser):
(JSC::DFG::ByteCodeParser::ensureTmps):
(JSC::DFG::ByteCodeParser::progressToNextCheckpoint):
(JSC::DFG::ByteCodeParser::newVariableAccessData):
(JSC::DFG::ByteCodeParser::getDirect):
(JSC::DFG::ByteCodeParser::get):
(JSC::DFG::ByteCodeParser::setDirect):
(JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation):
(JSC::DFG::ByteCodeParser::getLocalOrTmp):
(JSC::DFG::ByteCodeParser::setLocalOrTmp):
(JSC::DFG::ByteCodeParser::setArgument):
(JSC::DFG::ByteCodeParser::findArgumentPositionForLocal):
(JSC::DFG::ByteCodeParser::findArgumentPosition):
(JSC::DFG::ByteCodeParser::flushImpl):
(JSC::DFG::ByteCodeParser::flushForTerminalImpl):
(JSC::DFG::ByteCodeParser::flush):
(JSC::DFG::ByteCodeParser::flushDirect):
(JSC::DFG::ByteCodeParser::addFlushOrPhantomLocal):
(JSC::DFG::ByteCodeParser::phantomLocalDirect):
(JSC::DFG::ByteCodeParser::flushForTerminal):
(JSC::DFG::ByteCodeParser::addToGraph):
(JSC::DFG::ByteCodeParser::InlineStackEntry::remapOperand const):
(JSC::DFG::ByteCodeParser::DelayedSetLocal::DelayedSetLocal):
(JSC::DFG::ByteCodeParser::DelayedSetLocal::execute):
(JSC::DFG::ByteCodeParser::allocateTargetableBlock):
(JSC::DFG::ByteCodeParser::allocateUntargetableBlock):
(JSC::DFG::ByteCodeParser::handleRecursiveTailCall):
(JSC::DFG::ByteCodeParser::inlineCall):
(JSC::DFG::ByteCodeParser::handleVarargsInlining):
(JSC::DFG::ByteCodeParser::handleInlining):
(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
(JSC::DFG::ByteCodeParser::parse):
(JSC::DFG::ByteCodeParser::getLocal): Deleted.
(JSC::DFG::ByteCodeParser::setLocal): Deleted.

  • dfg/DFGCFAPhase.cpp:

(JSC::DFG::CFAPhase::injectOSR):

  • dfg/DFGCPSRethreadingPhase.cpp:

(JSC::DFG::CPSRethreadingPhase::run):
(JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocal):
(JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
(JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocal):
(JSC::DFG::CPSRethreadingPhase::canonicalizeSet):
(JSC::DFG::CPSRethreadingPhase::canonicalizeLocalsInBlock):
(JSC::DFG::CPSRethreadingPhase::propagatePhis):
(JSC::DFG::CPSRethreadingPhase::phiStackFor):

  • dfg/DFGCSEPhase.cpp:
  • dfg/DFGCapabilities.cpp:

(JSC::DFG::capabilityLevel):

  • dfg/DFGClobberize.h:

(JSC::DFG::clobberize):

  • dfg/DFGCombinedLiveness.cpp:

(JSC::DFG::addBytecodeLiveness):

  • dfg/DFGCommonData.cpp:

(JSC::DFG::CommonData::addCodeOrigin):
(JSC::DFG::CommonData::addUniqueCallSiteIndex):
(JSC::DFG::CommonData::lastCallSite const):

  • dfg/DFGConstantFoldingPhase.cpp:

(JSC::DFG::ConstantFoldingPhase::foldConstants):

  • dfg/DFGDoesGC.cpp:

(JSC::DFG::doesGC):

  • dfg/DFGDriver.cpp:

(JSC::DFG::compileImpl):

  • dfg/DFGFixupPhase.cpp:

(JSC::DFG::FixupPhase::fixupNode):

  • dfg/DFGForAllKills.h:

(JSC::DFG::forAllKilledOperands):
(JSC::DFG::forAllKilledNodesAtNodeIndex):
(JSC::DFG::forAllKillsInBlock):

  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::dump):
(JSC::DFG::Graph::dumpBlockHeader):
(JSC::DFG::Graph::substituteGetLocal):
(JSC::DFG::Graph::isLiveInBytecode):
(JSC::DFG::Graph::localsAndTmpsLiveInBytecode):
(JSC::DFG::Graph::methodOfGettingAValueProfileFor):
(JSC::DFG::Graph::localsLiveInBytecode): Deleted.

  • dfg/DFGGraph.h:

(JSC::DFG::Graph::forAllLocalsAndTmpsLiveInBytecode):
(JSC::DFG::Graph::forAllLiveInBytecode):
(JSC::DFG::Graph::forAllLocalsLiveInBytecode): Deleted.

  • dfg/DFGInPlaceAbstractState.cpp:

(JSC::DFG::InPlaceAbstractState::InPlaceAbstractState):

  • dfg/DFGInPlaceAbstractState.h:

(JSC::DFG::InPlaceAbstractState::operand):

  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::linkOSRExits):
(JSC::DFG::JITCompiler::noticeOSREntry):

  • dfg/DFGJITCompiler.h:

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

  • dfg/DFGLiveCatchVariablePreservationPhase.cpp:

(JSC::DFG::LiveCatchVariablePreservationPhase::isValidFlushLocation):
(JSC::DFG::LiveCatchVariablePreservationPhase::handleBlockForTryCatch):
(JSC::DFG::LiveCatchVariablePreservationPhase::newVariableAccessData):

  • dfg/DFGMovHintRemovalPhase.cpp:
  • dfg/DFGNode.h:

(JSC::DFG::StackAccessData::StackAccessData):
(JSC::DFG::Node::hasArgumentsChild):
(JSC::DFG::Node::argumentsChild):
(JSC::DFG::Node::operand):
(JSC::DFG::Node::hasUnlinkedOperand):
(JSC::DFG::Node::unlinkedOperand):
(JSC::DFG::Node::hasLoadVarargsData):
(JSC::DFG::Node::local): Deleted.
(JSC::DFG::Node::hasUnlinkedLocal): Deleted.
(JSC::DFG::Node::unlinkedLocal): Deleted.

  • dfg/DFGNodeType.h:
  • dfg/DFGOSRAvailabilityAnalysisPhase.cpp:

(JSC::DFG::OSRAvailabilityAnalysisPhase::run):
(JSC::DFG::LocalOSRAvailabilityCalculator::executeNode):

  • dfg/DFGOSREntry.cpp:

(JSC::DFG::prepareOSREntry):
(JSC::DFG::prepareCatchOSREntry):

  • dfg/DFGOSREntrypointCreationPhase.cpp:

(JSC::DFG::OSREntrypointCreationPhase::run):

  • dfg/DFGOSRExit.cpp:

(JSC::DFG::OSRExit::emitRestoreArguments):
(JSC::DFG::OSRExit::compileExit):
(JSC::DFG::jsValueFor): Deleted.
(JSC::DFG::restoreCalleeSavesFor): Deleted.
(JSC::DFG::saveCalleeSavesFor): Deleted.
(JSC::DFG::restoreCalleeSavesFromVMEntryFrameCalleeSavesBuffer): Deleted.
(JSC::DFG::copyCalleeSavesToVMEntryFrameCalleeSavesBuffer): Deleted.
(JSC::DFG::saveOrCopyCalleeSavesFor): Deleted.
(JSC::DFG::createDirectArgumentsDuringExit): Deleted.
(JSC::DFG::createClonedArgumentsDuringExit): Deleted.
(JSC::DFG::emitRestoreArguments): Deleted.
(JSC::DFG::OSRExit::executeOSRExit): Deleted.
(JSC::DFG::reifyInlinedCallFrames): Deleted.
(JSC::DFG::adjustAndJumpToTarget): Deleted.
(JSC::DFG::printOSRExit): Deleted.

  • dfg/DFGOSRExit.h:
  • dfg/DFGOSRExitBase.h:

(JSC::DFG::OSRExitBase::isExitingToCheckpointHandler const):

  • dfg/DFGOSRExitCompilerCommon.cpp:

(JSC::DFG::callerReturnPC):
(JSC::DFG::reifyInlinedCallFrames):
(JSC::DFG::adjustAndJumpToTarget):

  • dfg/DFGObjectAllocationSinkingPhase.cpp:
  • dfg/DFGOpInfo.h:

(JSC::DFG::OpInfo::OpInfo):

  • dfg/DFGOperations.cpp:
  • dfg/DFGPhantomInsertionPhase.cpp:
  • dfg/DFGPreciseLocalClobberize.h:

(JSC::DFG::PreciseLocalClobberizeAdaptor::read):
(JSC::DFG::PreciseLocalClobberizeAdaptor::write):
(JSC::DFG::PreciseLocalClobberizeAdaptor::def):
(JSC::DFG::PreciseLocalClobberizeAdaptor::callIfAppropriate):

  • dfg/DFGPredictionInjectionPhase.cpp:

(JSC::DFG::PredictionInjectionPhase::run):

  • dfg/DFGPredictionPropagationPhase.cpp:
  • dfg/DFGPutStackSinkingPhase.cpp:
  • dfg/DFGSSAConversionPhase.cpp:

(JSC::DFG::SSAConversionPhase::run):

  • dfg/DFGSafeToExecute.h:

(JSC::DFG::safeToExecute):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileMovHint):
(JSC::DFG::SpeculativeJIT::compileCurrentBlock):
(JSC::DFG::SpeculativeJIT::checkArgumentTypes):
(JSC::DFG::SpeculativeJIT::compileVarargsLength):
(JSC::DFG::SpeculativeJIT::compileLoadVarargs):
(JSC::DFG::SpeculativeJIT::compileForwardVarargs):
(JSC::DFG::SpeculativeJIT::compileCreateDirectArguments):
(JSC::DFG::SpeculativeJIT::compileGetArgumentCountIncludingThis):

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::recordSetLocal):

  • dfg/DFGSpeculativeJIT32_64.cpp:

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

  • dfg/DFGSpeculativeJIT64.cpp:

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

  • dfg/DFGStackLayoutPhase.cpp:

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

  • dfg/DFGStrengthReductionPhase.cpp:

(JSC::DFG::StrengthReductionPhase::handleNode):

  • dfg/DFGThunks.cpp:

(JSC::DFG::osrExitThunkGenerator): Deleted.

  • dfg/DFGThunks.h:
  • dfg/DFGTypeCheckHoistingPhase.cpp:

(JSC::DFG::TypeCheckHoistingPhase::run):
(JSC::DFG::TypeCheckHoistingPhase::disableHoistingAcrossOSREntries):

  • dfg/DFGValidate.cpp:
  • dfg/DFGVarargsForwardingPhase.cpp:
  • dfg/DFGVariableAccessData.cpp:

(JSC::DFG::VariableAccessData::VariableAccessData):
(JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
(JSC::DFG::VariableAccessData::tallyVotesForShouldUseDoubleFormat):
(JSC::DFG::VariableAccessData::couldRepresentInt52Impl):

  • dfg/DFGVariableAccessData.h:

(JSC::DFG::VariableAccessData::operand):
(JSC::DFG::VariableAccessData::local): Deleted.

  • dfg/DFGVariableEvent.cpp:

(JSC::DFG::VariableEvent::dump const):

  • dfg/DFGVariableEvent.h:

(JSC::DFG::VariableEvent::spill):
(JSC::DFG::VariableEvent::setLocal):
(JSC::DFG::VariableEvent::movHint):
(JSC::DFG::VariableEvent::spillRegister const):
(JSC::DFG::VariableEvent::operand const):
(JSC::DFG::VariableEvent::bytecodeRegister const): Deleted.

  • dfg/DFGVariableEventStream.cpp:

(JSC::DFG::VariableEventStream::logEvent):
(JSC::DFG::VariableEventStream::reconstruct const):

  • dfg/DFGVariableEventStream.h:

(JSC::DFG::VariableEventStream::appendAndLog):

  • ftl/FTLCapabilities.cpp:

(JSC::FTL::canCompile):

  • ftl/FTLForOSREntryJITCode.cpp:

(JSC::FTL::ForOSREntryJITCode::ForOSREntryJITCode):

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::lower):
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileExtractOSREntryLocal):
(JSC::FTL::DFG::LowerDFGToB3::compileGetStack):
(JSC::FTL::DFG::LowerDFGToB3::compileGetCallee):
(JSC::FTL::DFG::LowerDFGToB3::compileSetCallee):
(JSC::FTL::DFG::LowerDFGToB3::compileSetArgumentCountIncludingThis):
(JSC::FTL::DFG::LowerDFGToB3::compileVarargsLength):
(JSC::FTL::DFG::LowerDFGToB3::compileLoadVarargs):
(JSC::FTL::DFG::LowerDFGToB3::compileForwardVarargs):
(JSC::FTL::DFG::LowerDFGToB3::getSpreadLengthFromInlineCallFrame):
(JSC::FTL::DFG::LowerDFGToB3::compileForwardVarargsWithSpread):
(JSC::FTL::DFG::LowerDFGToB3::compileLogShadowChickenPrologue):
(JSC::FTL::DFG::LowerDFGToB3::getArgumentsLength):
(JSC::FTL::DFG::LowerDFGToB3::getCurrentCallee):
(JSC::FTL::DFG::LowerDFGToB3::callPreflight):
(JSC::FTL::DFG::LowerDFGToB3::appendOSRExitDescriptor):
(JSC::FTL::DFG::LowerDFGToB3::buildExitArguments):
(JSC::FTL::DFG::LowerDFGToB3::addressFor):
(JSC::FTL::DFG::LowerDFGToB3::payloadFor):
(JSC::FTL::DFG::LowerDFGToB3::tagFor):

  • ftl/FTLOSREntry.cpp:

(JSC::FTL::prepareOSREntry):

  • ftl/FTLOSRExit.cpp:

(JSC::FTL::OSRExitDescriptor::OSRExitDescriptor):

  • ftl/FTLOSRExit.h:
  • ftl/FTLOSRExitCompiler.cpp:

(JSC::FTL::compileStub):

  • ftl/FTLOperations.cpp:

(JSC::FTL::operationMaterializeObjectInOSR):

  • ftl/FTLOutput.cpp:

(JSC::FTL::Output::select):

  • ftl/FTLOutput.h:
  • ftl/FTLSelectPredictability.h: Copied from Source/JavaScriptCore/ftl/FTLForOSREntryJITCode.cpp.
  • ftl/FTLSlowPathCall.h:

(JSC::FTL::callOperation):

  • generator/Checkpoints.rb: Added.
  • generator/Opcode.rb:
  • generator/Section.rb:
  • heap/Heap.cpp:

(JSC::Heap::gatherStackRoots):

  • interpreter/CallFrame.cpp:

(JSC::CallFrame::callSiteAsRawBits const):
(JSC::CallFrame::unsafeCallSiteAsRawBits const):
(JSC::CallFrame::callSiteIndex const):
(JSC::CallFrame::unsafeCallSiteIndex const):
(JSC::CallFrame::setCurrentVPC):
(JSC::CallFrame::bytecodeIndex):
(JSC::CallFrame::codeOrigin):

  • interpreter/CallFrame.h:

(JSC::CallSiteIndex::CallSiteIndex):
(JSC::CallSiteIndex::operator bool const):
(JSC::CallSiteIndex::operator== const):
(JSC::CallSiteIndex::bits const):
(JSC::CallSiteIndex::fromBits):
(JSC::CallSiteIndex::bytecodeIndex const):
(JSC::DisposableCallSiteIndex::DisposableCallSiteIndex):
(JSC::CallFrame::callee const):
(JSC::CallFrame::unsafeCallee const):
(JSC::CallFrame::addressOfCodeBlock const):
(JSC::CallFrame::argumentCountIncludingThis const):
(JSC::CallFrame::offsetFor):
(JSC::CallFrame::setArgumentCountIncludingThis):
(JSC::CallFrame::setReturnPC):

  • interpreter/CallFrameInlines.h:

(JSC::CallFrame::r):
(JSC::CallFrame::uncheckedR):
(JSC::CallFrame::guaranteedJSValueCallee const):
(JSC::CallFrame::jsCallee const):
(JSC::CallFrame::codeBlock const):
(JSC::CallFrame::unsafeCodeBlock const):
(JSC::CallFrame::setCallee):
(JSC::CallFrame::setCodeBlock):

  • interpreter/CheckpointOSRExitSideState.h: Copied from Source/JavaScriptCore/dfg/DFGThunks.h.
  • interpreter/Interpreter.cpp:

(JSC::eval):
(JSC::sizeOfVarargs):
(JSC::loadVarargs):
(JSC::setupVarargsFrame):
(JSC::UnwindFunctor::operator() const):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):

  • interpreter/Interpreter.h:
  • interpreter/StackVisitor.cpp:

(JSC::StackVisitor::readInlinedFrame):

  • jit/AssemblyHelpers.h:

(JSC::AssemblyHelpers::emitGetFromCallFrameHeaderPtr):
(JSC::AssemblyHelpers::emitGetFromCallFrameHeader32):
(JSC::AssemblyHelpers::emitGetFromCallFrameHeader64):
(JSC::AssemblyHelpers::emitPutToCallFrameHeader):
(JSC::AssemblyHelpers::emitPutToCallFrameHeaderBeforePrologue):
(JSC::AssemblyHelpers::emitPutPayloadToCallFrameHeaderBeforePrologue):
(JSC::AssemblyHelpers::emitPutTagToCallFrameHeaderBeforePrologue):
(JSC::AssemblyHelpers::addressFor):
(JSC::AssemblyHelpers::tagFor):
(JSC::AssemblyHelpers::payloadFor):
(JSC::AssemblyHelpers::calleeFrameSlot):
(JSC::AssemblyHelpers::calleeArgumentSlot):
(JSC::AssemblyHelpers::calleeFrameTagSlot):
(JSC::AssemblyHelpers::calleeFramePayloadSlot):
(JSC::AssemblyHelpers::calleeFrameCallerFrame):
(JSC::AssemblyHelpers::argumentCount):

  • jit/CallFrameShuffler.cpp:

(JSC::CallFrameShuffler::CallFrameShuffler):

  • jit/CallFrameShuffler.h:

(JSC::CallFrameShuffler::setCalleeJSValueRegs):
(JSC::CallFrameShuffler::assumeCalleeIsCell):

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

(JSC::JIT::emit_op_unsigned):
(JSC::JIT::emit_compareAndJump):
(JSC::JIT::emit_compareAndJumpImpl):
(JSC::JIT::emit_compareUnsignedAndJump):
(JSC::JIT::emit_compareUnsignedAndJumpImpl):
(JSC::JIT::emit_compareUnsigned):
(JSC::JIT::emit_compareUnsignedImpl):
(JSC::JIT::emit_compareAndJumpSlow):
(JSC::JIT::emit_compareAndJumpSlowImpl):
(JSC::JIT::emit_op_inc):
(JSC::JIT::emit_op_dec):
(JSC::JIT::emit_op_mod):
(JSC::JIT::emitBitBinaryOpFastPath):
(JSC::JIT::emit_op_bitnot):
(JSC::JIT::emitRightShiftFastPath):
(JSC::JIT::emitMathICFast):
(JSC::JIT::emitMathICSlow):
(JSC::JIT::emit_op_div):

  • jit/JITCall.cpp:

(JSC::JIT::emitPutCallResult):
(JSC::JIT::compileSetupFrame):
(JSC::JIT::compileOpCall):

  • jit/JITExceptions.cpp:

(JSC::genericUnwind):

  • jit/JITInlines.h:

(JSC::JIT::isOperandConstantDouble):
(JSC::JIT::getConstantOperand):
(JSC::JIT::emitPutIntToCallFrameHeader):
(JSC::JIT::appendCallWithExceptionCheckSetJSValueResult):
(JSC::JIT::appendCallWithExceptionCheckSetJSValueResultWithProfile):
(JSC::JIT::linkSlowCaseIfNotJSCell):
(JSC::JIT::isOperandConstantChar):
(JSC::JIT::getOperandConstantInt):
(JSC::JIT::getOperandConstantDouble):
(JSC::JIT::emitInitRegister):
(JSC::JIT::emitLoadTag):
(JSC::JIT::emitLoadPayload):
(JSC::JIT::emitGet):
(JSC::JIT::emitPutVirtualRegister):
(JSC::JIT::emitLoad):
(JSC::JIT::emitLoad2):
(JSC::JIT::emitLoadDouble):
(JSC::JIT::emitLoadInt32ToDouble):
(JSC::JIT::emitStore):
(JSC::JIT::emitStoreInt32):
(JSC::JIT::emitStoreCell):
(JSC::JIT::emitStoreBool):
(JSC::JIT::emitStoreDouble):
(JSC::JIT::emitJumpSlowCaseIfNotJSCell):
(JSC::JIT::isOperandConstantInt):
(JSC::JIT::emitGetVirtualRegister):
(JSC::JIT::emitGetVirtualRegisters):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_mov):
(JSC::JIT::emit_op_end):
(JSC::JIT::emit_op_new_object):
(JSC::JIT::emitSlow_op_new_object):
(JSC::JIT::emit_op_overrides_has_instance):
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof):
(JSC::JIT::emit_op_is_empty):
(JSC::JIT::emit_op_is_undefined):
(JSC::JIT::emit_op_is_undefined_or_null):
(JSC::JIT::emit_op_is_boolean):
(JSC::JIT::emit_op_is_number):
(JSC::JIT::emit_op_is_cell_with_type):
(JSC::JIT::emit_op_is_object):
(JSC::JIT::emit_op_ret):
(JSC::JIT::emit_op_to_primitive):
(JSC::JIT::emit_op_set_function_name):
(JSC::JIT::emit_op_not):
(JSC::JIT::emit_op_jfalse):
(JSC::JIT::emit_op_jeq_null):
(JSC::JIT::emit_op_jneq_null):
(JSC::JIT::emit_op_jundefined_or_null):
(JSC::JIT::emit_op_jnundefined_or_null):
(JSC::JIT::emit_op_jneq_ptr):
(JSC::JIT::emit_op_eq):
(JSC::JIT::emit_op_jeq):
(JSC::JIT::emit_op_jtrue):
(JSC::JIT::emit_op_neq):
(JSC::JIT::emit_op_jneq):
(JSC::JIT::emit_op_throw):
(JSC::JIT::compileOpStrictEq):
(JSC::JIT::compileOpStrictEqJump):
(JSC::JIT::emit_op_to_number):
(JSC::JIT::emit_op_to_numeric):
(JSC::JIT::emit_op_to_string):
(JSC::JIT::emit_op_to_object):
(JSC::JIT::emit_op_catch):
(JSC::JIT::emit_op_get_parent_scope):
(JSC::JIT::emit_op_switch_imm):
(JSC::JIT::emit_op_switch_char):
(JSC::JIT::emit_op_switch_string):
(JSC::JIT::emit_op_eq_null):
(JSC::JIT::emit_op_neq_null):
(JSC::JIT::emit_op_enter):
(JSC::JIT::emit_op_get_scope):
(JSC::JIT::emit_op_to_this):
(JSC::JIT::emit_op_create_this):
(JSC::JIT::emit_op_check_tdz):
(JSC::JIT::emitSlow_op_eq):
(JSC::JIT::emitSlow_op_neq):
(JSC::JIT::emitSlow_op_instanceof_custom):
(JSC::JIT::emit_op_new_regexp):
(JSC::JIT::emitNewFuncCommon):
(JSC::JIT::emitNewFuncExprCommon):
(JSC::JIT::emit_op_new_array):
(JSC::JIT::emit_op_new_array_with_size):
(JSC::JIT::emit_op_has_structure_property):
(JSC::JIT::emit_op_has_indexed_property):
(JSC::JIT::emitSlow_op_has_indexed_property):
(JSC::JIT::emit_op_get_direct_pname):
(JSC::JIT::emit_op_enumerator_structure_pname):
(JSC::JIT::emit_op_enumerator_generic_pname):
(JSC::JIT::emit_op_profile_type):
(JSC::JIT::emit_op_log_shadow_chicken_prologue):
(JSC::JIT::emit_op_log_shadow_chicken_tail):
(JSC::JIT::emit_op_argument_count):
(JSC::JIT::emit_op_get_rest_length):
(JSC::JIT::emit_op_get_argument):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emit_op_catch):

  • jit/JITOperations.cpp:
  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emitSlow_op_get_by_val):
(JSC::JIT::emit_op_put_by_val):
(JSC::JIT::emitGenericContiguousPutByVal):
(JSC::JIT::emitArrayStoragePutByVal):
(JSC::JIT::emitPutByValWithCachedId):
(JSC::JIT::emitSlow_op_put_by_val):
(JSC::JIT::emit_op_put_getter_by_id):
(JSC::JIT::emit_op_put_setter_by_id):
(JSC::JIT::emit_op_put_getter_setter_by_id):
(JSC::JIT::emit_op_put_getter_by_val):
(JSC::JIT::emit_op_put_setter_by_val):
(JSC::JIT::emit_op_del_by_id):
(JSC::JIT::emit_op_del_by_val):
(JSC::JIT::emit_op_try_get_by_id):
(JSC::JIT::emitSlow_op_try_get_by_id):
(JSC::JIT::emit_op_get_by_id_direct):
(JSC::JIT::emitSlow_op_get_by_id_direct):
(JSC::JIT::emit_op_get_by_id):
(JSC::JIT::emit_op_get_by_id_with_this):
(JSC::JIT::emitSlow_op_get_by_id):
(JSC::JIT::emitSlow_op_get_by_id_with_this):
(JSC::JIT::emit_op_put_by_id):
(JSC::JIT::emit_op_in_by_id):
(JSC::JIT::emitSlow_op_in_by_id):
(JSC::JIT::emitResolveClosure):
(JSC::JIT::emit_op_resolve_scope):
(JSC::JIT::emitLoadWithStructureCheck):
(JSC::JIT::emitGetClosureVar):
(JSC::JIT::emit_op_get_from_scope):
(JSC::JIT::emitSlow_op_get_from_scope):
(JSC::JIT::emitPutGlobalVariable):
(JSC::JIT::emitPutGlobalVariableIndirect):
(JSC::JIT::emitPutClosureVar):
(JSC::JIT::emit_op_put_to_scope):
(JSC::JIT::emit_op_get_from_arguments):
(JSC::JIT::emit_op_put_to_arguments):
(JSC::JIT::emitWriteBarrier):
(JSC::JIT::emit_op_get_internal_field):
(JSC::JIT::emit_op_put_internal_field):
(JSC::JIT::emitIntTypedArrayPutByVal):
(JSC::JIT::emitFloatTypedArrayPutByVal):

  • jit/JSInterfaceJIT.h:

(JSC::JSInterfaceJIT::emitLoadJSCell):
(JSC::JSInterfaceJIT::emitJumpIfNotJSCell):
(JSC::JSInterfaceJIT::emitLoadInt32):
(JSC::JSInterfaceJIT::emitLoadDouble):
(JSC::JSInterfaceJIT::emitGetFromCallFrameHeaderPtr):
(JSC::JSInterfaceJIT::emitPutToCallFrameHeader):
(JSC::JSInterfaceJIT::emitPutCellToCallFrameHeader):

  • jit/SetupVarargsFrame.cpp:

(JSC::emitSetupVarargsFrameFastCase):

  • jit/SpecializedThunkJIT.h:

(JSC::SpecializedThunkJIT::loadDoubleArgument):
(JSC::SpecializedThunkJIT::loadCellArgument):
(JSC::SpecializedThunkJIT::loadInt32Argument):

  • jit/ThunkGenerators.cpp:

(JSC::absThunkGenerator):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::getNonConstantOperand):
(JSC::LLInt::getOperand):
(JSC::LLInt::genericCall):
(JSC::LLInt::varargsSetup):
(JSC::LLInt::commonCallEval):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(JSC::LLInt::handleVarargsCheckpoint):
(JSC::LLInt::dispatchToNextInstruction):
(JSC::LLInt::slow_path_checkpoint_osr_exit_from_inlined_call):
(JSC::LLInt::slow_path_checkpoint_osr_exit):
(JSC::LLInt::llint_throw_stack_overflow_error):

  • llint/LLIntSlowPaths.h:
  • llint/LowLevelInterpreter.asm:
  • llint/LowLevelInterpreter32_64.asm:
  • llint/LowLevelInterpreter64.asm:
  • runtime/ArgList.h:

(JSC::MarkedArgumentBuffer::fill):

  • runtime/CachedTypes.cpp:

(JSC::CachedCodeBlock::hasCheckpoints const):
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
(JSC::CachedCodeBlock<CodeBlockType>::encode):

  • runtime/CommonSlowPaths.cpp:

(JSC::SLOW_PATH_DECL):

  • runtime/ConstructData.cpp:

(JSC::construct):

  • runtime/ConstructData.h:
  • runtime/DirectArguments.cpp:

(JSC::DirectArguments::copyToArguments):

  • runtime/DirectArguments.h:
  • runtime/GenericArguments.h:
  • runtime/GenericArgumentsInlines.h:

(JSC::GenericArguments<Type>::copyToArguments):

  • runtime/JSArray.cpp:

(JSC::JSArray::copyToArguments):

  • runtime/JSArray.h:
  • runtime/JSImmutableButterfly.cpp:

(JSC::JSImmutableButterfly::copyToArguments):

  • runtime/JSImmutableButterfly.h:
  • runtime/JSLock.cpp:

(JSC::JSLock::willReleaseLock):

  • runtime/ModuleProgramExecutable.cpp:

(JSC::ModuleProgramExecutable::create):

  • runtime/Options.cpp:

(JSC::recomputeDependentOptions):

  • runtime/ScopedArguments.cpp:

(JSC::ScopedArguments::copyToArguments):

  • runtime/ScopedArguments.h:
  • runtime/VM.cpp:

(JSC::VM::addCheckpointOSRSideState):
(JSC::VM::findCheckpointOSRSideState):
(JSC::VM::scanSideState const):

  • runtime/VM.h:

(JSC::VM::hasCheckpointOSRSideState const):

  • tools/VMInspector.cpp:

(JSC::VMInspector::dumpRegisters):

  • wasm/WasmFunctionCodeBlock.h:

(JSC::Wasm::FunctionCodeBlock::getConstant const):
(JSC::Wasm::FunctionCodeBlock::getConstantType const):

  • wasm/WasmLLIntGenerator.cpp:

(JSC::Wasm::LLIntGenerator::setUsesCheckpoints const):

  • wasm/WasmOperations.cpp:

(JSC::Wasm::operationWasmToJSException):

  • wasm/WasmSlowPaths.cpp:

Source/WTF:

  • WTF.xcodeproj/project.pbxproj:
  • wtf/Bitmap.h:

(WTF::WordType>::invert):
(WTF::WordType>::operator):
(WTF::WordType>::operator const const):

  • wtf/CMakeLists.txt:
  • wtf/EnumClassOperatorOverloads.h: Added.
  • wtf/FastBitVector.h:

(WTF::FastBitReference::operator bool const):
(WTF::FastBitReference::operator|=):
(WTF::FastBitReference::operator&=):
(WTF::FastBitVector::fill):
(WTF::FastBitVector::grow):

  • wtf/UnalignedAccess.h:

(WTF::unalignedLoad):
(WTF::unalignedStore):

Tools:

  • Scripts/run-jsc-stress-tests:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r253867 r253896  
    112112        , m_numArguments(m_codeBlock->numParameters())
    113113        , m_numLocals(m_codeBlock->numCalleeLocals())
     114        , m_numTmps(m_codeBlock->numTmps())
    114115        , m_parameterSlots(0)
    115116        , m_numPassedVarArgs(0)
     
    139140            m_graph.block(i)->ensureLocals(newNumLocals);
    140141    }
     142
     143    void ensureTmps(unsigned newNumTmps)
     144    {
     145        VERBOSE_LOG("   ensureTmps: trying to raise m_numTmps from ", m_numTmps, " to ", newNumTmps, "\n");
     146        if (newNumTmps <= m_numTmps)
     147            return;
     148        m_numTmps = newNumTmps;
     149        for (size_t i = 0; i < m_graph.numBlocks(); ++i)
     150            m_graph.block(i)->ensureTmps(newNumTmps);
     151    }
     152
    141153
    142154    // Helper for min and max.
     
    271283    void linkBlocks(Vector<BasicBlock*>& unlinkedBlocks, Vector<BasicBlock*>& possibleTargets);
    272284   
    273     VariableAccessData* newVariableAccessData(VirtualRegister operand)
     285    void progressToNextCheckpoint()
     286    {
     287        m_currentIndex = BytecodeIndex(m_currentIndex.offset(), m_currentIndex.checkpoint() + 1);
     288        // At this point, it's again OK to OSR exit.
     289        m_exitOK = true;
     290        addToGraph(ExitOK);
     291
     292        processSetLocalQueue();
     293    }
     294
     295    VariableAccessData* newVariableAccessData(Operand operand)
    274296    {
    275297        ASSERT(!operand.isConstant());
     
    280302   
    281303    // Get/Set the operands/result of a bytecode instruction.
    282     Node* getDirect(VirtualRegister operand)
     304    Node* getDirect(Operand operand)
    283305    {
    284306        ASSERT(!operand.isConstant());
    285307
    286         // Is this an argument?
    287308        if (operand.isArgument())
    288             return getArgument(operand);
    289 
    290         // Must be a local.
    291         return getLocal(operand);
     309            return getArgument(operand.virtualRegister());
     310
     311        return getLocalOrTmp(operand);
    292312    }
    293313
     
    299319            if (constantIndex >= oldSize || !m_constants[constantIndex]) {
    300320                const CodeBlock& codeBlock = *m_inlineStackTop->m_codeBlock;
    301                 JSValue value = codeBlock.getConstant(operand.offset());
    302                 SourceCodeRepresentation sourceCodeRepresentation = codeBlock.constantSourceCodeRepresentation(operand.offset());
     321                JSValue value = codeBlock.getConstant(operand);
     322                SourceCodeRepresentation sourceCodeRepresentation = codeBlock.constantSourceCodeRepresentation(operand);
    303323                if (constantIndex >= oldSize) {
    304324                    m_constants.grow(constantIndex + 1);
     
    359379        ImmediateNakedSet
    360380    };
    361     Node* setDirect(VirtualRegister operand, Node* value, SetMode setMode = NormalSet)
     381
     382    Node* setDirect(Operand operand, Node* value, SetMode setMode = NormalSet)
    362383    {
    363         addToGraph(MovHint, OpInfo(operand.offset()), value);
     384        addToGraph(MovHint, OpInfo(operand), value);
    364385
    365386        // We can't exit anymore because our OSR exit state has changed.
     
    375396        return delayed.execute(this);
    376397    }
    377    
     398
    378399    void processSetLocalQueue()
    379400    {
     
    393414        ASSERT(node->origin.semantic.bytecodeIndex() == m_currentIndex);
    394415        ConcurrentJSLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
    395         LazyOperandValueProfileKey key(m_currentIndex, node->local());
     416        LazyOperandValueProfileKey key(m_currentIndex, node->operand());
    396417        SpeculatedType prediction = m_inlineStackTop->m_lazyOperands.prediction(locker, key);
    397418        node->variableAccessData()->predict(prediction);
     
    400421
    401422    // Used in implementing get/set, above, where the operand is a local variable.
    402     Node* getLocal(VirtualRegister operand)
     423    Node* getLocalOrTmp(Operand operand)
    403424    {
    404         unsigned local = operand.toLocal();
    405 
    406         Node* node = m_currentBlock->variablesAtTail.local(local);
     425        ASSERT(operand.isTmp() || operand.isLocal());
     426        Node*& node = m_currentBlock->variablesAtTail.operand(operand);
    407427       
    408428        // This has two goals: 1) link together variable access datas, and 2)
     
    429449       
    430450        node = injectLazyOperandSpeculation(addToGraph(GetLocal, OpInfo(variable)));
    431         m_currentBlock->variablesAtTail.local(local) = node;
    432451        return node;
    433452    }
    434     Node* setLocal(const CodeOrigin& semanticOrigin, VirtualRegister operand, Node* value, SetMode setMode = NormalSet)
     453    Node* setLocalOrTmp(const CodeOrigin& semanticOrigin, Operand operand, Node* value, SetMode setMode = NormalSet)
    435454    {
     455        ASSERT(operand.isTmp() || operand.isLocal());
    436456        SetForScope<CodeOrigin> originChange(m_currentSemanticOrigin, semanticOrigin);
    437457
    438         unsigned local = operand.toLocal();
    439        
    440         if (setMode != ImmediateNakedSet) {
    441             ArgumentPosition* argumentPosition = findArgumentPositionForLocal(operand);
     458        if (operand.isTmp() && static_cast<unsigned>(operand.value()) >= m_numTmps) {
     459            if (inlineCallFrame())
     460                dataLogLn(*inlineCallFrame());
     461            dataLogLn("Bad operand: ", operand, " but current number of tmps is: ", m_numTmps, " code block has: ", m_profiledBlock->numTmps(), " tmps.");
     462            CRASH();
     463        }
     464
     465        if (setMode != ImmediateNakedSet && !operand.isTmp()) {
     466            VirtualRegister reg = operand.virtualRegister();
     467            ArgumentPosition* argumentPosition = findArgumentPositionForLocal(reg);
    442468            if (argumentPosition)
    443469                flushDirect(operand, argumentPosition);
    444             else if (m_graph.needsScopeRegister() && operand == m_codeBlock->scopeRegister())
     470            else if (m_graph.needsScopeRegister() && reg == m_codeBlock->scopeRegister())
    445471                flush(operand);
    446472        }
     
    452478            m_inlineStackTop->m_exitProfile.hasExitSite(semanticOrigin.bytecodeIndex(), BadIndexingType));
    453479        Node* node = addToGraph(SetLocal, OpInfo(variableAccessData), value);
    454         m_currentBlock->variablesAtTail.local(local) = node;
     480        m_currentBlock->variablesAtTail.operand(operand) = node;
    455481        return node;
    456482    }
     
    484510        return node;
    485511    }
    486     Node* setArgument(const CodeOrigin& semanticOrigin, VirtualRegister operand, Node* value, SetMode setMode = NormalSet)
     512    Node* setArgument(const CodeOrigin& semanticOrigin, Operand operand, Node* value, SetMode setMode = NormalSet)
    487513    {
    488514        SetForScope<CodeOrigin> originChange(m_currentSemanticOrigin, semanticOrigin);
    489515
    490         unsigned argument = operand.toArgument();
     516        VirtualRegister reg = operand.virtualRegister();
     517        unsigned argument = reg.toArgument();
    491518        ASSERT(argument < m_numArguments);
    492519       
    493         VariableAccessData* variableAccessData = newVariableAccessData(operand);
     520        VariableAccessData* variableAccessData = newVariableAccessData(reg);
    494521
    495522        // Always flush arguments, except for 'this'. If 'this' is created by us,
     
    497524        if (argument || m_graph.needsFlushedThis()) {
    498525            if (setMode != ImmediateNakedSet)
    499                 flushDirect(operand);
     526                flushDirect(reg);
    500527        }
    501528       
     
    533560            return stack->m_argumentPositions[argument];
    534561        }
    535         return 0;
    536     }
    537    
    538     ArgumentPosition* findArgumentPosition(VirtualRegister operand)
     562        return nullptr;
     563    }
     564   
     565    ArgumentPosition* findArgumentPosition(Operand operand)
    539566    {
     567        if (operand.isTmp())
     568            return nullptr;
    540569        if (operand.isArgument())
    541570            return findArgumentPositionForArgument(operand.toArgument());
    542         return findArgumentPositionForLocal(operand);
     571        return findArgumentPositionForLocal(operand.virtualRegister());
    543572    }
    544573
     
    551580            numArguments = inlineCallFrame->argumentsWithFixup.size();
    552581            if (inlineCallFrame->isClosureCall)
    553                 addFlushDirect(inlineCallFrame, remapOperand(inlineCallFrame, VirtualRegister(CallFrameSlot::callee)));
     582                addFlushDirect(inlineCallFrame, remapOperand(inlineCallFrame, CallFrameSlot::callee));
    554583            if (inlineCallFrame->isVarargs())
    555                 addFlushDirect(inlineCallFrame, remapOperand(inlineCallFrame, VirtualRegister(CallFrameSlot::argumentCountIncludingThis)));
     584                addFlushDirect(inlineCallFrame, remapOperand(inlineCallFrame, CallFrameSlot::argumentCountIncludingThis));
    556585        } else
    557586            numArguments = m_graph.baselineCodeBlockFor(inlineCallFrame)->numParameters();
     
    576605                CodeBlock* codeBlock = m_graph.baselineCodeBlockFor(inlineCallFrame);
    577606                FullBytecodeLiveness& fullLiveness = m_graph.livenessFor(codeBlock);
     607                // Note: We don't need to handle tmps here because tmps are not required to be flushed to the stack.
    578608                const auto& livenessAtBytecode = fullLiveness.getLiveness(bytecodeIndex, m_graph.appropriateLivenessCalculationPoint(origin, isCallerOrigin));
    579609                for (unsigned local = codeBlock->numCalleeLocals(); local--;) {
     
    585615    }
    586616
    587     void flush(VirtualRegister operand)
     617    void flush(Operand operand)
    588618    {
    589619        flushDirect(m_inlineStackTop->remapOperand(operand));
    590620    }
    591621   
    592     void flushDirect(VirtualRegister operand)
     622    void flushDirect(Operand operand)
    593623    {
    594624        flushDirect(operand, findArgumentPosition(operand));
    595625    }
    596626
    597     void flushDirect(VirtualRegister operand, ArgumentPosition* argumentPosition)
     627    void flushDirect(Operand operand, ArgumentPosition* argumentPosition)
    598628    {
    599629        addFlushOrPhantomLocal<Flush>(operand, argumentPosition);
     
    601631
    602632    template<NodeType nodeType>
    603     void addFlushOrPhantomLocal(VirtualRegister operand, ArgumentPosition* argumentPosition)
     633    void addFlushOrPhantomLocal(Operand operand, ArgumentPosition* argumentPosition)
    604634    {
    605635        ASSERT(!operand.isConstant());
    606636       
    607         Node* node = m_currentBlock->variablesAtTail.operand(operand);
     637        Node*& node = m_currentBlock->variablesAtTail.operand(operand);
    608638       
    609639        VariableAccessData* variable;
     
    615645       
    616646        node = addToGraph(nodeType, OpInfo(variable));
    617         m_currentBlock->variablesAtTail.operand(operand) = node;
    618647        if (argumentPosition)
    619648            argumentPosition->addVariable(variable);
    620649    }
    621650
    622     void phantomLocalDirect(VirtualRegister operand)
     651    void phantomLocalDirect(Operand operand)
    623652    {
    624653        addFlushOrPhantomLocal<PhantomLocal>(operand, findArgumentPosition(operand));
     
    627656    void flush(InlineStackEntry* inlineStackEntry)
    628657    {
    629         auto addFlushDirect = [&] (InlineCallFrame*, VirtualRegister reg) { flushDirect(reg); };
     658        auto addFlushDirect = [&] (InlineCallFrame*, Operand operand) { flushDirect(operand); };
    630659        flushImpl(inlineStackEntry->m_inlineCallFrame, addFlushDirect);
    631660    }
     
    633662    void flushForTerminal()
    634663    {
    635         auto addFlushDirect = [&] (InlineCallFrame*, VirtualRegister reg) { flushDirect(reg); };
    636         auto addPhantomLocalDirect = [&] (InlineCallFrame*, VirtualRegister reg) { phantomLocalDirect(reg); };
     664        auto addFlushDirect = [&] (InlineCallFrame*, Operand operand) { flushDirect(operand); };
     665        auto addPhantomLocalDirect = [&] (InlineCallFrame*, Operand operand) { phantomLocalDirect(operand); };
    637666        flushForTerminalImpl(currentCodeOrigin(), addFlushDirect, addPhantomLocalDirect);
    638667    }
     
    761790            Edge(child1), Edge(child2), Edge(child3));
    762791        return addToGraph(result);
     792    }
     793    Node* addToGraph(NodeType op, Operand operand, Node* child1)
     794    {
     795        ASSERT(op == MovHint);
     796        return addToGraph(op, OpInfo(operand.kind()), OpInfo(operand.value()), child1);
    763797    }
    764798    Node* addToGraph(NodeType op, OpInfo info1, OpInfo info2, Edge child1, Edge child2 = Edge(), Edge child3 = Edge())
     
    10921126    // The number of arguments passed to the function.
    10931127    unsigned m_numArguments;
    1094     // The number of locals (vars + temporaries) used in the function.
     1128    // The number of locals (vars + temporaries) used by the bytecode for the function.
    10951129    unsigned m_numLocals;
     1130    // The max number of temps used for forwarding data to an OSR exit checkpoint.
     1131    unsigned m_numTmps;
    10961132    // The number of slots (in units of sizeof(Register)) that we need to
    10971133    // preallocate for arguments to outgoing calls from this frame. This
     
    11601196        ~InlineStackEntry();
    11611197       
    1162         VirtualRegister remapOperand(VirtualRegister operand) const
     1198        Operand remapOperand(Operand operand) const
    11631199        {
    11641200            if (!m_inlineCallFrame)
    11651201                return operand;
     1202
     1203            if (operand.isTmp())
     1204                return Operand::tmp(operand.value() + m_inlineCallFrame->tmpOffset);
    11661205           
    1167             ASSERT(!operand.isConstant());
    1168 
    1169             return VirtualRegister(operand.offset() + m_inlineCallFrame->stackOffset);
     1206            ASSERT(!operand.virtualRegister().isConstant());
     1207
     1208            return operand.virtualRegister() + m_inlineCallFrame->stackOffset;
    11701209        }
    11711210    };
     
    11761215   
    11771216    struct DelayedSetLocal {
    1178         CodeOrigin m_origin;
    1179         VirtualRegister m_operand;
    1180         Node* m_value;
    1181         SetMode m_setMode;
    1182        
    11831217        DelayedSetLocal() { }
    1184         DelayedSetLocal(const CodeOrigin& origin, VirtualRegister operand, Node* value, SetMode setMode)
     1218        DelayedSetLocal(const CodeOrigin& origin, Operand operand, Node* value, SetMode setMode)
    11851219            : m_origin(origin)
    11861220            , m_operand(operand)
     
    11951229            if (m_operand.isArgument())
    11961230                return parser->setArgument(m_origin, m_operand, m_value, m_setMode);
    1197             return parser->setLocal(m_origin, m_operand, m_value, m_setMode);
    1198         }
     1231            return parser->setLocalOrTmp(m_origin, m_operand, m_value, m_setMode);
     1232        }
     1233
     1234        CodeOrigin m_origin;
     1235        Operand m_operand;
     1236        Node* m_value { nullptr };
     1237        SetMode m_setMode;
    11991238    };
    12001239   
     
    12091248{
    12101249    ASSERT(bytecodeIndex);
    1211     Ref<BasicBlock> block = adoptRef(*new BasicBlock(bytecodeIndex, m_numArguments, m_numLocals, 1));
     1250    Ref<BasicBlock> block = adoptRef(*new BasicBlock(bytecodeIndex, m_numArguments, m_numLocals, m_numTmps, 1));
    12121251    BasicBlock* blockPtr = block.ptr();
    12131252    // m_blockLinkingTargets must always be sorted in increasing order of bytecodeBegin
     
    12211260BasicBlock* ByteCodeParser::allocateUntargetableBlock()
    12221261{
    1223     Ref<BasicBlock> block = adoptRef(*new BasicBlock(BytecodeIndex(), m_numArguments, m_numLocals, 1));
     1262    Ref<BasicBlock> block = adoptRef(*new BasicBlock(BytecodeIndex(), m_numArguments, m_numLocals, m_numTmps, 1));
    12241263    BasicBlock* blockPtr = block.ptr();
    12251264    m_graph.appendBlock(WTFMove(block));
     
    14241463                continue;
    14251464            // If the target InlineCallFrame is Varargs, we do not know how many arguments are actually filled by LoadVarargs. Varargs InlineCallFrame's
    1426             // argumentCountIncludingThis is maximum number of potentially filled arguments by LoadVarargs. We "continue" to the upper frame which may be
     1465            // argumentCountIncludingThis is maximum number of potentially filled arguments by xkLoadVarargs. We "continue" to the upper frame which may be
    14271466            // a good target to jump into.
    14281467            if (callFrame->isVarargs())
     
    14501489        if (stackEntry->m_inlineCallFrame) {
    14511490            if (stackEntry->m_inlineCallFrame->isClosureCall)
    1452                 setDirect(stackEntry->remapOperand(VirtualRegister(CallFrameSlot::callee)), callTargetNode, NormalSet);
     1491                setDirect(remapOperand(stackEntry->m_inlineCallFrame, CallFrameSlot::callee), callTargetNode, NormalSet);
    14531492        } else
    14541493            addToGraph(SetCallee, callTargetNode);
     
    16151654    int registerOffsetAfterFixup = registerOffset - numberOfStackPaddingSlots;
    16161655   
    1617     int inlineCallFrameStart = m_inlineStackTop->remapOperand(VirtualRegister(registerOffsetAfterFixup)).offset() + CallFrame::headerSizeInRegisters;
     1656    Operand inlineCallFrameStart = VirtualRegister(m_inlineStackTop->remapOperand(VirtualRegister(registerOffsetAfterFixup)).value() + CallFrame::headerSizeInRegisters);
    16181657   
    16191658    ensureLocals(
    1620         VirtualRegister(inlineCallFrameStart).toLocal() + 1 +
     1659        inlineCallFrameStart.toLocal() + 1 +
    16211660        CallFrame::headerSizeInRegisters + codeBlock->numCalleeLocals());
    16221661   
     1662    ensureTmps((m_inlineStackTop->m_inlineCallFrame ? m_inlineStackTop->m_inlineCallFrame->tmpOffset : 0) + m_inlineStackTop->m_codeBlock->numTmps() + codeBlock->numTmps());
     1663
    16231664    size_t argumentPositionStart = m_graph.m_argumentPositions.size();
    16241665
    16251666    if (result.isValid())
    1626         result = m_inlineStackTop->remapOperand(result);
     1667        result = m_inlineStackTop->remapOperand(result).virtualRegister();
    16271668
    16281669    VariableAccessData* calleeVariable = nullptr;
     
    16371678    InlineStackEntry* callerStackTop = m_inlineStackTop;
    16381679    InlineStackEntry inlineStackEntry(this, codeBlock, codeBlock, callee.function(), result,
    1639         (VirtualRegister)inlineCallFrameStart, argumentCountIncludingThis, kind, continuationBlock);
     1680        inlineCallFrameStart.virtualRegister(), argumentCountIncludingThis, kind, continuationBlock);
    16401681
    16411682    // This is where the actual inlining really happens.
     
    16721713        // callee make it so that if we exit at <HERE>, we can recover loc9 and loc10.
    16731714        for (int index = 0; index < argumentCountIncludingThis; ++index) {
    1674             VirtualRegister argumentToGet = callerStackTop->remapOperand(virtualRegisterForArgument(index, registerOffset));
     1715            Operand argumentToGet = callerStackTop->remapOperand(virtualRegisterForArgument(index, registerOffset));
    16751716            Node* value = getDirect(argumentToGet);
    1676             addToGraph(MovHint, OpInfo(argumentToGet.offset()), value);
     1717            addToGraph(MovHint, OpInfo(argumentToGet), value);
    16771718            m_setLocalQueue.append(DelayedSetLocal { currentCodeOrigin(), argumentToGet, value, ImmediateNakedSet });
    16781719        }
     
    17181759        if (registerOffsetAfterFixup != registerOffset) {
    17191760            for (int index = 0; index < argumentCountIncludingThis; ++index) {
    1720                 VirtualRegister argumentToGet = callerStackTop->remapOperand(virtualRegisterForArgument(index, registerOffset));
     1761                Operand argumentToGet = callerStackTop->remapOperand(virtualRegisterForArgument(index, registerOffset));
    17211762                Node* value = getDirect(argumentToGet);
    1722                 VirtualRegister argumentToSet = m_inlineStackTop->remapOperand(virtualRegisterForArgument(index));
    1723                 addToGraph(MovHint, OpInfo(argumentToSet.offset()), value);
     1763                Operand argumentToSet = m_inlineStackTop->remapOperand(virtualRegisterForArgument(index));
     1764                addToGraph(MovHint, OpInfo(argumentToSet), value);
    17241765                m_setLocalQueue.append(DelayedSetLocal { currentCodeOrigin(), argumentToSet, value, ImmediateNakedSet });
    17251766            }
    17261767        }
    17271768        for (int index = 0; index < arityFixupCount; ++index) {
    1728             VirtualRegister argumentToSet = m_inlineStackTop->remapOperand(virtualRegisterForArgument(argumentCountIncludingThis + index));
    1729             addToGraph(MovHint, OpInfo(argumentToSet.offset()), undefined);
     1769            Operand argumentToSet = m_inlineStackTop->remapOperand(virtualRegisterForArgument(argumentCountIncludingThis + index));
     1770            addToGraph(MovHint, OpInfo(argumentToSet), undefined);
    17301771            m_setLocalQueue.append(DelayedSetLocal { currentCodeOrigin(), argumentToSet, undefined, ImmediateNakedSet });
    17311772        }
     
    18941935       
    18951936        int remappedRegisterOffset =
    1896         m_inlineStackTop->remapOperand(VirtualRegister(registerOffset)).offset();
     1937        m_inlineStackTop->remapOperand(VirtualRegister(registerOffset)).virtualRegister().offset();
    18971938       
    18981939        ensureLocals(VirtualRegister(remappedRegisterOffset).toLocal());
    18991940       
    19001941        int argumentStart = registerOffset + CallFrame::headerSizeInRegisters;
    1901         int remappedArgumentStart = m_inlineStackTop->remapOperand(VirtualRegister(argumentStart)).offset();
     1942        int remappedArgumentStart = m_inlineStackTop->remapOperand(VirtualRegister(argumentStart)).virtualRegister().offset();
    19021943       
    19031944        LoadVarargsData* data = m_graph.m_loadVarargsData.add();
     
    19071948        data->limit = maxArgumentCountIncludingThis;
    19081949        data->mandatoryMinimum = mandatoryMinimum;
    1909        
    1910         if (callOp == TailCallForwardVarargs)
    1911             addToGraph(ForwardVarargs, OpInfo(data));
    1912         else
    1913             addToGraph(LoadVarargs, OpInfo(data), get(argumentsArgument));
     1950
     1951        if (callOp == TailCallForwardVarargs) {
     1952            Node* argumentCount;
     1953            if (!inlineCallFrame())
     1954                argumentCount = addToGraph(GetArgumentCountIncludingThis);
     1955            else if (inlineCallFrame()->isVarargs())
     1956                argumentCount = getDirect(remapOperand(inlineCallFrame(), CallFrameSlot::argumentCountIncludingThis));
     1957            else
     1958                argumentCount = addToGraph(JSConstant, OpInfo(m_graph.freeze(jsNumber(inlineCallFrame()->argumentCountIncludingThis))));
     1959            addToGraph(ForwardVarargs, OpInfo(data), argumentCount);
     1960        } else {
     1961            Node* arguments = get(argumentsArgument);
     1962            auto argCountTmp = m_inlineStackTop->remapOperand(Operand::tmp(OpCallVarargs::argCountIncludingThis));
     1963            setDirect(argCountTmp, addToGraph(VarargsLength, OpInfo(data), arguments));
     1964            progressToNextCheckpoint();
     1965
     1966            addToGraph(LoadVarargs, OpInfo(data), getLocalOrTmp(argCountTmp), arguments);
     1967        }
    19141968       
    19151969        // LoadVarargs may OSR exit. Hence, we need to keep alive callTargetNode, thisArgument
     
    19231977        // before SSA.
    19241978       
    1925         VariableAccessData* countVariable = newVariableAccessData(VirtualRegister(remappedRegisterOffset + CallFrameSlot::argumentCountIncludingThis));
     1979        VariableAccessData* countVariable = newVariableAccessData(data->count);
    19261980        // This is pretty lame, but it will force the count to be flushed as an int. This doesn't
    19271981        // matter very much, since our use of a SetArgumentDefinitely and Flushes for this local slot is
     
    19301984        countVariable->mergeIsProfitableToUnbox(true);
    19311985        Node* setArgumentCount = addToGraph(SetArgumentDefinitely, OpInfo(countVariable));
    1932         m_currentBlock->variablesAtTail.setOperand(countVariable->local(), setArgumentCount);
     1986        m_currentBlock->variablesAtTail.setOperand(countVariable->operand(), setArgumentCount);
    19331987       
    19341988        set(VirtualRegister(argumentStart), get(thisArgument), ImmediateNakedSet);
     
    19542008           
    19552009            Node* setArgument = addToGraph(numSetArguments >= mandatoryMinimum ? SetArgumentMaybe : SetArgumentDefinitely, OpInfo(variable));
    1956             m_currentBlock->variablesAtTail.setOperand(variable->local(), setArgument);
     2010            m_currentBlock->variablesAtTail.setOperand(variable->operand(), setArgument);
    19572011            ++numSetArguments;
    19582012        }
     
    20542108    VERBOSE_LOG("Register offset: ", registerOffset);
    20552109    VirtualRegister calleeReg(registerOffset + CallFrameSlot::callee);
    2056     calleeReg = m_inlineStackTop->remapOperand(calleeReg);
     2110    calleeReg = m_inlineStackTop->remapOperand(calleeReg).virtualRegister();
    20572111    VERBOSE_LOG("Callee is going to be ", calleeReg, "\n");
    20582112    setDirect(calleeReg, callTargetNode, ImmediateSetWithFlush);
     
    51035157            auto bytecode = currentInstruction->as<OpNewRegexp>();
    51045158            ASSERT(bytecode.m_regexp.isConstant());
    5105             FrozenValue* frozenRegExp = m_graph.freezeStrong(m_inlineStackTop->m_codeBlock->getConstant(bytecode.m_regexp.offset()));
     5159            FrozenValue* frozenRegExp = m_graph.freezeStrong(m_inlineStackTop->m_codeBlock->getConstant(bytecode.m_regexp));
    51065160            set(bytecode.m_dst, addToGraph(NewRegexp, OpInfo(frozenRegExp), jsConstant(jsNumber(0))));
    51075161            NEXT_OPCODE(op_new_regexp);
     
    61796233            RELEASE_ASSERT(!m_currentBlock->size() || (m_graph.compilation() && m_currentBlock->size() == 1 && m_currentBlock->at(0)->op() == CountExecution));
    61806234
    6181             ValueProfileAndOperandBuffer* buffer = bytecode.metadata(codeBlock).m_buffer;
     6235            ValueProfileAndVirtualRegisterBuffer* buffer = bytecode.metadata(codeBlock).m_buffer;
    61826236
    61836237            if (!buffer) {
     
    61966250                ConcurrentJSLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
    61976251
    6198                 buffer->forEach([&] (ValueProfileAndOperand& profile) {
     6252                buffer->forEach([&] (ValueProfileAndVirtualRegister& profile) {
    61996253                    VirtualRegister operand(profile.m_operand);
    62006254                    SpeculatedType prediction = profile.computeUpdatedPrediction(locker);
     
    62246278
    62256279            unsigned numberOfLocals = 0;
    6226             buffer->forEach([&] (ValueProfileAndOperand& profile) {
     6280            buffer->forEach([&] (ValueProfileAndVirtualRegister& profile) {
    62276281                VirtualRegister operand(profile.m_operand);
    62286282                if (operand.isArgument())
     
    62316285                Node* value = addToGraph(ExtractCatchLocal, OpInfo(numberOfLocals), OpInfo(localPredictions[numberOfLocals]));
    62326286                ++numberOfLocals;
    6233                 addToGraph(MovHint, OpInfo(profile.m_operand), value);
     6287                addToGraph(MovHint, OpInfo(operand), value);
    62346288                localsToSet.uncheckedAppend(std::make_pair(operand, value));
    62356289            });
     
    63596413        case op_jneq_ptr: {
    63606414            auto bytecode = currentInstruction->as<OpJneqPtr>();
    6361             FrozenValue* frozenPointer = m_graph.freezeStrong(m_inlineStackTop->m_codeBlock->getConstant(bytecode.m_specialPointer.offset()));
     6415            FrozenValue* frozenPointer = m_graph.freezeStrong(m_inlineStackTop->m_codeBlock->getConstant(bytecode.m_specialPointer));
    63626416            unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel);
    63636417            Node* child = get(bytecode.m_value);
     
    68276881            auto bytecode = currentInstruction->as<OpCreateLexicalEnvironment>();
    68286882            ASSERT(bytecode.m_symbolTable.isConstant() && bytecode.m_initialValue.isConstant());
    6829             FrozenValue* symbolTable = m_graph.freezeStrong(m_inlineStackTop->m_codeBlock->getConstant(bytecode.m_symbolTable.offset()));
    6830             FrozenValue* initialValue = m_graph.freezeStrong(m_inlineStackTop->m_codeBlock->getConstant(bytecode.m_initialValue.offset()));
     6883            FrozenValue* symbolTable = m_graph.freezeStrong(m_inlineStackTop->m_codeBlock->getConstant(bytecode.m_symbolTable));
     6884            FrozenValue* initialValue = m_graph.freezeStrong(m_inlineStackTop->m_codeBlock->getConstant(bytecode.m_initialValue));
    68316885            Node* scope = get(bytecode.m_scope);
    68326886            Node* lexicalEnvironment = addToGraph(CreateActivation, OpInfo(symbolTable), OpInfo(initialValue), scope);
     
    68586912            // bytecode-level liveness of the scope register.
    68596913            auto bytecode = currentInstruction->as<OpGetScope>();
    6860             Node* callee = get(VirtualRegister(CallFrameSlot::callee));
     6914            Node* callee = get(CallFrameSlot::callee);
    68616915            Node* result;
    68626916            if (JSFunction* function = callee->dynamicCastConstant<JSFunction*>(*m_vm))
     
    72837337        // plan finishes.
    72847338        m_inlineCallFrame->baselineCodeBlock.setWithoutWriteBarrier(codeBlock->baselineVersion());
     7339        m_inlineCallFrame->setTmpOffset((m_caller->m_inlineCallFrame ? m_caller->m_inlineCallFrame->tmpOffset : 0) + m_caller->m_codeBlock->numTmps());
    72857340        m_inlineCallFrame->setStackOffset(inlineCallFrameStart.offset() - CallFrame::headerSizeInRegisters);
    72867341        m_inlineCallFrame->argumentCountIncludingThis = argumentCountIncludingThis;
     7342        RELEASE_ASSERT(m_inlineCallFrame->argumentCountIncludingThis == argumentCountIncludingThis);
    72877343        if (callee) {
    72887344            m_inlineCallFrame->calleeRecovery = ValueRecovery::constant(callee);
     
    76467702
    76477703                    if (node->hasVariableAccessData(m_graph))
    7648                         mapping.operand(node->local()) = node->variableAccessData();
     7704                        mapping.operand(node->operand()) = node->variableAccessData();
    76497705
    76507706                    if (node->op() != ForceOSRExit)
     
    76667722                    }
    76677723
    7668                     auto insertLivenessPreservingOp = [&] (InlineCallFrame* inlineCallFrame, NodeType op, VirtualRegister operand) {
     7724                    auto insertLivenessPreservingOp = [&] (InlineCallFrame* inlineCallFrame, NodeType op, Operand operand) {
    76697725                        VariableAccessData* variable = mapping.operand(operand);
    76707726                        if (!variable) {
     
    76737729                        }
    76747730
    7675                         VirtualRegister argument = operand - (inlineCallFrame ? inlineCallFrame->stackOffset : 0);
     7731                        Operand argument = unmapOperand(inlineCallFrame, operand);
    76767732                        if (argument.isArgument() && !argument.isHeader()) {
    76777733                            const Vector<ArgumentPosition*>& arguments = m_inlineCallFrameToArgumentPositions.get(inlineCallFrame);
     
    76807736                        insertionSet.insertNode(nodeIndex, SpecNone, op, origin, OpInfo(variable));
    76817737                    };
    7682                     auto addFlushDirect = [&] (InlineCallFrame* inlineCallFrame, VirtualRegister operand) {
     7738                    auto addFlushDirect = [&] (InlineCallFrame* inlineCallFrame, Operand operand) {
    76837739                        insertLivenessPreservingOp(inlineCallFrame, Flush, operand);
    76847740                    };
    7685                     auto addPhantomLocalDirect = [&] (InlineCallFrame* inlineCallFrame, VirtualRegister operand) {
     7741                    auto addPhantomLocalDirect = [&] (InlineCallFrame* inlineCallFrame, Operand operand) {
    76867742                        insertLivenessPreservingOp(inlineCallFrame, PhantomLocal, operand);
    76877743                    };
     
    77487804    }
    77497805
     7806    m_graph.m_tmps = m_numTmps;
    77507807    m_graph.m_localVars = m_numLocals;
    77517808    m_graph.m_parameterSlots = m_parameterSlots;
Note: See TracChangeset for help on using the changeset viewer.