Changeset 156482 in webkit


Ignore:
Timestamp:
Sep 26, 2013 11:31:29 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r156474.
http://trac.webkit.org/changeset/156474
https://bugs.webkit.org/show_bug.cgi?id=121966

Broke the builds. (Requested by xenon on #webkit).

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::registerName):
(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::createActivation):
(JSC::CodeBlock::nameForRegister):

  • bytecode/CodeBlock.h:

(JSC::unmodifiedArgumentsRegister):
(JSC::CodeBlock::isKnownNotImmediate):
(JSC::CodeBlock::setThisRegister):
(JSC::CodeBlock::thisRegister):
(JSC::CodeBlock::setArgumentsRegister):
(JSC::CodeBlock::argumentsRegister):
(JSC::CodeBlock::uncheckedArgumentsRegister):
(JSC::CodeBlock::setActivationRegister):
(JSC::CodeBlock::activationRegister):
(JSC::CodeBlock::uncheckedActivationRegister):
(JSC::CodeBlock::usesArguments):
(JSC::CodeBlock::isCaptured):

  • bytecode/Instruction.h:
  • bytecode/LazyOperandValueProfile.h:

(JSC::LazyOperandValueProfileKey::LazyOperandValueProfileKey):
(JSC::LazyOperandValueProfileKey::operator!):
(JSC::LazyOperandValueProfileKey::hash):
(JSC::LazyOperandValueProfileKey::operand):
(JSC::LazyOperandValueProfileKey::isHashTableDeletedValue):
(JSC::LazyOperandValueProfile::LazyOperandValueProfile):

  • bytecode/MethodOfGettingAValueProfile.cpp:

(JSC::MethodOfGettingAValueProfile::fromLazyOperand):
(JSC::MethodOfGettingAValueProfile::getSpecFailBucket):

  • bytecode/Operands.h:

(JSC::localToOperand):
(JSC::operandIsLocal):
(JSC::operandToLocal):
(JSC::operandIsArgument):
(JSC::operandToArgument):
(JSC::argumentToOperand):
(JSC::Operands::operand):
(JSC::Operands::hasOperand):
(JSC::Operands::setOperand):
(JSC::Operands::operandForIndex):
(JSC::Operands::setOperandFirstTime):

  • bytecode/UnlinkedCodeBlock.cpp:

(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):

  • bytecode/UnlinkedCodeBlock.h:

(JSC::UnlinkedCodeBlock::setThisRegister):
(JSC::UnlinkedCodeBlock::setActivationRegister):
(JSC::UnlinkedCodeBlock::setArgumentsRegister):
(JSC::UnlinkedCodeBlock::usesArguments):
(JSC::UnlinkedCodeBlock::argumentsRegister):
(JSC::UnlinkedCodeBlock::usesGlobalObject):
(JSC::UnlinkedCodeBlock::setGlobalObjectRegister):
(JSC::UnlinkedCodeBlock::globalObjectRegister):
(JSC::UnlinkedCodeBlock::thisRegister):
(JSC::UnlinkedCodeBlock::activationRegister):

  • bytecode/ValueRecovery.h:

(JSC::ValueRecovery::displacedInJSStack):
(JSC::ValueRecovery::virtualRegister):
(JSC::ValueRecovery::dumpInContext):

  • bytecode/VirtualRegister.h:

(WTF::printInternal):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::generate):
(JSC::BytecodeGenerator::addVar):
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::createLazyRegisterIfNecessary):
(JSC::BytecodeGenerator::newRegister):
(JSC::BytecodeGenerator::emitLoadGlobalObject):
(JSC::BytecodeGenerator::emitGetArgumentsLength):
(JSC::BytecodeGenerator::emitGetArgumentByVal):
(JSC::BytecodeGenerator::createArgumentsIfNecessary):
(JSC::BytecodeGenerator::emitReturn):

  • bytecompiler/BytecodeGenerator.h:

(JSC::BytecodeGenerator::registerFor):

  • bytecompiler/RegisterID.h:

(JSC::RegisterID::RegisterID):
(JSC::RegisterID::setIndex):
(JSC::RegisterID::index):

  • debugger/DebuggerCallFrame.cpp:

(JSC::DebuggerCallFrame::thisObject):

  • dfg/DFGAbstractHeap.h:

(JSC::DFG::AbstractHeap::Payload::Payload):

  • dfg/DFGAbstractInterpreterInlines.h:

(JSC::DFG::::executeEffects):
(JSC::DFG::::clobberCapturedVars):

  • dfg/DFGArgumentPosition.h:

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

  • dfg/DFGArgumentsSimplificationPhase.cpp:

(JSC::DFG::ArgumentsSimplificationPhase::run):
(JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
(JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::newVariableAccessData):
(JSC::DFG::ByteCodeParser::getDirect):
(JSC::DFG::ByteCodeParser::get):
(JSC::DFG::ByteCodeParser::setDirect):
(JSC::DFG::ByteCodeParser::set):
(JSC::DFG::ByteCodeParser::getLocal):
(JSC::DFG::ByteCodeParser::setLocal):
(JSC::DFG::ByteCodeParser::getArgument):
(JSC::DFG::ByteCodeParser::setArgument):
(JSC::DFG::ByteCodeParser::findArgumentPositionForLocal):
(JSC::DFG::ByteCodeParser::findArgumentPosition):
(JSC::DFG::ByteCodeParser::flush):
(JSC::DFG::ByteCodeParser::flushDirect):
(JSC::DFG::ByteCodeParser::getToInt32):
(JSC::DFG::ByteCodeParser::getThis):
(JSC::DFG::ByteCodeParser::addCall):
(JSC::DFG::ByteCodeParser::InlineStackEntry::remapOperand):
(JSC::DFG::ByteCodeParser::handleCall):
(JSC::DFG::ByteCodeParser::emitFunctionChecks):
(JSC::DFG::ByteCodeParser::emitArgumentPhantoms):
(JSC::DFG::ByteCodeParser::handleInlining):
(JSC::DFG::ByteCodeParser::handleMinMax):
(JSC::DFG::ByteCodeParser::handleIntrinsic):
(JSC::DFG::ByteCodeParser::handleTypedArrayConstructor):
(JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
(JSC::DFG::ByteCodeParser::handleGetByOffset):
(JSC::DFG::ByteCodeParser::handleGetById):
(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
(JSC::DFG::ByteCodeParser::parse):

  • dfg/DFGCFGSimplificationPhase.cpp:
  • dfg/DFGCPSRethreadingPhase.cpp:

(JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocal):
(JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocal):
(JSC::DFG::CPSRethreadingPhase::canonicalizeSetArgument):

  • dfg/DFGCapabilities.cpp:

(JSC::DFG::capabilityLevel):

  • dfg/DFGConstantFoldingPhase.cpp:

(JSC::DFG::ConstantFoldingPhase::isCapturedAtOrAfter):

  • dfg/DFGFlushLivenessAnalysisPhase.cpp:

(JSC::DFG::FlushLivenessAnalysisPhase::setForNode):

  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::dump):

  • dfg/DFGGraph.h:

(JSC::DFG::Graph::argumentsRegisterFor):
(JSC::DFG::Graph::uncheckedArgumentsRegisterFor):
(JSC::DFG::Graph::uncheckedActivationRegisterFor):
(JSC::DFG::Graph::valueProfileFor):

  • dfg/DFGJITCode.cpp:

(JSC::DFG::JITCode::reconstruct):

  • dfg/DFGNode.h:

(JSC::DFG::Node::Node):
(JSC::DFG::Node::convertToGetLocalUnlinked):
(JSC::DFG::Node::hasVirtualRegister):
(JSC::DFG::Node::virtualRegister):
(JSC::DFG::Node::setVirtualRegister):

  • dfg/DFGOSREntry.cpp:

(JSC::DFG::prepareOSREntry):

  • dfg/DFGOSREntrypointCreationPhase.cpp:

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

  • dfg/DFGOSRExit.h:
  • dfg/DFGOSRExitCompiler32_64.cpp:

(JSC::DFG::OSRExitCompiler::compileExit):

  • dfg/DFGOSRExitCompiler64.cpp:

(JSC::DFG::OSRExitCompiler::compileExit):

  • dfg/DFGRegisterBank.h:

(JSC::DFG::RegisterBank::tryAllocate):
(JSC::DFG::RegisterBank::allocateSpecific):
(JSC::DFG::RegisterBank::retain):
(JSC::DFG::RegisterBank::isInUse):
(JSC::DFG::RegisterBank::dump):
(JSC::DFG::RegisterBank::releaseAtIndex):
(JSC::DFG::RegisterBank::allocateInternal):
(JSC::DFG::RegisterBank::MapEntry::MapEntry):

  • dfg/DFGScoreBoard.h:

(JSC::DFG::ScoreBoard::allocate):
(JSC::DFG::ScoreBoard::use):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::SpeculativeJIT):
(JSC::DFG::SpeculativeJIT::checkConsistency):
(JSC::DFG::SpeculativeJIT::compileMovHint):
(JSC::DFG::SpeculativeJIT::compileInlineStart):
(JSC::DFG::SpeculativeJIT::compileCurrentBlock):

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::allocate):
(JSC::DFG::SpeculativeJIT::fprAllocate):
(JSC::DFG::SpeculativeJIT::silentSpillAllRegistersImpl):
(JSC::DFG::SpeculativeJIT::flushRegisters):
(JSC::DFG::SpeculativeJIT::isFlushed):
(JSC::DFG::SpeculativeJIT::argumentSlot):
(JSC::DFG::SpeculativeJIT::argumentTagSlot):
(JSC::DFG::SpeculativeJIT::argumentPayloadSlot):
(JSC::DFG::SpeculativeJIT::valueSourceForOperand):
(JSC::DFG::SpeculativeJIT::setNodeForOperand):
(JSC::DFG::SpeculativeJIT::valueSourceReferenceForOperand):
(JSC::DFG::SpeculativeJIT::recordSetLocal):
(JSC::DFG::SpeculativeJIT::generationInfoFromVirtualRegister):
(JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):

  • dfg/DFGSpeculativeJIT64.cpp:

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

  • dfg/DFGValidate.cpp:

(JSC::DFG::Validate::validate):
(JSC::DFG::Validate::validateCPS):
(JSC::DFG::Validate::checkOperand):
(JSC::DFG::Validate::reportValidationContext):

  • dfg/DFGValueRecoveryOverride.h:

(JSC::DFG::ValueRecoveryOverride::ValueRecoveryOverride):

  • dfg/DFGVariableAccessData.h:

(JSC::DFG::VariableAccessData::operand):
(JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
(JSC::DFG::VariableAccessData::tallyVotesForShouldUseDoubleFormat):
(JSC::DFG::VariableAccessData::flushFormat):

  • dfg/DFGVariableEvent.h:

(JSC::DFG::VariableEvent::spill):
(JSC::DFG::VariableEvent::setLocal):

  • dfg/DFGVariableEventStream.cpp:

(JSC::DFG::VariableEventStream::reconstruct):

  • dfg/DFGVirtualRegisterAllocationPhase.cpp:

(JSC::DFG::VirtualRegisterAllocationPhase::run):

  • ftl/FTLExitArgumentForOperand.h:

(JSC::FTL::ExitArgumentForOperand::ExitArgumentForOperand):
(JSC::FTL::ExitArgumentForOperand::operand):

  • ftl/FTLLink.cpp:

(JSC::FTL::link):

  • ftl/FTLLowerDFGToLLVM.cpp:

(JSC::FTL::LowerDFGToLLVM::LowerDFGToLLVM):
(JSC::FTL::LowerDFGToLLVM::compileGetArgument):
(JSC::FTL::LowerDFGToLLVM::compileExtractOSREntryLocal):
(JSC::FTL::LowerDFGToLLVM::compileCallOrConstruct):
(JSC::FTL::LowerDFGToLLVM::appendOSRExit):
(JSC::FTL::LowerDFGToLLVM::observeMovHint):
(JSC::FTL::LowerDFGToLLVM::addressFor):
(JSC::FTL::LowerDFGToLLVM::payloadFor):
(JSC::FTL::LowerDFGToLLVM::tagFor):

  • ftl/FTLOSREntry.cpp:

(JSC::FTL::prepareOSREntry):

  • ftl/FTLOSRExit.cpp:

(JSC::FTL::OSRExit::convertToForward):

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

(JSC::FTL::compileStub):

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

(JSC::Interpreter::dumpRegisters):
(JSC::unwindCallFrame):
(JSC::Interpreter::unwind):

  • jit/AssemblyHelpers.h:

(JSC::AssemblyHelpers::addressFor):
(JSC::AssemblyHelpers::tagFor):
(JSC::AssemblyHelpers::payloadFor):
(JSC::AssemblyHelpers::argumentsRegisterFor):

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

(JSC::JIT::compileLoadVarargs):

  • jit/JITInlines.h:

(JSC::JIT::emitGetVirtualRegister):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_tear_off_arguments):
(JSC::JIT::emit_op_get_pnames):
(JSC::JIT::emit_op_enter):
(JSC::JIT::emit_op_create_arguments):
(JSC::JIT::emitSlow_op_get_argument_by_val):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emit_op_enter):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • profiler/ProfilerBytecodeSequence.cpp:

(JSC::Profiler::BytecodeSequence::BytecodeSequence):

  • runtime/CommonSlowPaths.cpp:

(JSC::SLOW_PATH_DECL):

  • runtime/JSActivation.cpp:

(JSC::JSActivation::argumentsGetter):

Location:
trunk/Source/JavaScriptCore
Files:
65 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r156480 r156482  
     12013-09-26  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r156474.
     4        http://trac.webkit.org/changeset/156474
     5        https://bugs.webkit.org/show_bug.cgi?id=121966
     6
     7        Broke the builds. (Requested by xenon on #webkit).
     8
     9        * bytecode/CodeBlock.cpp:
     10        (JSC::CodeBlock::registerName):
     11        (JSC::CodeBlock::dumpBytecode):
     12        (JSC::CodeBlock::CodeBlock):
     13        (JSC::CodeBlock::createActivation):
     14        (JSC::CodeBlock::nameForRegister):
     15        * bytecode/CodeBlock.h:
     16        (JSC::unmodifiedArgumentsRegister):
     17        (JSC::CodeBlock::isKnownNotImmediate):
     18        (JSC::CodeBlock::setThisRegister):
     19        (JSC::CodeBlock::thisRegister):
     20        (JSC::CodeBlock::setArgumentsRegister):
     21        (JSC::CodeBlock::argumentsRegister):
     22        (JSC::CodeBlock::uncheckedArgumentsRegister):
     23        (JSC::CodeBlock::setActivationRegister):
     24        (JSC::CodeBlock::activationRegister):
     25        (JSC::CodeBlock::uncheckedActivationRegister):
     26        (JSC::CodeBlock::usesArguments):
     27        (JSC::CodeBlock::isCaptured):
     28        * bytecode/Instruction.h:
     29        * bytecode/LazyOperandValueProfile.h:
     30        (JSC::LazyOperandValueProfileKey::LazyOperandValueProfileKey):
     31        (JSC::LazyOperandValueProfileKey::operator!):
     32        (JSC::LazyOperandValueProfileKey::hash):
     33        (JSC::LazyOperandValueProfileKey::operand):
     34        (JSC::LazyOperandValueProfileKey::isHashTableDeletedValue):
     35        (JSC::LazyOperandValueProfile::LazyOperandValueProfile):
     36        * bytecode/MethodOfGettingAValueProfile.cpp:
     37        (JSC::MethodOfGettingAValueProfile::fromLazyOperand):
     38        (JSC::MethodOfGettingAValueProfile::getSpecFailBucket):
     39        * bytecode/Operands.h:
     40        (JSC::localToOperand):
     41        (JSC::operandIsLocal):
     42        (JSC::operandToLocal):
     43        (JSC::operandIsArgument):
     44        (JSC::operandToArgument):
     45        (JSC::argumentToOperand):
     46        (JSC::Operands::operand):
     47        (JSC::Operands::hasOperand):
     48        (JSC::Operands::setOperand):
     49        (JSC::Operands::operandForIndex):
     50        (JSC::Operands::setOperandFirstTime):
     51        * bytecode/UnlinkedCodeBlock.cpp:
     52        (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
     53        * bytecode/UnlinkedCodeBlock.h:
     54        (JSC::UnlinkedCodeBlock::setThisRegister):
     55        (JSC::UnlinkedCodeBlock::setActivationRegister):
     56        (JSC::UnlinkedCodeBlock::setArgumentsRegister):
     57        (JSC::UnlinkedCodeBlock::usesArguments):
     58        (JSC::UnlinkedCodeBlock::argumentsRegister):
     59        (JSC::UnlinkedCodeBlock::usesGlobalObject):
     60        (JSC::UnlinkedCodeBlock::setGlobalObjectRegister):
     61        (JSC::UnlinkedCodeBlock::globalObjectRegister):
     62        (JSC::UnlinkedCodeBlock::thisRegister):
     63        (JSC::UnlinkedCodeBlock::activationRegister):
     64        * bytecode/ValueRecovery.h:
     65        (JSC::ValueRecovery::displacedInJSStack):
     66        (JSC::ValueRecovery::virtualRegister):
     67        (JSC::ValueRecovery::dumpInContext):
     68        * bytecode/VirtualRegister.h:
     69        (WTF::printInternal):
     70        * bytecompiler/BytecodeGenerator.cpp:
     71        (JSC::BytecodeGenerator::generate):
     72        (JSC::BytecodeGenerator::addVar):
     73        (JSC::BytecodeGenerator::BytecodeGenerator):
     74        (JSC::BytecodeGenerator::createLazyRegisterIfNecessary):
     75        (JSC::BytecodeGenerator::newRegister):
     76        (JSC::BytecodeGenerator::emitLoadGlobalObject):
     77        (JSC::BytecodeGenerator::emitGetArgumentsLength):
     78        (JSC::BytecodeGenerator::emitGetArgumentByVal):
     79        (JSC::BytecodeGenerator::createArgumentsIfNecessary):
     80        (JSC::BytecodeGenerator::emitReturn):
     81        * bytecompiler/BytecodeGenerator.h:
     82        (JSC::BytecodeGenerator::registerFor):
     83        * bytecompiler/RegisterID.h:
     84        (JSC::RegisterID::RegisterID):
     85        (JSC::RegisterID::setIndex):
     86        (JSC::RegisterID::index):
     87        * debugger/DebuggerCallFrame.cpp:
     88        (JSC::DebuggerCallFrame::thisObject):
     89        * dfg/DFGAbstractHeap.h:
     90        (JSC::DFG::AbstractHeap::Payload::Payload):
     91        * dfg/DFGAbstractInterpreterInlines.h:
     92        (JSC::DFG::::executeEffects):
     93        (JSC::DFG::::clobberCapturedVars):
     94        * dfg/DFGArgumentPosition.h:
     95        (JSC::DFG::ArgumentPosition::dump):
     96        * dfg/DFGArgumentsSimplificationPhase.cpp:
     97        (JSC::DFG::ArgumentsSimplificationPhase::run):
     98        (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
     99        (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize):
     100        * dfg/DFGByteCodeParser.cpp:
     101        (JSC::DFG::ByteCodeParser::newVariableAccessData):
     102        (JSC::DFG::ByteCodeParser::getDirect):
     103        (JSC::DFG::ByteCodeParser::get):
     104        (JSC::DFG::ByteCodeParser::setDirect):
     105        (JSC::DFG::ByteCodeParser::set):
     106        (JSC::DFG::ByteCodeParser::getLocal):
     107        (JSC::DFG::ByteCodeParser::setLocal):
     108        (JSC::DFG::ByteCodeParser::getArgument):
     109        (JSC::DFG::ByteCodeParser::setArgument):
     110        (JSC::DFG::ByteCodeParser::findArgumentPositionForLocal):
     111        (JSC::DFG::ByteCodeParser::findArgumentPosition):
     112        (JSC::DFG::ByteCodeParser::flush):
     113        (JSC::DFG::ByteCodeParser::flushDirect):
     114        (JSC::DFG::ByteCodeParser::getToInt32):
     115        (JSC::DFG::ByteCodeParser::getThis):
     116        (JSC::DFG::ByteCodeParser::addCall):
     117        (JSC::DFG::ByteCodeParser::InlineStackEntry::remapOperand):
     118        (JSC::DFG::ByteCodeParser::handleCall):
     119        (JSC::DFG::ByteCodeParser::emitFunctionChecks):
     120        (JSC::DFG::ByteCodeParser::emitArgumentPhantoms):
     121        (JSC::DFG::ByteCodeParser::handleInlining):
     122        (JSC::DFG::ByteCodeParser::handleMinMax):
     123        (JSC::DFG::ByteCodeParser::handleIntrinsic):
     124        (JSC::DFG::ByteCodeParser::handleTypedArrayConstructor):
     125        (JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
     126        (JSC::DFG::ByteCodeParser::handleGetByOffset):
     127        (JSC::DFG::ByteCodeParser::handleGetById):
     128        (JSC::DFG::ByteCodeParser::parseBlock):
     129        (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
     130        (JSC::DFG::ByteCodeParser::parse):
     131        * dfg/DFGCFGSimplificationPhase.cpp:
     132        * dfg/DFGCPSRethreadingPhase.cpp:
     133        (JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocal):
     134        (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocal):
     135        (JSC::DFG::CPSRethreadingPhase::canonicalizeSetArgument):
     136        * dfg/DFGCapabilities.cpp:
     137        (JSC::DFG::capabilityLevel):
     138        * dfg/DFGConstantFoldingPhase.cpp:
     139        (JSC::DFG::ConstantFoldingPhase::isCapturedAtOrAfter):
     140        * dfg/DFGFlushLivenessAnalysisPhase.cpp:
     141        (JSC::DFG::FlushLivenessAnalysisPhase::setForNode):
     142        * dfg/DFGGraph.cpp:
     143        (JSC::DFG::Graph::dump):
     144        * dfg/DFGGraph.h:
     145        (JSC::DFG::Graph::argumentsRegisterFor):
     146        (JSC::DFG::Graph::uncheckedArgumentsRegisterFor):
     147        (JSC::DFG::Graph::uncheckedActivationRegisterFor):
     148        (JSC::DFG::Graph::valueProfileFor):
     149        * dfg/DFGJITCode.cpp:
     150        (JSC::DFG::JITCode::reconstruct):
     151        * dfg/DFGNode.h:
     152        (JSC::DFG::Node::Node):
     153        (JSC::DFG::Node::convertToGetLocalUnlinked):
     154        (JSC::DFG::Node::hasVirtualRegister):
     155        (JSC::DFG::Node::virtualRegister):
     156        (JSC::DFG::Node::setVirtualRegister):
     157        * dfg/DFGOSREntry.cpp:
     158        (JSC::DFG::prepareOSREntry):
     159        * dfg/DFGOSREntrypointCreationPhase.cpp:
     160        (JSC::DFG::OSREntrypointCreationPhase::run):
     161        * dfg/DFGOSRExit.h:
     162        * dfg/DFGOSRExitCompiler32_64.cpp:
     163        (JSC::DFG::OSRExitCompiler::compileExit):
     164        * dfg/DFGOSRExitCompiler64.cpp:
     165        (JSC::DFG::OSRExitCompiler::compileExit):
     166        * dfg/DFGRegisterBank.h:
     167        (JSC::DFG::RegisterBank::tryAllocate):
     168        (JSC::DFG::RegisterBank::allocateSpecific):
     169        (JSC::DFG::RegisterBank::retain):
     170        (JSC::DFG::RegisterBank::isInUse):
     171        (JSC::DFG::RegisterBank::dump):
     172        (JSC::DFG::RegisterBank::releaseAtIndex):
     173        (JSC::DFG::RegisterBank::allocateInternal):
     174        (JSC::DFG::RegisterBank::MapEntry::MapEntry):
     175        * dfg/DFGScoreBoard.h:
     176        (JSC::DFG::ScoreBoard::allocate):
     177        (JSC::DFG::ScoreBoard::use):
     178        * dfg/DFGSpeculativeJIT.cpp:
     179        (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
     180        (JSC::DFG::SpeculativeJIT::checkConsistency):
     181        (JSC::DFG::SpeculativeJIT::compileMovHint):
     182        (JSC::DFG::SpeculativeJIT::compileInlineStart):
     183        (JSC::DFG::SpeculativeJIT::compileCurrentBlock):
     184        * dfg/DFGSpeculativeJIT.h:
     185        (JSC::DFG::SpeculativeJIT::allocate):
     186        (JSC::DFG::SpeculativeJIT::fprAllocate):
     187        (JSC::DFG::SpeculativeJIT::silentSpillAllRegistersImpl):
     188        (JSC::DFG::SpeculativeJIT::flushRegisters):
     189        (JSC::DFG::SpeculativeJIT::isFlushed):
     190        (JSC::DFG::SpeculativeJIT::argumentSlot):
     191        (JSC::DFG::SpeculativeJIT::argumentTagSlot):
     192        (JSC::DFG::SpeculativeJIT::argumentPayloadSlot):
     193        (JSC::DFG::SpeculativeJIT::valueSourceForOperand):
     194        (JSC::DFG::SpeculativeJIT::setNodeForOperand):
     195        (JSC::DFG::SpeculativeJIT::valueSourceReferenceForOperand):
     196        (JSC::DFG::SpeculativeJIT::recordSetLocal):
     197        (JSC::DFG::SpeculativeJIT::generationInfoFromVirtualRegister):
     198        (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
     199        * dfg/DFGSpeculativeJIT64.cpp:
     200        (JSC::DFG::SpeculativeJIT::compile):
     201        * dfg/DFGValidate.cpp:
     202        (JSC::DFG::Validate::validate):
     203        (JSC::DFG::Validate::validateCPS):
     204        (JSC::DFG::Validate::checkOperand):
     205        (JSC::DFG::Validate::reportValidationContext):
     206        * dfg/DFGValueRecoveryOverride.h:
     207        (JSC::DFG::ValueRecoveryOverride::ValueRecoveryOverride):
     208        * dfg/DFGVariableAccessData.h:
     209        (JSC::DFG::VariableAccessData::operand):
     210        (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
     211        (JSC::DFG::VariableAccessData::tallyVotesForShouldUseDoubleFormat):
     212        (JSC::DFG::VariableAccessData::flushFormat):
     213        * dfg/DFGVariableEvent.h:
     214        (JSC::DFG::VariableEvent::spill):
     215        (JSC::DFG::VariableEvent::setLocal):
     216        * dfg/DFGVariableEventStream.cpp:
     217        (JSC::DFG::VariableEventStream::reconstruct):
     218        * dfg/DFGVirtualRegisterAllocationPhase.cpp:
     219        (JSC::DFG::VirtualRegisterAllocationPhase::run):
     220        * ftl/FTLExitArgumentForOperand.h:
     221        (JSC::FTL::ExitArgumentForOperand::ExitArgumentForOperand):
     222        (JSC::FTL::ExitArgumentForOperand::operand):
     223        * ftl/FTLLink.cpp:
     224        (JSC::FTL::link):
     225        * ftl/FTLLowerDFGToLLVM.cpp:
     226        (JSC::FTL::LowerDFGToLLVM::LowerDFGToLLVM):
     227        (JSC::FTL::LowerDFGToLLVM::compileGetArgument):
     228        (JSC::FTL::LowerDFGToLLVM::compileExtractOSREntryLocal):
     229        (JSC::FTL::LowerDFGToLLVM::compileCallOrConstruct):
     230        (JSC::FTL::LowerDFGToLLVM::appendOSRExit):
     231        (JSC::FTL::LowerDFGToLLVM::observeMovHint):
     232        (JSC::FTL::LowerDFGToLLVM::addressFor):
     233        (JSC::FTL::LowerDFGToLLVM::payloadFor):
     234        (JSC::FTL::LowerDFGToLLVM::tagFor):
     235        * ftl/FTLOSREntry.cpp:
     236        (JSC::FTL::prepareOSREntry):
     237        * ftl/FTLOSRExit.cpp:
     238        (JSC::FTL::OSRExit::convertToForward):
     239        * ftl/FTLOSRExit.h:
     240        * ftl/FTLOSRExitCompiler.cpp:
     241        (JSC::FTL::compileStub):
     242        * interpreter/CallFrame.h:
     243        * interpreter/Interpreter.cpp:
     244        (JSC::Interpreter::dumpRegisters):
     245        (JSC::unwindCallFrame):
     246        (JSC::Interpreter::unwind):
     247        * jit/AssemblyHelpers.h:
     248        (JSC::AssemblyHelpers::addressFor):
     249        (JSC::AssemblyHelpers::tagFor):
     250        (JSC::AssemblyHelpers::payloadFor):
     251        (JSC::AssemblyHelpers::argumentsRegisterFor):
     252        * jit/JIT.h:
     253        * jit/JITCall.cpp:
     254        (JSC::JIT::compileLoadVarargs):
     255        * jit/JITInlines.h:
     256        (JSC::JIT::emitGetVirtualRegister):
     257        * jit/JITOpcodes.cpp:
     258        (JSC::JIT::emit_op_tear_off_arguments):
     259        (JSC::JIT::emit_op_get_pnames):
     260        (JSC::JIT::emit_op_enter):
     261        (JSC::JIT::emit_op_create_arguments):
     262        (JSC::JIT::emitSlow_op_get_argument_by_val):
     263        * jit/JITOpcodes32_64.cpp:
     264        (JSC::JIT::emit_op_enter):
     265        * jit/JITStubs.cpp:
     266        (JSC::DEFINE_STUB_FUNCTION):
     267        * llint/LLIntSlowPaths.cpp:
     268        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
     269        * profiler/ProfilerBytecodeSequence.cpp:
     270        (JSC::Profiler::BytecodeSequence::BytecodeSequence):
     271        * runtime/CommonSlowPaths.cpp:
     272        (JSC::SLOW_PATH_DECL):
     273        * runtime/JSActivation.cpp:
     274        (JSC::JSActivation::argumentsGetter):
     275
    12762013-09-26  Oliver Hunt  <oliver@apple.com>
    2277
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r156474 r156482  
    169169
    170170    if (operandIsArgument(r)) {
    171         if (!VirtualRegister(r).toArgument())
     171        if (!operandToArgument(r))
    172172            return "this";
    173         return toCString("arg", VirtualRegister(r).toArgument());
    174     }
    175 
    176     return toCString("loc", VirtualRegister(r).toLocal());
     173        return toCString("arg", operandToArgument(r));
     174    }
     175
     176    return toCString("loc", operandToLocal(r));
    177177}
    178178
     
    515515        out.printf(
    516516            "; uses arguments, in r%d, r%d",
    517             argumentsRegister().offset(),
    518             unmodifiedArgumentsRegister(argumentsRegister()).offset());
     517            argumentsRegister(),
     518            unmodifiedArgumentsRegister(argumentsRegister()));
    519519    }
    520520    if (needsFullScopeChain() && codeType() == FunctionCode)
    521         out.printf("; activation in r%d", activationRegister().offset());
     521        out.printf("; activation in r%d", activationRegister());
    522522    out.printf("\n");
    523523   
     
    16201620    setConstantRegisters(unlinkedCodeBlock->constantRegisters());
    16211621    if (unlinkedCodeBlock->usesGlobalObject())
    1622         m_constantRegisters[unlinkedCodeBlock->globalObjectRegister().offset()].set(*m_vm, ownerExecutable, m_globalObject.get());
     1622        m_constantRegisters[unlinkedCodeBlock->globalObjectRegister()].set(*m_vm, ownerExecutable, m_globalObject.get());
    16231623    m_functionDecls.grow(unlinkedCodeBlock->numberOfFunctionDecls());
    16241624    for (size_t count = unlinkedCodeBlock->numberOfFunctionDecls(), i = 0; i < count; ++i) {
     
    25582558    ASSERT(codeType() == FunctionCode);
    25592559    ASSERT(needsFullScopeChain());
    2560     ASSERT(!callFrame->uncheckedR(activationRegister().offset()).jsValue());
     2560    ASSERT(!callFrame->uncheckedR(activationRegister()).jsValue());
    25612561    JSActivation* activation = JSActivation::create(callFrame->vm(), callFrame, this);
    2562     callFrame->uncheckedR(activationRegister().offset()) = JSValue(activation);
     2562    callFrame->uncheckedR(activationRegister()) = JSValue(activation);
    25632563    callFrame->setScope(activation);
    25642564}
     
    33283328}
    33293329
    3330 String CodeBlock::nameForRegister(VirtualRegister virtualRegister)
     3330String CodeBlock::nameForRegister(int registerNumber)
    33313331{
    33323332    ConcurrentJITLocker locker(symbolTable()->m_lock);
    33333333    SymbolTable::Map::iterator end = symbolTable()->end(locker);
    33343334    for (SymbolTable::Map::iterator ptr = symbolTable()->begin(locker); ptr != end; ++ptr) {
    3335         if (ptr->value.getIndex() == virtualRegister.offset()) {
     3335        if (ptr->value.getIndex() == registerNumber) {
    33363336            // FIXME: This won't work from the compilation thread.
    33373337            // https://bugs.webkit.org/show_bug.cgi?id=115300
     
    33393339        }
    33403340    }
    3341     if (needsActivation() && virtualRegister == activationRegister())
     3341    if (needsActivation() && registerNumber == activationRegister())
    33423342        return ASCIILiteral("activation");
    3343     if (virtualRegister == thisRegister())
     3343    if (registerNumber == thisRegister())
    33443344        return ASCIILiteral("this");
    33453345    if (usesArguments()) {
    3346         if (virtualRegister == argumentsRegister())
     3346        if (registerNumber == argumentsRegister())
    33473347            return ASCIILiteral("arguments");
    3348         if (unmodifiedArgumentsRegister(argumentsRegister()) == virtualRegister)
     3348        if (unmodifiedArgumentsRegister(argumentsRegister()) == registerNumber)
    33493349            return ASCIILiteral("real arguments");
    33503350    }
    3351     if (virtualRegister.isArgument())
    3352         return String::format("arguments[%3d]", virtualRegister.toArgument()).impl();
    3353 
     3351    if (registerNumber < 0) {
     3352        int argumentPosition = -registerNumber;
     3353        argumentPosition -= JSStack::CallFrameHeaderSize + 1;
     3354        return String::format("arguments[%3d]", argumentPosition - 1).impl();
     3355    }
    33543356    return "";
    33553357}
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r156474 r156482  
    7272#include "UnconditionalFinalizer.h"
    7373#include "ValueProfile.h"
    74 #include "VirtualRegister.h"
    7574#include "Watchpoint.h"
    7675#include <wtf/FastMalloc.h>
     
    8887class RepatchBuffer;
    8988
    90 inline VirtualRegister unmodifiedArgumentsRegister(VirtualRegister argumentsRegister) { return VirtualRegister(argumentsRegister.offset() + 1); }
     89inline int unmodifiedArgumentsRegister(int argumentsRegister) { return argumentsRegister + 1; }
    9190
    9291static ALWAYS_INLINE int missingThisObjectMarker() { return std::numeric_limits<int>::max(); }
     
    150149    inline bool isKnownNotImmediate(int index)
    151150    {
    152         if (index == m_thisRegister.offset() && !m_isStrictMode)
     151        if (index == m_thisRegister && !m_isStrictMode)
    153152            return true;
    154153
     
    300299    VM* vm() { return m_vm; }
    301300
    302     void setThisRegister(VirtualRegister thisRegister) { m_thisRegister = thisRegister; }
    303     VirtualRegister thisRegister() const { return m_thisRegister; }
     301    void setThisRegister(int thisRegister) { m_thisRegister = thisRegister; }
     302    int thisRegister() const { return m_thisRegister; }
    304303
    305304    bool needsFullScopeChain() const { return m_unlinkedCode->needsFullScopeChain(); }
    306305    bool usesEval() const { return m_unlinkedCode->usesEval(); }
    307306
    308     void setArgumentsRegister(VirtualRegister argumentsRegister)
    309     {
    310         ASSERT(argumentsRegister.isValid());
     307    void setArgumentsRegister(int argumentsRegister)
     308    {
     309        ASSERT(argumentsRegister != (int)InvalidVirtualRegister);
    311310        m_argumentsRegister = argumentsRegister;
    312311        ASSERT(usesArguments());
    313312    }
    314     VirtualRegister argumentsRegister() const
     313    int argumentsRegister() const
    315314    {
    316315        ASSERT(usesArguments());
    317316        return m_argumentsRegister;
    318317    }
    319     VirtualRegister uncheckedArgumentsRegister()
     318    int uncheckedArgumentsRegister()
    320319    {
    321320        if (!usesArguments())
    322             return VirtualRegister();
     321            return InvalidVirtualRegister;
    323322        return argumentsRegister();
    324323    }
    325     void setActivationRegister(VirtualRegister activationRegister)
     324    void setActivationRegister(int activationRegister)
    326325    {
    327326        m_activationRegister = activationRegister;
    328327    }
    329 
    330     VirtualRegister activationRegister() const
     328    int activationRegister() const
    331329    {
    332330        ASSERT(needsFullScopeChain());
    333331        return m_activationRegister;
    334332    }
    335 
    336     VirtualRegister uncheckedActivationRegister()
     333    int uncheckedActivationRegister()
    337334    {
    338335        if (!needsFullScopeChain())
    339             return VirtualRegister();
     336            return InvalidVirtualRegister;
    340337        return activationRegister();
    341338    }
    342 
    343     bool usesArguments() const { return m_argumentsRegister.isValid(); }
     339    bool usesArguments() const { return m_argumentsRegister != (int)InvalidVirtualRegister; }
    344340
    345341    bool needsActivation() const
     
    348344    }
    349345
    350     bool isCaptured(VirtualRegister operand, InlineCallFrame* inlineCallFrame = 0) const
    351     {
    352         if (operand.isArgument())
    353             return operand.toArgument() && usesArguments();
     346    bool isCaptured(int operand, InlineCallFrame* inlineCallFrame = 0) const
     347    {
     348        if (operandIsArgument(operand))
     349            return operandToArgument(operand) && usesArguments();
    354350
    355351        if (inlineCallFrame)
    356             return inlineCallFrame->capturedVars.get(operand.toLocal());
     352            return inlineCallFrame->capturedVars.get(operandToLocal(operand));
    357353
    358354        // The activation object isn't in the captured region, but it's "captured"
     
    373369            return false;
    374370
    375         return operand.offset() <= symbolTable()->captureStart()
    376             && operand.offset() > symbolTable()->captureEnd();
     371        return operand <= symbolTable()->captureStart()
     372            && operand > symbolTable()->captureEnd();
    377373    }
    378374
     
    396392    void clearEvalCache();
    397393
    398     String nameForRegister(VirtualRegister);
     394    String nameForRegister(int registerNumber);
    399395
    400396#if ENABLE(JIT)
     
    10321028
    10331029    RefCountedArray<Instruction> m_instructions;
    1034     VirtualRegister m_thisRegister;
    1035     VirtualRegister m_argumentsRegister;
    1036     VirtualRegister m_activationRegister;
     1030    int m_thisRegister;
     1031    int m_argumentsRegister;
     1032    int m_activationRegister;
    10371033
    10381034    bool m_isStrictMode;
  • trunk/Source/JavaScriptCore/bytecode/Instruction.h

    r156474 r156482  
    3636#include "Structure.h"
    3737#include "StructureChain.h"
    38 #include "VirtualRegister.h"
    3938#include <wtf/VectorTraits.h>
    4039
  • trunk/Source/JavaScriptCore/bytecode/LazyOperandValueProfile.h

    r156474 r156482  
    4747    LazyOperandValueProfileKey()
    4848        : m_bytecodeOffset(0) // 0 = empty value
    49         , m_operand(VirtualRegister()) // not a valid operand index in our current scheme
     49        , m_operand(InvalidVirtualRegister) // not a valid operand index in our current scheme
    5050    {
    5151    }
     
    5353    LazyOperandValueProfileKey(WTF::HashTableDeletedValueType)
    5454        : m_bytecodeOffset(1) // 1 = deleted value
    55         , m_operand(VirtualRegister()) // not a valid operand index in our current scheme
     55        , m_operand(InvalidVirtualRegister) // not a valid operand index in our current scheme
    5656    {
    5757    }
    5858   
    59     LazyOperandValueProfileKey(unsigned bytecodeOffset, VirtualRegister operand)
     59    LazyOperandValueProfileKey(unsigned bytecodeOffset, int operand)
    6060        : m_bytecodeOffset(bytecodeOffset)
    6161        , m_operand(operand)
    6262    {
    63         ASSERT(m_operand.isValid());
     63        ASSERT(operand != InvalidVirtualRegister);
    6464    }
    6565   
    6666    bool operator!() const
    6767    {
    68         return !m_operand.isValid();
     68        return m_operand == InvalidVirtualRegister;
    6969    }
    7070   
     
    7777    unsigned hash() const
    7878    {
    79         return WTF::intHash(m_bytecodeOffset) + m_operand.offset();
     79        return WTF::intHash(m_bytecodeOffset) + m_operand;
    8080    }
    8181   
     
    8585        return m_bytecodeOffset;
    8686    }
    87 
    88     VirtualRegister operand() const
     87    int operand() const
    8988    {
    9089        ASSERT(!!*this);
     
    9493    bool isHashTableDeletedValue() const
    9594    {
    96         return !m_operand.isValid() && m_bytecodeOffset;
     95        return m_operand == InvalidVirtualRegister && m_bytecodeOffset;
    9796    }
    9897private:
    9998    unsigned m_bytecodeOffset;
    100     VirtualRegister m_operand;
     99    int m_operand;
    101100};
    102101
     
    131130    LazyOperandValueProfile()
    132131        : MinimalValueProfile()
    133         , m_operand(VirtualRegister())
     132        , m_operand(InvalidVirtualRegister)
    134133    {
    135134    }
     
    146145    }
    147146   
    148     VirtualRegister m_operand;
     147    int m_operand;
    149148   
    150149    typedef SegmentedVector<LazyOperandValueProfile, 8> List;
  • trunk/Source/JavaScriptCore/bytecode/MethodOfGettingAValueProfile.cpp

    r156474 r156482  
    4040    result.u.lazyOperand.codeBlock = codeBlock;
    4141    result.u.lazyOperand.bytecodeOffset = key.bytecodeOffset();
    42     result.u.lazyOperand.operand = key.operand().offset();
     42    result.u.lazyOperand.operand = key.operand();
    4343    return result;
    4444}
     
    5454       
    5555    case LazyOperand: {
    56         LazyOperandValueProfileKey key(u.lazyOperand.bytecodeOffset, VirtualRegister(u.lazyOperand.operand));
     56        LazyOperandValueProfileKey key(u.lazyOperand.bytecodeOffset, u.lazyOperand.operand);
    5757       
    5858        ConcurrentJITLocker locker(u.lazyOperand.codeBlock->m_lock);
  • trunk/Source/JavaScriptCore/bytecode/Operands.h

    r156474 r156482  
    2929#include "CallFrame.h"
    3030#include "JSObject.h"
    31 #include "VirtualRegister.h"
    32 
    3331#include <wtf/PrintStream.h>
    3432#include <wtf/Vector.h>
    3533
    3634namespace JSC {
     35
     36inline int localToOperand(int local) { return -local; }
     37inline bool operandIsLocal(int operand) { return operand <= 0; }
     38inline int operandToLocal(int operand) { return -operand; }
     39
     40// argument 0 is 'this'.
     41inline bool operandIsArgument(int operand) { return operand > 0; }
     42inline int operandToArgument(int operand) { return operand - CallFrame::thisArgumentOffset(); }
     43inline int argumentToOperand(int argument) { return argument + CallFrame::thisArgumentOffset(); }
    3744
    3845template<typename T> struct OperandValueTraits;
     
    137144    {
    138145        if (operandIsArgument(operand)) {
    139             int argument = VirtualRegister(operand).toArgument();
     146            int argument = operandToArgument(operand);
    140147            return m_arguments[argument];
    141148        }
    142 
    143         return m_locals[VirtualRegister(operand).toLocal()];
    144     }
    145 
    146     T& operand(VirtualRegister virtualRegister)
    147     {
    148         return operand(virtualRegister.offset());
    149     }
    150 
     149       
     150        return m_locals[operandToLocal(operand)];
     151    }
     152   
    151153    const T& operand(int operand) const { return const_cast<const T&>(const_cast<Operands*>(this)->operand(operand)); }
    152154   
     
    155157        if (operandIsArgument(operand))
    156158            return true;
    157         return static_cast<size_t>(VirtualRegister(operand).toLocal()) < numberOfLocals();
     159        return static_cast<size_t>(operandToLocal(operand)) < numberOfLocals();
    158160    }
    159161   
     
    161163    {
    162164        if (operandIsArgument(operand)) {
    163             int argument = VirtualRegister(operand).toArgument();
     165            int argument = operandToArgument(operand);
    164166            m_arguments[argument] = value;
    165167            return;
    166168        }
    167169       
    168         setLocal(VirtualRegister(operand).toLocal(), value);
    169     }
    170    
    171     void setOperand(VirtualRegister virtualRegister, const T& value)
    172     {
    173         setOperand(virtualRegister.offset(), value);
    174     }
    175 
     170        setLocal(operandToLocal(operand), value);
     171    }
     172   
    176173    size_t size() const { return numberOfArguments() + numberOfLocals(); }
    177174    const T& at(size_t index) const
     
    203200    {
    204201        if (index < numberOfArguments())
    205             return virtualRegisterForArgument(index).offset();
    206         return virtualRegisterForLocal(index - numberOfArguments()).offset();
     202            return argumentToOperand(index);
     203        return localToOperand(index - numberOfArguments());
    207204    }
    208205   
     
    210207    {
    211208        if (operandIsArgument(operand)) {
    212             setArgumentFirstTime(VirtualRegister(operand).toArgument(), value);
     209            setArgumentFirstTime(operandToArgument(operand), value);
    213210            return;
    214211        }
    215212       
    216         setLocalFirstTime(VirtualRegister(operand).toLocal(), value);
     213        setLocalFirstTime(operandToLocal(operand), value);
    217214    }
    218215   
  • trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp

    r156474 r156482  
    195195    , m_numParameters(0)
    196196    , m_vm(vm)
    197     , m_argumentsRegister(VirtualRegister())
    198     , m_globalObjectRegister(VirtualRegister())
     197    , m_argumentsRegister((int)InvalidVirtualRegister)
     198    , m_globalObjectRegister((int)InvalidVirtualRegister)
    199199    , m_needsFullScopeChain(info.m_needsActivation)
    200200    , m_usesEval(info.m_usesEval)
  • trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h

    r156474 r156482  
    255255
    256256    // Special registers
    257     void setThisRegister(VirtualRegister thisRegister) { m_thisRegister = thisRegister; }
    258     void setActivationRegister(VirtualRegister activationRegister) { m_activationRegister = activationRegister; }
    259 
    260     void setArgumentsRegister(VirtualRegister argumentsRegister) { m_argumentsRegister = argumentsRegister; }
    261     bool usesArguments() const { return m_argumentsRegister.isValid(); }
    262     VirtualRegister argumentsRegister() const { return m_argumentsRegister; }
    263 
    264 
    265     bool usesGlobalObject() const { return m_globalObjectRegister.isValid(); }
    266     void setGlobalObjectRegister(VirtualRegister globalObjectRegister) { m_globalObjectRegister = globalObjectRegister; }
    267     VirtualRegister globalObjectRegister() const { return m_globalObjectRegister; }
     257    void setThisRegister(int thisRegister) { m_thisRegister = thisRegister; }
     258    void setActivationRegister(int activationRegister) { m_activationRegister = activationRegister; }
     259
     260    void setArgumentsRegister(int argumentsRegister) { m_argumentsRegister = argumentsRegister; }
     261    bool usesArguments() const { return m_argumentsRegister != (int)InvalidVirtualRegister; }
     262    int argumentsRegister() const { return m_argumentsRegister; }
     263
     264
     265    bool usesGlobalObject() const { return m_globalObjectRegister != (int)InvalidVirtualRegister; }
     266    void setGlobalObjectRegister(int globalObjectRegister) { m_globalObjectRegister = globalObjectRegister; }
     267    int globalObjectRegister() const { return m_globalObjectRegister; }
    268268
    269269    // Parameter information
     
    400400    CodeType codeType() const { return m_codeType; }
    401401
    402     VirtualRegister thisRegister() const { return m_thisRegister; }
    403     VirtualRegister activationRegister() const { return m_activationRegister; }
     402    int thisRegister() const { return m_thisRegister; }
     403    int activationRegister() const { return m_activationRegister; }
    404404
    405405
     
    480480    VM* m_vm;
    481481
    482     VirtualRegister m_thisRegister;
    483     VirtualRegister m_argumentsRegister;
    484     VirtualRegister m_activationRegister;
    485     VirtualRegister m_globalObjectRegister;
     482    int m_thisRegister;
     483    int m_argumentsRegister;
     484    int m_activationRegister;
     485    int m_globalObjectRegister;
    486486
    487487    bool m_needsFullScopeChain : 1;
  • trunk/Source/JavaScriptCore/bytecode/ValueRecovery.h

    r156474 r156482  
    212212            break;
    213213        }
    214         result.m_source.virtualReg = virtualReg.offset();
     214        result.m_source.virtualReg = virtualReg;
    215215        return result;
    216216    }
     
    295295    {
    296296        ASSERT(m_technique == DisplacedInJSStack || m_technique == Int32DisplacedInJSStack || m_technique == DoubleDisplacedInJSStack || m_technique == CellDisplacedInJSStack || m_technique == BooleanDisplacedInJSStack || m_technique == Int52DisplacedInJSStack || m_technique == StrictInt52DisplacedInJSStack);
    297         return VirtualRegister(m_source.virtualReg);
     297        return m_source.virtualReg;
    298298    }
    299299   
     
    352352#endif
    353353        case DisplacedInJSStack:
    354             out.printf("*%d", virtualRegister().offset());
     354            out.printf("*%d", virtualRegister());
    355355            return;
    356356        case Int32DisplacedInJSStack:
    357             out.printf("*int32(%d)", virtualRegister().offset());
     357            out.printf("*int32(%d)", virtualRegister());
    358358            return;
    359359        case Int52DisplacedInJSStack:
    360             out.printf("*int52(%d)", virtualRegister().offset());
     360            out.printf("*int52(%d)", virtualRegister());
    361361            return;
    362362        case StrictInt52DisplacedInJSStack:
    363             out.printf("*strictInt52(%d)", virtualRegister().offset());
     363            out.printf("*strictInt52(%d)", virtualRegister());
    364364            return;
    365365        case DoubleDisplacedInJSStack:
    366             out.printf("*double(%d)", virtualRegister().offset());
     366            out.printf("*double(%d)", virtualRegister());
    367367            return;
    368368        case CellDisplacedInJSStack:
    369             out.printf("*cell(%d)", virtualRegister().offset());
     369            out.printf("*cell(%d)", virtualRegister());
    370370            return;
    371371        case BooleanDisplacedInJSStack:
    372             out.printf("*bool(%d)", virtualRegister().offset());
     372            out.printf("*bool(%d)", virtualRegister());
    373373            return;
    374374        case ArgumentsThatWereNotCreated:
     
    401401        } pair;
    402402#endif
    403         int virtualReg;
     403        VirtualRegister virtualReg;
    404404        EncodedJSValue constant;
    405405    } m_source;
  • trunk/Source/JavaScriptCore/bytecode/VirtualRegister.h

    r156474 r156482  
    2727#define VirtualRegister_h
    2828
    29 #include "CallFrame.h"
    30 
    3129#include <wtf/Platform.h>
    3230#include <wtf/PrintStream.h>
     
    3432namespace JSC {
    3533
    36 inline bool operandIsLocal(int operand)
    37 {
    38     return operand <= 0;
    39 }
    40 
    41 inline bool operandIsArgument(int operand)
    42 {
    43     return operand > 0;
    44 }
    45 
    46 
    47 class VirtualRegister {
    48 public:
    49     friend VirtualRegister virtualRegisterForLocal(int);
    50     friend VirtualRegister virtualRegisterForArgument(int, int);
    51 
    52     VirtualRegister()
    53         : m_virtualRegister(s_invalidVirtualRegister)
    54     { }
    55 
    56     explicit VirtualRegister(int virtualRegister)
    57         : m_virtualRegister(virtualRegister)
    58     { }
    59 
    60     bool isValid() const { return (m_virtualRegister != s_invalidVirtualRegister); }
    61     bool isLocal() const { return operandIsLocal(m_virtualRegister); }
    62     bool isArgument() const { return operandIsArgument(m_virtualRegister); }
    63     bool isConstant() const { return m_virtualRegister >= s_firstConstantRegisterIndex; }
    64     int toLocal() const { ASSERT(isLocal()); return operandToLocal(m_virtualRegister); }
    65     int toArgument() const { ASSERT(isArgument()); return operandToArgument(m_virtualRegister); }
    66     int toConstantIndex() const { ASSERT(isConstant()); return m_virtualRegister - s_firstConstantRegisterIndex; }
    67     int offset() const { return m_virtualRegister; }
    68 
    69     bool operator==(const VirtualRegister other) const { return m_virtualRegister == other.m_virtualRegister; }
    70     bool operator!=(const VirtualRegister other) const { return m_virtualRegister != other.m_virtualRegister; }
    71 
    72 private:
    73     static const int s_invalidVirtualRegister = 0x3fffffff;
    74     static const int s_firstConstantRegisterIndex = 0x40000000;
    75 
    76     static int localToOperand(int local) { return -local; }
    77     static int operandToLocal(int operand) { return -operand; }
    78     static int operandToArgument(int operand) { return operand - CallFrame::thisArgumentOffset(); }
    79     static int argumentToOperand(int argument) { return argument + CallFrame::thisArgumentOffset(); }
    80 
    81     int m_virtualRegister;
    82 };
    83 
     34// Type for a virtual register number (spill location).
     35// Using an enum to make this type-checked at compile time, to avert programmer errors.
     36enum VirtualRegister { InvalidVirtualRegister = 0x3fffffff };
    8437COMPILE_ASSERT(sizeof(VirtualRegister) == sizeof(int), VirtualRegister_is_32bit);
    85 
    86 inline VirtualRegister virtualRegisterForLocal(int local)
    87 {
    88     return VirtualRegister(VirtualRegister::localToOperand(local));
    89 }
    90 
    91 inline VirtualRegister virtualRegisterForArgument(int argument, int offset = 0)
    92 {
    93     return VirtualRegister(VirtualRegister::argumentToOperand(argument) + offset);
    94 }
    9538
    9639} // namespace JSC
     
    10043inline void printInternal(PrintStream& out, JSC::VirtualRegister value)
    10144{
    102     out.print(value.offset());
     45    out.print(static_cast<int>(value));
    10346}
    10447
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r156474 r156482  
    6161    SamplingRegion samplingRegion("Bytecode Generation");
    6262   
    63     m_codeBlock->setThisRegister(m_thisRegister.virtualRegister());
     63    m_codeBlock->setThisRegister(m_thisRegister.index());
    6464
    6565    m_scopeNode->emitBytecode(*this);
     
    118118{
    119119    ConcurrentJITLocker locker(symbolTable().m_lock);
    120     int index = virtualRegisterForLocal(m_calleeRegisters.size()).offset();
     120    int index = localToOperand(m_calleeRegisters.size());
    121121    SymbolTableEntry newEntry(index, isConstant ? ReadOnly : 0);
    122122    SymbolTable::Map::AddResult result = symbolTable().add(locker, ident.impl(), newEntry);
     
    231231        m_activationRegister = addVar();
    232232        emitInitLazyRegister(m_activationRegister);
    233         m_codeBlock->setActivationRegister(m_activationRegister->virtualRegister());
    234     }
    235 
    236     m_symbolTable->setCaptureStart(virtualRegisterForLocal(m_codeBlock->m_numVars).offset());
     233        m_codeBlock->setActivationRegister(m_activationRegister->index());
     234    }
     235
     236    m_symbolTable->setCaptureStart(localToOperand(m_codeBlock->m_numVars));
    237237
    238238    if (functionBody->usesArguments() || codeBlock->usesEval()) { // May reify arguments object.
     
    243243        // 'arguments' values are stored in consecutive registers, and storing
    244244        // only the index of the assignable one.
    245         codeBlock->setArgumentsRegister(argumentsRegister->virtualRegister());
    246         ASSERT_UNUSED(unmodifiedArgumentsRegister, unmodifiedArgumentsRegister->virtualRegister() == JSC::unmodifiedArgumentsRegister(codeBlock->argumentsRegister()));
     245        codeBlock->setArgumentsRegister(argumentsRegister->index());
     246        ASSERT_UNUSED(unmodifiedArgumentsRegister, unmodifiedArgumentsRegister->index() == JSC::unmodifiedArgumentsRegister(codeBlock->argumentsRegister()));
    247247
    248248        emitInitLazyRegister(argumentsRegister);
     
    325325    }
    326326
    327     m_symbolTable->setCaptureEnd(virtualRegisterForLocal(codeBlock->m_numVars).offset());
     327    m_symbolTable->setCaptureEnd(localToOperand(codeBlock->m_numVars));
    328328
    329329    m_firstLazyFunction = codeBlock->m_numVars;
     
    340340            else {
    341341                emitInitLazyRegister(reg.get());
    342                 m_lazyFunctions.set(reg->virtualRegister().toLocal(), function);
     342                m_lazyFunctions.set(localToOperand(reg->index()), function);
    343343            }
    344344        }
     
    352352
    353353    if (shouldCaptureAllTheThings)
    354         m_symbolTable->setCaptureEnd(virtualRegisterForLocal(codeBlock->m_numVars).offset());
     354        m_symbolTable->setCaptureEnd(localToOperand(codeBlock->m_numVars));
    355355
    356356    m_parameters.grow(parameters.size() + 1); // reserve space for "this"
     
    534534RegisterID* BytecodeGenerator::createLazyRegisterIfNecessary(RegisterID* reg)
    535535{
    536     if (!reg->virtualRegister().isLocal())
    537         return reg;
    538 
    539     int localVariableNumber = reg->virtualRegister().toLocal();
    540 
     536    int localVariableNumber = operandToLocal(reg->index());
     537   
    541538    if (m_lastLazyFunction <= localVariableNumber || localVariableNumber < m_firstLazyFunction)
    542539        return reg;
     
    547544RegisterID* BytecodeGenerator::newRegister()
    548545{
    549     m_calleeRegisters.append(virtualRegisterForLocal(m_calleeRegisters.size()));
     546    m_calleeRegisters.append(localToOperand(m_calleeRegisters.size()));
    550547    m_codeBlock->m_numCalleeRegisters = max<int>(m_codeBlock->m_numCalleeRegisters, m_calleeRegisters.size());
    551548    return &m_calleeRegisters.last();
     
    11501147        m_codeBlock->addConstant(JSValue());
    11511148        m_globalObjectRegister = &m_constantPoolRegisters[index];
    1152         m_codeBlock->setGlobalObjectRegister(VirtualRegister(index));
     1149        m_codeBlock->setGlobalObjectRegister(index);
    11531150    }
    11541151    if (dst)
     
    12941291    emitOpcode(op_get_arguments_length);
    12951292    instructions().append(dst->index());
    1296     ASSERT(base->virtualRegister() == m_codeBlock->argumentsRegister());
     1293    ASSERT(base->index() == m_codeBlock->argumentsRegister());
    12971294    instructions().append(base->index());
    12981295    instructions().append(addConstant(propertyNames().length));
     
    13691366    UnlinkedValueProfile profile = emitProfiledOpcode(op_get_argument_by_val);
    13701367    instructions().append(kill(dst));
    1371     ASSERT(base->virtualRegister() == m_codeBlock->argumentsRegister());
     1368    ASSERT(base->index() == m_codeBlock->argumentsRegister());
    13721369    instructions().append(base->index());
    13731370    instructions().append(property->index());
     
    15891586
    15901587    emitOpcode(op_create_arguments);
    1591     instructions().append(m_codeBlock->argumentsRegister().offset());
     1588    instructions().append(m_codeBlock->argumentsRegister());
    15921589}
    15931590
     
    17741771    if (m_codeBlock->usesArguments() && m_codeBlock->numParameters() != 1 && !isStrictMode()) {
    17751772        emitOpcode(op_tear_off_arguments);
    1776         instructions().append(m_codeBlock->argumentsRegister().offset());
     1773        instructions().append(m_codeBlock->argumentsRegister());
    17771774        instructions().append(m_activationRegister ? m_activationRegister->index() : emitLoad(0, JSValue())->index());
    17781775    }
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h

    r156474 r156482  
    503503        {
    504504            if (operandIsLocal(index))
    505                 return m_calleeRegisters[VirtualRegister(index).toLocal()];
     505                return m_calleeRegisters[operandToLocal(index)];
    506506
    507507            if (index == JSStack::Callee)
     
    509509
    510510            ASSERT(m_parameters.size());
    511             return m_parameters[VirtualRegister(index).toArgument()];
     511            return m_parameters[operandToArgument(index)];
    512512        }
    513513
  • trunk/Source/JavaScriptCore/bytecompiler/RegisterID.h

    r156474 r156482  
    3030#define RegisterID_h
    3131
    32 #include "VirtualRegister.h"
    33 
    3432#include <wtf/Assertions.h>
    3533#include <wtf/VectorTraits.h>
     
    4947        }
    5048
    51         RegisterID(VirtualRegister virtualRegister)
    52             : m_refCount(0)
    53             , m_virtualRegister(virtualRegister)
    54             , m_isTemporary(false)
    55 #ifndef NDEBUG
    56             , m_didSetIndex(true)
    57 #endif
    58         {
    59         }
    60        
    6149        explicit RegisterID(int index)
    6250            : m_refCount(0)
    63             , m_virtualRegister(VirtualRegister(index))
     51            , m_index(index)
    6452            , m_isTemporary(false)
    6553#ifndef NDEBUG
     
    7563            m_didSetIndex = true;
    7664#endif
    77             m_virtualRegister = VirtualRegister(index);
     65            m_index = index;
    7866        }
    7967
     
    8674        {
    8775            ASSERT(m_didSetIndex);
    88             return m_virtualRegister.offset();
    89         }
    90 
    91         VirtualRegister virtualRegister() const
    92         {
    93             ASSERT(m_virtualRegister.isValid());
    94             return m_virtualRegister;
     76            return m_index;
    9577        }
    9678
     
    119101
    120102        int m_refCount;
    121         VirtualRegister m_virtualRegister;
     103        int m_index;
    122104        bool m_isTemporary;
    123105#ifndef NDEBUG
  • trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp

    r156474 r156482  
    110110        return 0;
    111111
    112     JSValue thisValue = m_callFrame->uncheckedR(codeBlock->thisRegister().offset()).jsValue();
     112    JSValue thisValue = m_callFrame->uncheckedR(codeBlock->thisRegister()).jsValue();
    113113    if (!thisValue.isObject())
    114114        return 0;
  • trunk/Source/JavaScriptCore/dfg/DFGAbstractHeap.h

    r156474 r156482  
    114114        Payload(VirtualRegister operand)
    115115            : m_isTop(false)
    116             , m_value(operand.offset())
     116            , m_value(static_cast<int>(operand))
    117117        {
    118118        }
  • trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h

    r156474 r156482  
    143143        ASSERT(m_graph.m_form == SSA);
    144144        VariableAccessData* variable = node->variableAccessData();
    145         AbstractValue& value = m_state.variables().operand(variable->local().offset());
     145        AbstractValue& value = m_state.variables().operand(variable->local());
    146146        ASSERT(value.isHeapTop());
    147147        FiltrationResult result =
     
    153153       
    154154    case ExtractOSREntryLocal: {
    155         if (!(node->unlinkedLocal().isArgument())
    156             && m_graph.m_lazyVars.get(node->unlinkedLocal().toLocal())) {
     155        if (!operandIsArgument(node->unlinkedLocal())
     156            && m_graph.m_lazyVars.get(operandToLocal(node->unlinkedLocal()))) {
    157157            // This is kind of pessimistic - we could know in some cases that the
    158158            // DFG code at the point of the OSR had already initialized the lazy
     
    172172            break;
    173173        }
    174         AbstractValue value = m_state.variables().operand(variableAccessData->local().offset());
     174        AbstractValue value = m_state.variables().operand(variableAccessData->local());
    175175        if (!variableAccessData->isCaptured()) {
    176176            if (value.isClear())
     
    184184       
    185185    case GetLocalUnlinked: {
    186         AbstractValue value = m_state.variables().operand(node->unlinkedLocal().offset());
     186        AbstractValue value = m_state.variables().operand(node->unlinkedLocal());
    187187        if (value.value())
    188188            m_state.setFoundConstants(true);
     
    192192       
    193193    case SetLocal: {
    194         m_state.variables().operand(node->local().offset()) = forNode(node->child1());
     194        m_state.variables().operand(node->local()) = forNode(node->child1());
    195195        break;
    196196    }
     
    11341134        if (isEmptySpeculation(
    11351135                m_state.variables().operand(
    1136                     m_graph.argumentsRegisterFor(node->codeOrigin).offset()).m_type))
     1136                    m_graph.argumentsRegisterFor(node->codeOrigin)).m_type))
    11371137            m_state.setFoundConstants(true);
    11381138        else
     
    16081608    } else {
    16091609        for (size_t i = m_codeBlock->m_numVars; i--;) {
    1610             if (m_codeBlock->isCaptured(virtualRegisterForLocal(i)))
     1610            if (m_codeBlock->isCaptured(localToOperand(i)))
    16111611                m_state.variables().local(i).makeHeapTop();
    16121612        }
     
    16141614
    16151615    for (size_t i = m_state.variables().numberOfArguments(); i--;) {
    1616         if (m_codeBlock->isCaptured(virtualRegisterForArgument(i)))
     1616        if (m_codeBlock->isCaptured(argumentToOperand(i)))
    16171617            m_state.variables().argument(i).makeHeapTop();
    16181618    }
  • trunk/Source/JavaScriptCore/dfg/DFGArgumentPosition.h

    r156474 r156482  
    119119        for (unsigned i = 0; i < m_variables.size(); ++i) {
    120120            VariableAccessData* variable = m_variables[i]->find();
    121             VirtualRegister operand = variable->local();
     121            int operand = variable->operand();
    122122
    123123            if (i)
    124124                out.print(" ");
    125125
    126             if (operand.isArgument())
    127                 out.print("arg", operand.toArgument(), "(", VariableAccessDataDump(*graph, variable), ")");
     126            if (operandIsArgument(operand))
     127                out.print("arg", operandToArgument(operand), "(", VariableAccessDataDump(*graph, variable), ")");
    128128            else
    129                 out.print("r", operand.toLocal(), "(", VariableAccessDataDump(*graph, variable), ")");
     129                out.print("r", operand, "(", VariableAccessDataDump(*graph, variable), ")");
    130130        }
    131131        out.print("\n");
  • trunk/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp

    r156474 r156482  
    189189                    Node* source = node->child1().node();
    190190                    VariableAccessData* variableAccessData = node->variableAccessData();
    191                     VirtualRegister argumentsRegister =
     191                    int argumentsRegister =
    192192                        m_graph.uncheckedArgumentsRegisterFor(node->codeOrigin);
    193193                    if (source->op() != CreateArguments && source->op() != PhantomArguments) {
     
    217217                            break;
    218218                       
    219                         if (argumentsRegister.isValid()
     219                        if (argumentsRegister != InvalidVirtualRegister
    220220                            && (variableAccessData->local() == argumentsRegister
    221221                                || variableAccessData->local() == unmodifiedArgumentsRegister(argumentsRegister))) {
     
    235235                        break;
    236236                    }
    237                     if (argumentsRegister.isValid()
     237                    if (argumentsRegister != InvalidVirtualRegister
    238238                        && (variableAccessData->local() == argumentsRegister
    239239                            || variableAccessData->local() == unmodifiedArgumentsRegister(argumentsRegister))) {
     
    620620                   
    621621                    node->convertToGetLocalUnlinked(
    622                         VirtualRegister(
     622                        static_cast<VirtualRegister>(
    623623                            node->codeOrigin.inlineCallFrame->stackOffset +
    624624                            m_graph.baselineCodeBlockFor(node->codeOrigin)->argumentIndexAfterCapture(index)));
     
    712712           
    713713        case GetLocal: {
    714             VirtualRegister argumentsRegister = m_graph.uncheckedArgumentsRegisterFor(node->codeOrigin);
    715             if (argumentsRegister.isValid()
     714            int argumentsRegister = m_graph.uncheckedArgumentsRegisterFor(node->codeOrigin);
     715            if (argumentsRegister != InvalidVirtualRegister
    716716                && (node->local() == argumentsRegister
    717717                    || node->local() == unmodifiedArgumentsRegister(argumentsRegister))) {
     
    784784        case GetLocal: {
    785785            VariableAccessData* variableAccessData = source->variableAccessData();
    786             VirtualRegister argumentsRegister = m_graph.uncheckedArgumentsRegisterFor(source->codeOrigin);
    787             if (!argumentsRegister.isValid())
     786            int argumentsRegister = m_graph.uncheckedArgumentsRegisterFor(source->codeOrigin);
     787            if (argumentsRegister == InvalidVirtualRegister)
    788788                break;
    789789            if (argumentsRegister == variableAccessData->local())
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r156474 r156482  
    192192    void linkBlocks(Vector<UnlinkedBlock>& unlinkedBlocks, Vector<BasicBlock*>& possibleTargets);
    193193   
    194     VariableAccessData* newVariableAccessData(VirtualRegister operand, bool isCaptured)
    195     {
    196         ASSERT(!operand.isConstant());
    197        
    198         m_graph.m_variableAccessData.append(VariableAccessData(operand, isCaptured));
     194    VariableAccessData* newVariableAccessData(int operand, bool isCaptured)
     195    {
     196        ASSERT(operand < FirstConstantRegisterIndex);
     197       
     198        m_graph.m_variableAccessData.append(VariableAccessData(static_cast<VirtualRegister>(operand), isCaptured));
    199199        return &m_graph.m_variableAccessData.last();
    200200    }
    201201   
    202202    // Get/Set the operands/result of a bytecode instruction.
    203     Node* getDirect(VirtualRegister operand)
     203    Node* getDirect(int operand)
    204204    {
    205205        // Is this a constant?
    206         if (operand.isConstant()) {
    207             unsigned constant = operand.toConstantIndex();
     206        if (operand >= FirstConstantRegisterIndex) {
     207            unsigned constant = operand - FirstConstantRegisterIndex;
    208208            ASSERT(constant < m_constants.size());
    209209            return getJSConstant(constant);
    210210        }
    211211
    212         ASSERT(operand.offset() != JSStack::Callee);
     212        ASSERT(operand != JSStack::Callee);
    213213       
    214214        // Is this an argument?
    215         if (operand.isArgument())
     215        if (operandIsArgument(operand))
    216216            return getArgument(operand);
    217217
     
    220220    }
    221221
    222     Node* get(VirtualRegister operand)
    223     {
    224         if (operand.offset() == JSStack::Callee) {
     222    Node* get(int operand)
     223    {
     224        if (operand == JSStack::Callee) {
    225225            if (inlineCallFrame() && inlineCallFrame()->callee)
    226226                return cellConstant(inlineCallFrame()->callee.get());
     
    231231        return getDirect(m_inlineStackTop->remapOperand(operand));
    232232    }
    233    
     233
    234234    enum SetMode { NormalSet, SetOnEntry };
    235     void setDirect(VirtualRegister operand, Node* value, SetMode setMode = NormalSet)
     235    void setDirect(int operand, Node* value, SetMode setMode = NormalSet)
    236236    {
    237237        // Is this an argument?
    238         if (operand.isArgument()) {
     238        if (operandIsArgument(operand)) {
    239239            setArgument(operand, value, setMode);
    240240            return;
     
    245245    }
    246246
    247     void set(VirtualRegister operand, Node* value, SetMode setMode = NormalSet)
     247    void set(int operand, Node* value, SetMode setMode = NormalSet)
    248248    {
    249249        setDirect(m_inlineStackTop->remapOperand(operand), value, setMode);
     
    265265
    266266    // Used in implementing get/set, above, where the operand is a local variable.
    267     Node* getLocal(VirtualRegister operand)
    268     {
    269         unsigned local = operand.toLocal();
     267    Node* getLocal(int operand)
     268    {
     269        unsigned local = operandToLocal(operand);
    270270        Node* node = m_currentBlock->variablesAtTail.local(local);
    271271        bool isCaptured = m_codeBlock->isCaptured(operand, inlineCallFrame());
     
    303303    }
    304304
    305     void setLocal(VirtualRegister operand, Node* value, SetMode setMode = NormalSet)
    306     {
    307         unsigned local = operand.toLocal();
     305    void setLocal(int operand, Node* value, SetMode setMode = NormalSet)
     306    {
     307        unsigned local = operandToLocal(operand);
    308308        bool isCaptured = m_codeBlock->isCaptured(operand, inlineCallFrame());
    309309       
     
    324324
    325325    // Used in implementing get/set, above, where the operand is an argument.
    326     Node* getArgument(VirtualRegister operand)
    327     {
    328         unsigned argument = operand.toArgument();
     326    Node* getArgument(unsigned operand)
     327    {
     328        unsigned argument = operandToArgument(operand);
    329329        ASSERT(argument < m_numArguments);
    330330       
     
    353353        return node;
    354354    }
    355     void setArgument(VirtualRegister operand, Node* value, SetMode setMode = NormalSet)
    356     {
    357         unsigned argument = operand.toArgument();
     355    void setArgument(int operand, Node* value, SetMode setMode = NormalSet)
     356    {
     357        unsigned argument = operandToArgument(operand);
    358358        ASSERT(argument < m_numArguments);
    359359       
     
    386386    }
    387387   
    388     ArgumentPosition* findArgumentPositionForLocal(VirtualRegister operand)
     388    ArgumentPosition* findArgumentPositionForLocal(int operand)
    389389    {
    390390        for (InlineStackEntry* stack = m_inlineStackTop; ; stack = stack->m_caller) {
     
    392392            if (!inlineCallFrame)
    393393                break;
    394             if (operand.offset() <= static_cast<int>(inlineCallFrame->stackOffset + JSStack::CallFrameHeaderSize))
     394            if (operand <= static_cast<int>(inlineCallFrame->stackOffset + JSStack::CallFrameHeaderSize))
    395395                continue;
    396             if (operand.offset() == inlineCallFrame->stackOffset + CallFrame::thisArgumentOffset())
     396            if (operand == inlineCallFrame->stackOffset + CallFrame::thisArgumentOffset())
    397397                continue;
    398             if (operand.offset() > static_cast<int>(inlineCallFrame->stackOffset + JSStack::CallFrameHeaderSize + inlineCallFrame->arguments.size()))
     398            if (operand > static_cast<int>(inlineCallFrame->stackOffset + JSStack::CallFrameHeaderSize + inlineCallFrame->arguments.size()))
    399399                continue;
    400             int argument = VirtualRegister(operand.offset() - inlineCallFrame->stackOffset).toArgument();
     400            int argument = operandToArgument(operand - inlineCallFrame->stackOffset);
    401401            return stack->m_argumentPositions[argument];
    402402        }
     
    404404    }
    405405   
    406     ArgumentPosition* findArgumentPosition(VirtualRegister operand)
    407     {
    408         if (operand.isArgument())
    409             return findArgumentPositionForArgument(operand.toArgument());
     406    ArgumentPosition* findArgumentPosition(int operand)
     407    {
     408        if (operandIsArgument(operand))
     409            return findArgumentPositionForArgument(operandToArgument(operand));
    410410        return findArgumentPositionForLocal(operand);
    411411    }
     
    423423    }
    424424   
    425     void flush(VirtualRegister operand)
     425    void flush(int operand)
    426426    {
    427427        flushDirect(m_inlineStackTop->remapOperand(operand));
    428428    }
    429429   
    430     void flushDirect(VirtualRegister operand)
     430    void flushDirect(int operand)
    431431    {
    432432        flushDirect(operand, findArgumentPosition(operand));
    433433    }
    434434   
    435     void flushDirect(VirtualRegister operand, ArgumentPosition* argumentPosition)
     435    void flushDirect(int operand, ArgumentPosition* argumentPosition)
    436436    {
    437437        bool isCaptured = m_codeBlock->isCaptured(operand, inlineCallFrame());
    438438       
    439         ASSERT(!operand.isConstant());
    440        
    441         if (operand.isLocal())
    442             m_preservedVars.set(operand.toLocal());
     439        ASSERT(operand < FirstConstantRegisterIndex);
     440       
     441        if (!operandIsArgument(operand))
     442            m_preservedVars.set(operandToLocal(operand));
    443443       
    444444        Node* node = m_currentBlock->variablesAtTail.operand(operand);
     
    466466            numArguments = inlineStackEntry->m_codeBlock->numParameters();
    467467        for (unsigned argument = numArguments; argument-- > 1;)
    468             flushDirect(inlineStackEntry->remapOperand(virtualRegisterForArgument(argument)));
     468            flushDirect(inlineStackEntry->remapOperand(argumentToOperand(argument)));
    469469        for (int local = 0; local < inlineStackEntry->m_codeBlock->m_numVars; ++local) {
    470             if (!inlineStackEntry->m_codeBlock->isCaptured(virtualRegisterForLocal(local)))
     470            if (!inlineStackEntry->m_codeBlock->isCaptured(localToOperand(local)))
    471471                continue;
    472             flushDirect(inlineStackEntry->remapOperand(virtualRegisterForLocal(local)));
     472            flushDirect(inlineStackEntry->remapOperand(localToOperand(local)));
    473473        }
    474474    }
     
    488488    Node* getToInt32(int operand)
    489489    {
    490         return toInt32(get(VirtualRegister(operand)));
     490        return toInt32(get(operand));
    491491    }
    492492
     
    550550        return get(m_inlineStackTop->m_codeBlock->thisRegister());
    551551    }
    552 
    553552    void setThis(Node* value)
    554553    {
     
    772771        SpeculatedType prediction = getPrediction();
    773772       
    774         addVarArgChild(get(VirtualRegister(currentInstruction[2].u.operand)));
     773        addVarArgChild(get(currentInstruction[2].u.operand));
    775774        int argCount = currentInstruction[3].u.operand;
    776775        if (JSStack::CallFrameHeaderSize + (unsigned)argCount > m_parameterSlots)
     
    780779        int dummyThisArgument = op == Call ? 0 : 1;
    781780        for (int i = 0 + dummyThisArgument; i < argCount; ++i)
    782             addVarArgChild(get(virtualRegisterForArgument(i, registerOffset)));
     781            addVarArgChild(get(registerOffset + argumentToOperand(i)));
    783782
    784783        Node* call = addToGraph(Node::VarArg, op, OpInfo(0), OpInfo(prediction));
    785         set(VirtualRegister(currentInstruction[1].u.operand), call);
     784        set(currentInstruction[1].u.operand, call);
    786785        return call;
    787786    }
     
    10971096        }
    10981097       
    1099         VirtualRegister remapOperand(VirtualRegister operand) const
     1098        int remapOperand(int operand) const
    11001099        {
    11011100            if (!m_inlineCallFrame)
    11021101                return operand;
    11031102           
    1104             if (operand.isConstant()) {
    1105                 VirtualRegister result = VirtualRegister(m_constantRemap[operand.toConstantIndex()]);
    1106                 ASSERT(result.isConstant());
     1103            if (operand >= FirstConstantRegisterIndex) {
     1104                int result = m_constantRemap[operand - FirstConstantRegisterIndex];
     1105                ASSERT(result >= FirstConstantRegisterIndex);
    11071106                return result;
    11081107            }
    11091108
    1110             ASSERT(operand.offset() != JSStack::Callee);
    1111 
    1112             return VirtualRegister(operand.offset() + m_inlineCallFrame->stackOffset);
     1109            ASSERT(operand != JSStack::Callee);
     1110
     1111            return operand + m_inlineCallFrame->stackOffset;
    11131112        }
    11141113    };
     
    11431142    ASSERT(OPCODE_LENGTH(op_call) == OPCODE_LENGTH(op_construct));
    11441143   
    1145     Node* callTarget = get(VirtualRegister(currentInstruction[2].u.operand));
     1144    Node* callTarget = get(currentInstruction[2].u.operand);
    11461145   
    11471146    CallLinkStatus callLinkStatus;
     
    12151214    Node* thisArgument;
    12161215    if (kind == CodeForCall)
    1217         thisArgument = get(virtualRegisterForArgument(0, registerOffset));
     1216        thisArgument = get(registerOffset + argumentToOperand(0));
    12181217    else
    12191218        thisArgument = 0;
     
    12401239{
    12411240    for (int i = kind == CodeForCall ? 0 : 1; i < argumentCountIncludingThis; ++i)
    1242         addToGraph(Phantom, get(virtualRegisterForArgument(i, registerOffset)));
     1241        addToGraph(Phantom, get(registerOffset + argumentToOperand(i)));
    12431242}
    12441243
     
    12941293    // FIXME: Don't flush constants!
    12951294   
    1296     int inlineCallFrameStart = m_inlineStackTop->remapOperand(VirtualRegister(registerOffset)).offset() + JSStack::CallFrameHeaderSize;
     1295    int inlineCallFrameStart = m_inlineStackTop->remapOperand(registerOffset) + JSStack::CallFrameHeaderSize;
    12971296   
    12981297    // Make sure that the area used by the call frame is reserved.
    1299     for (int arg = VirtualRegister(inlineCallFrameStart).toLocal() + JSStack::CallFrameHeaderSize + codeBlock->m_numVars; arg-- > VirtualRegister(inlineCallFrameStart).toLocal();)
     1298    for (int arg = operandToLocal(inlineCallFrameStart) + JSStack::CallFrameHeaderSize + codeBlock->m_numVars; arg-- > operandToLocal(inlineCallFrameStart);)
    13001299        m_preservedVars.set(arg);
    13011300   
    13021301    // Make sure that we have enough locals.
    1303     unsigned newNumLocals = VirtualRegister(inlineCallFrameStart).toLocal() + JSStack::CallFrameHeaderSize + codeBlock->m_numCalleeRegisters;
     1302    unsigned newNumLocals = operandToLocal(inlineCallFrameStart) + JSStack::CallFrameHeaderSize + codeBlock->m_numCalleeRegisters;
    13041303    if (newNumLocals > m_numLocals) {
    13051304        m_numLocals = newNumLocals;
     
    13121311    InlineStackEntry inlineStackEntry(
    13131312        this, codeBlock, codeBlock, m_graph.lastBlock(), callLinkStatus.function(),
    1314         m_inlineStackTop->remapOperand(VirtualRegister(resultOperand)),
     1313        (VirtualRegister)m_inlineStackTop->remapOperand(resultOperand),
    13151314        (VirtualRegister)inlineCallFrameStart, argumentCountIncludingThis, kind);
    13161315   
     
    14291428{
    14301429    if (argumentCountIncludingThis == 1) { // Math.min()
    1431         set(VirtualRegister(resultOperand), constantNaN());
     1430        set(resultOperand, constantNaN());
    14321431        return true;
    14331432    }
    14341433     
    14351434    if (argumentCountIncludingThis == 2) { // Math.min(x)
    1436         Node* result = get(VirtualRegister(virtualRegisterForArgument(1, registerOffset)));
     1435        Node* result = get(registerOffset + argumentToOperand(1));
    14371436        addToGraph(Phantom, Edge(result, NumberUse));
    1438         set(VirtualRegister(resultOperand), result);
     1437        set(resultOperand, result);
    14391438        return true;
    14401439    }
    14411440   
    14421441    if (argumentCountIncludingThis == 3) { // Math.min(x, y)
    1443         set(VirtualRegister(resultOperand), addToGraph(op, get(virtualRegisterForArgument(1, registerOffset)), get(virtualRegisterForArgument(2, registerOffset))));
     1442        set(resultOperand, addToGraph(op, get(registerOffset + argumentToOperand(1)), get(registerOffset + argumentToOperand(2))));
    14441443        return true;
    14451444    }
     
    14561455    case AbsIntrinsic: {
    14571456        if (argumentCountIncludingThis == 1) { // Math.abs()
    1458             set(VirtualRegister(resultOperand), constantNaN());
     1457            set(resultOperand, constantNaN());
    14591458            return true;
    14601459        }
     
    14631462            return false;
    14641463
    1465         Node* node = addToGraph(ArithAbs, get(virtualRegisterForArgument(1, registerOffset)));
     1464        Node* node = addToGraph(ArithAbs, get(registerOffset + argumentToOperand(1)));
    14661465        if (m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, Overflow))
    14671466            node->mergeFlags(NodeMayOverflow);
    1468         set(VirtualRegister(resultOperand), node);
     1467        set(resultOperand, node);
    14691468        return true;
    14701469    }
     
    14781477    case SqrtIntrinsic: {
    14791478        if (argumentCountIncludingThis == 1) { // Math.sqrt()
    1480             set(VirtualRegister(resultOperand), constantNaN());
     1479            set(resultOperand, constantNaN());
    14811480            return true;
    14821481        }
     
    14851484            return false;
    14861485
    1487         set(VirtualRegister(resultOperand), addToGraph(ArithSqrt, get(virtualRegisterForArgument(1, registerOffset))));
     1486        set(resultOperand, addToGraph(ArithSqrt, get(registerOffset + argumentToOperand(1))));
    14881487        return true;
    14891488    }
     
    15021501        case Array::Contiguous:
    15031502        case Array::ArrayStorage: {
    1504             Node* arrayPush = addToGraph(ArrayPush, OpInfo(arrayMode.asWord()), OpInfo(prediction), get(virtualRegisterForArgument(0, registerOffset)), get(virtualRegisterForArgument(1, registerOffset)));
    1505             set(VirtualRegister(resultOperand), arrayPush);
     1503            Node* arrayPush = addToGraph(ArrayPush, OpInfo(arrayMode.asWord()), OpInfo(prediction), get(registerOffset + argumentToOperand(0)), get(registerOffset + argumentToOperand(1)));
     1504            set(resultOperand, arrayPush);
    15061505           
    15071506            return true;
     
    15251524        case Array::Contiguous:
    15261525        case Array::ArrayStorage: {
    1527             Node* arrayPop = addToGraph(ArrayPop, OpInfo(arrayMode.asWord()), OpInfo(prediction), get(virtualRegisterForArgument(0, registerOffset)));
    1528             set(VirtualRegister(resultOperand), arrayPop);
     1526            Node* arrayPop = addToGraph(ArrayPop, OpInfo(arrayMode.asWord()), OpInfo(prediction), get(registerOffset + argumentToOperand(0)));
     1527            set(resultOperand, arrayPop);
    15291528            return true;
    15301529        }
     
    15391538            return false;
    15401539
    1541         int thisOperand = virtualRegisterForArgument(0, registerOffset).offset();
    1542         int indexOperand = virtualRegisterForArgument(1, registerOffset).offset();
    1543         Node* charCode = addToGraph(StringCharCodeAt, OpInfo(ArrayMode(Array::String).asWord()), get(VirtualRegister(thisOperand)), getToInt32(indexOperand));
    1544 
    1545         set(VirtualRegister(resultOperand), charCode);
     1540        int thisOperand = registerOffset + argumentToOperand(0);
     1541        int indexOperand = registerOffset + argumentToOperand(1);
     1542        Node* charCode = addToGraph(StringCharCodeAt, OpInfo(ArrayMode(Array::String).asWord()), get(thisOperand), getToInt32(indexOperand));
     1543
     1544        set(resultOperand, charCode);
    15461545        return true;
    15471546    }
     
    15511550            return false;
    15521551
    1553         int thisOperand = virtualRegisterForArgument(0, registerOffset).offset();
    1554         int indexOperand = virtualRegisterForArgument(1, registerOffset).offset();
    1555         Node* charCode = addToGraph(StringCharAt, OpInfo(ArrayMode(Array::String).asWord()), get(VirtualRegister(thisOperand)), getToInt32(indexOperand));
    1556 
    1557         set(VirtualRegister(resultOperand), charCode);
     1552        int thisOperand = registerOffset + argumentToOperand(0);
     1553        int indexOperand = registerOffset + argumentToOperand(1);
     1554        Node* charCode = addToGraph(StringCharAt, OpInfo(ArrayMode(Array::String).asWord()), get(thisOperand), getToInt32(indexOperand));
     1555
     1556        set(resultOperand, charCode);
    15581557        return true;
    15591558    }
     
    15621561            return false;
    15631562
    1564         int indexOperand = virtualRegisterForArgument(1, registerOffset).offset();
     1563        int indexOperand = registerOffset + argumentToOperand(1);
    15651564        Node* charCode = addToGraph(StringFromCharCode, getToInt32(indexOperand));
    15661565
    1567         set(VirtualRegister(resultOperand), charCode);
     1566        set(resultOperand, charCode);
    15681567
    15691568        return true;
     
    15741573            return false;
    15751574       
    1576         Node* regExpExec = addToGraph(RegExpExec, OpInfo(0), OpInfo(prediction), get(virtualRegisterForArgument(0, registerOffset)), get(virtualRegisterForArgument(1, registerOffset)));
    1577         set(VirtualRegister(resultOperand), regExpExec);
     1575        Node* regExpExec = addToGraph(RegExpExec, OpInfo(0), OpInfo(prediction), get(registerOffset + argumentToOperand(0)), get(registerOffset + argumentToOperand(1)));
     1576        set(resultOperand, regExpExec);
    15781577       
    15791578        return true;
     
    15841583            return false;
    15851584       
    1586         Node* regExpExec = addToGraph(RegExpTest, OpInfo(0), OpInfo(prediction), get(virtualRegisterForArgument(0, registerOffset)), get(virtualRegisterForArgument(1, registerOffset)));
    1587         set(VirtualRegister(resultOperand), regExpExec);
     1585        Node* regExpExec = addToGraph(RegExpTest, OpInfo(0), OpInfo(prediction), get(registerOffset + argumentToOperand(0)), get(registerOffset + argumentToOperand(1)));
     1586        set(resultOperand, regExpExec);
    15881587       
    15891588        return true;
     
    15931592        if (argumentCountIncludingThis != 3)
    15941593            return false;
    1595         int leftOperand = virtualRegisterForArgument(1, registerOffset).offset();
    1596         int rightOperand = virtualRegisterForArgument(2, registerOffset).offset();
     1594        int leftOperand = registerOffset + argumentToOperand(1);
     1595        int rightOperand = registerOffset + argumentToOperand(2);
    15971596        Node* left = getToInt32(leftOperand);
    15981597        Node* right = getToInt32(rightOperand);
    1599         set(VirtualRegister(resultOperand), addToGraph(ArithIMul, left, right));
     1598        set(resultOperand, addToGraph(ArithIMul, left, right));
    16001599        return true;
    16011600    }
     
    16531652        return false;
    16541653   
    1655     set(VirtualRegister(resultOperand),
    1656         addToGraph(NewTypedArray, OpInfo(type), get(virtualRegisterForArgument(1, registerOffset))));
     1654    set(resultOperand,
     1655        addToGraph(NewTypedArray, OpInfo(type), get(registerOffset + argumentToOperand(1))));
    16571656    return true;
    16581657}
     
    16761675       
    16771676        if (argumentCountIncludingThis == 2) {
    1678             set(VirtualRegister(resultOperand),
    1679                 addToGraph(NewArrayWithSize, OpInfo(ArrayWithUndecided), get(virtualRegisterForArgument(1, registerOffset))));
     1677            set(resultOperand,
     1678                addToGraph(NewArrayWithSize, OpInfo(ArrayWithUndecided), get(registerOffset + argumentToOperand(1))));
    16801679            return true;
    16811680        }
    16821681       
    16831682        for (int i = 1; i < argumentCountIncludingThis; ++i)
    1684             addVarArgChild(get(virtualRegisterForArgument(i, registerOffset)));
    1685         set(VirtualRegister(resultOperand),
     1683            addVarArgChild(get(registerOffset + argumentToOperand(i)));
     1684        set(resultOperand,
    16861685            addToGraph(Node::VarArg, NewArray, OpInfo(ArrayWithUndecided), OpInfo(0)));
    16871686        return true;
     
    16941693            result = cellConstant(m_vm->smallStrings.emptyString());
    16951694        else
    1696             result = addToGraph(ToString, get(virtualRegisterForArgument(1, registerOffset)));
     1695            result = addToGraph(ToString, get(registerOffset + argumentToOperand(1)));
    16971696       
    16981697        if (kind == CodeForConstruct)
    16991698            result = addToGraph(NewStringObject, OpInfo(function->globalObject()->stringObjectStructure()), result);
    17001699       
    1701         set(VirtualRegister(resultOperand), result);
     1700        set(resultOperand, result);
    17021701        return true;
    17031702    }
     
    17351734    PropertyOffset offset)
    17361735{
    1737     set(VirtualRegister(destinationOperand), handleGetByOffset(prediction, base, identifierNumber, offset));
     1736    set(destinationOperand, handleGetByOffset(prediction, base, identifierNumber, offset));
    17381737}
    17391738
     
    17621761        || m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache)
    17631762        || m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadWeakConstantCache)) {
    1764         set(VirtualRegister(destinationOperand),
     1763        set(destinationOperand,
    17651764            addToGraph(
    17661765                getByIdStatus.makesCalls() ? GetByIdFlush : GetById,
     
    18051804        ASSERT(getByIdStatus.specificValue().isCell());
    18061805       
    1807         set(VirtualRegister(destinationOperand), cellConstant(getByIdStatus.specificValue().asCell()));
     1806        set(destinationOperand, cellConstant(getByIdStatus.specificValue().asCell()));
    18081807        return;
    18091808    }
     
    18521851        for (unsigned argument = 0; argument < m_numArguments; ++argument) {
    18531852            VariableAccessData* variable = newVariableAccessData(
    1854                 virtualRegisterForArgument(argument), m_codeBlock->isCaptured(virtualRegisterForArgument(argument)));
     1853                argumentToOperand(argument), m_codeBlock->isCaptured(argumentToOperand(argument)));
    18551854            variable->mergeStructureCheckHoistingFailed(
    18561855                m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache));
     
    19011900            // Initialize all locals to undefined.
    19021901            for (int i = 0; i < m_inlineStackTop->m_codeBlock->m_numVars; ++i)
    1903                 set(virtualRegisterForLocal(i), constantUndefined(), SetOnEntry);
     1902                set(localToOperand(i), constantUndefined(), SetOnEntry);
    19041903            NEXT_OPCODE(op_enter);
    19051904
     
    19251924        case op_create_this: {
    19261925            int calleeOperand = currentInstruction[2].u.operand;
    1927             Node* callee = get(VirtualRegister(calleeOperand));
     1926            Node* callee = get(calleeOperand);
    19281927            bool alreadyEmitted = false;
    19291928            if (callee->op() == WeakJSConstant) {
     
    19371936                    // The callee is still live up to this point.
    19381937                    addToGraph(Phantom, callee);
    1939                     set(VirtualRegister(currentInstruction[1].u.operand),
     1938                    set(currentInstruction[1].u.operand,
    19401939                        addToGraph(NewObject, OpInfo(allocationProfile->structure())));
    19411940                    alreadyEmitted = true;
     
    19431942            }
    19441943            if (!alreadyEmitted)
    1945                 set(VirtualRegister(currentInstruction[1].u.operand),
     1944                set(currentInstruction[1].u.operand,
    19461945                    addToGraph(CreateThis, OpInfo(currentInstruction[3].u.operand), callee));
    19471946            NEXT_OPCODE(op_create_this);
     
    19491948
    19501949        case op_new_object: {
    1951             set(VirtualRegister(currentInstruction[1].u.operand),
     1950            set(currentInstruction[1].u.operand,
    19521951                addToGraph(NewObject,
    19531952                    OpInfo(currentInstruction[3].u.objectAllocationProfile->structure())));
     
    19601959            ArrayAllocationProfile* profile = currentInstruction[4].u.arrayAllocationProfile;
    19611960            for (int operandIdx = startOperand; operandIdx > startOperand - numOperands; --operandIdx)
    1962                 addVarArgChild(get(VirtualRegister(operandIdx)));
    1963             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(Node::VarArg, NewArray, OpInfo(profile->selectIndexingType()), OpInfo(0)));
     1961                addVarArgChild(get(operandIdx));
     1962            set(currentInstruction[1].u.operand, addToGraph(Node::VarArg, NewArray, OpInfo(profile->selectIndexingType()), OpInfo(0)));
    19641963            NEXT_OPCODE(op_new_array);
    19651964        }
     
    19681967            int lengthOperand = currentInstruction[2].u.operand;
    19691968            ArrayAllocationProfile* profile = currentInstruction[3].u.arrayAllocationProfile;
    1970             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(NewArrayWithSize, OpInfo(profile->selectIndexingType()), get(VirtualRegister(lengthOperand))));
     1969            set(currentInstruction[1].u.operand, addToGraph(NewArrayWithSize, OpInfo(profile->selectIndexingType()), get(lengthOperand)));
    19711970            NEXT_OPCODE(op_new_array_with_size);
    19721971        }
     
    19901989           
    19911990            m_graph.m_newArrayBufferData.append(data);
    1992             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(NewArrayBuffer, OpInfo(&m_graph.m_newArrayBufferData.last())));
     1991            set(currentInstruction[1].u.operand, addToGraph(NewArrayBuffer, OpInfo(&m_graph.m_newArrayBufferData.last())));
    19931992            NEXT_OPCODE(op_new_array_buffer);
    19941993        }
    19951994           
    19961995        case op_new_regexp: {
    1997             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(NewRegexp, OpInfo(currentInstruction[2].u.operand)));
     1996            set(currentInstruction[1].u.operand, addToGraph(NewRegexp, OpInfo(currentInstruction[2].u.operand)));
    19981997            NEXT_OPCODE(op_new_regexp);
    19991998        }
     
    20042003                || m_inlineStackTop->m_profiledBlock->couldTakeSlowCase(m_currentIndex)
    20052004                || m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadFunction)) {
    2006                 set(VirtualRegister(currentInstruction[1].u.operand), get(VirtualRegister(JSStack::Callee)));
     2005                set(currentInstruction[1].u.operand, get(JSStack::Callee));
    20072006            } else {
    20082007                ASSERT(cachedFunction->inherits(JSFunction::info()));
    2009                 Node* actualCallee = get(VirtualRegister(JSStack::Callee));
     2008                Node* actualCallee = get(JSStack::Callee);
    20102009                addToGraph(CheckFunction, OpInfo(cachedFunction), actualCallee);
    2011                 set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(WeakJSConstant, OpInfo(cachedFunction)));
     2010                set(currentInstruction[1].u.operand, addToGraph(WeakJSConstant, OpInfo(cachedFunction)));
    20122011            }
    20132012            NEXT_OPCODE(op_get_callee);
     
    20192018            Node* op1 = getToInt32(currentInstruction[2].u.operand);
    20202019            Node* op2 = getToInt32(currentInstruction[3].u.operand);
    2021             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(BitAnd, op1, op2));
     2020            set(currentInstruction[1].u.operand, addToGraph(BitAnd, op1, op2));
    20222021            NEXT_OPCODE(op_bitand);
    20232022        }
     
    20262025            Node* op1 = getToInt32(currentInstruction[2].u.operand);
    20272026            Node* op2 = getToInt32(currentInstruction[3].u.operand);
    2028             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(BitOr, op1, op2));
     2027            set(currentInstruction[1].u.operand, addToGraph(BitOr, op1, op2));
    20292028            NEXT_OPCODE(op_bitor);
    20302029        }
     
    20332032            Node* op1 = getToInt32(currentInstruction[2].u.operand);
    20342033            Node* op2 = getToInt32(currentInstruction[3].u.operand);
    2035             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(BitXor, op1, op2));
     2034            set(currentInstruction[1].u.operand, addToGraph(BitXor, op1, op2));
    20362035            NEXT_OPCODE(op_bitxor);
    20372036        }
     
    20462045            else
    20472046                result = addToGraph(BitRShift, op1, op2);
    2048             set(VirtualRegister(currentInstruction[1].u.operand), result);
     2047            set(currentInstruction[1].u.operand, result);
    20492048            NEXT_OPCODE(op_rshift);
    20502049        }
     
    20592058            else
    20602059                result = addToGraph(BitLShift, op1, op2);
    2061             set(VirtualRegister(currentInstruction[1].u.operand), result);
     2060            set(currentInstruction[1].u.operand, result);
    20622061            NEXT_OPCODE(op_lshift);
    20632062        }
     
    20862085                result = makeSafe(addToGraph(UInt32ToNumber, result));
    20872086            }
    2088             set(VirtualRegister(currentInstruction[1].u.operand), result);
     2087            set(currentInstruction[1].u.operand, result);
    20892088            NEXT_OPCODE(op_urshift);
    20902089        }
     
    20942093        case op_inc: {
    20952094            int srcDst = currentInstruction[1].u.operand;
    2096             VirtualRegister srcDstVirtualRegister = VirtualRegister(srcDst);
    2097             Node* op = get(srcDstVirtualRegister);
    2098             set(srcDstVirtualRegister, makeSafe(addToGraph(ArithAdd, op, one())));
     2095            Node* op = get(srcDst);
     2096            set(srcDst, makeSafe(addToGraph(ArithAdd, op, one())));
    20992097            NEXT_OPCODE(op_inc);
    21002098        }
     
    21022100        case op_dec: {
    21032101            int srcDst = currentInstruction[1].u.operand;
    2104             VirtualRegister srcDstVirtualRegister = VirtualRegister(srcDst);
    2105             Node* op = get(srcDstVirtualRegister);
    2106             set(srcDstVirtualRegister, makeSafe(addToGraph(ArithSub, op, one())));
     2102            Node* op = get(srcDst);
     2103            set(srcDst, makeSafe(addToGraph(ArithSub, op, one())));
    21072104            NEXT_OPCODE(op_dec);
    21082105        }
     
    21112108
    21122109        case op_add: {
    2113             Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand));
    2114             Node* op2 = get(VirtualRegister(currentInstruction[3].u.operand));
     2110            Node* op1 = get(currentInstruction[2].u.operand);
     2111            Node* op2 = get(currentInstruction[3].u.operand);
    21152112            if (op1->hasNumberResult() && op2->hasNumberResult())
    2116                 set(VirtualRegister(currentInstruction[1].u.operand), makeSafe(addToGraph(ArithAdd, op1, op2)));
     2113                set(currentInstruction[1].u.operand, makeSafe(addToGraph(ArithAdd, op1, op2)));
    21172114            else
    2118                 set(VirtualRegister(currentInstruction[1].u.operand), makeSafe(addToGraph(ValueAdd, op1, op2)));
     2115                set(currentInstruction[1].u.operand, makeSafe(addToGraph(ValueAdd, op1, op2)));
    21192116            NEXT_OPCODE(op_add);
    21202117        }
    21212118
    21222119        case op_sub: {
    2123             Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand));
    2124             Node* op2 = get(VirtualRegister(currentInstruction[3].u.operand));
    2125             set(VirtualRegister(currentInstruction[1].u.operand), makeSafe(addToGraph(ArithSub, op1, op2)));
     2120            Node* op1 = get(currentInstruction[2].u.operand);
     2121            Node* op2 = get(currentInstruction[3].u.operand);
     2122            set(currentInstruction[1].u.operand, makeSafe(addToGraph(ArithSub, op1, op2)));
    21262123            NEXT_OPCODE(op_sub);
    21272124        }
    21282125
    21292126        case op_negate: {
    2130             Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand));
    2131             set(VirtualRegister(currentInstruction[1].u.operand), makeSafe(addToGraph(ArithNegate, op1)));
     2127            Node* op1 = get(currentInstruction[2].u.operand);
     2128            set(currentInstruction[1].u.operand, makeSafe(addToGraph(ArithNegate, op1)));
    21322129            NEXT_OPCODE(op_negate);
    21332130        }
     
    21352132        case op_mul: {
    21362133            // Multiply requires that the inputs are not truncated, unfortunately.
    2137             Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand));
    2138             Node* op2 = get(VirtualRegister(currentInstruction[3].u.operand));
    2139             set(VirtualRegister(currentInstruction[1].u.operand), makeSafe(addToGraph(ArithMul, op1, op2)));
     2134            Node* op1 = get(currentInstruction[2].u.operand);
     2135            Node* op2 = get(currentInstruction[3].u.operand);
     2136            set(currentInstruction[1].u.operand, makeSafe(addToGraph(ArithMul, op1, op2)));
    21402137            NEXT_OPCODE(op_mul);
    21412138        }
    21422139
    21432140        case op_mod: {
    2144             Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand));
    2145             Node* op2 = get(VirtualRegister(currentInstruction[3].u.operand));
    2146             set(VirtualRegister(currentInstruction[1].u.operand), makeSafe(addToGraph(ArithMod, op1, op2)));
     2141            Node* op1 = get(currentInstruction[2].u.operand);
     2142            Node* op2 = get(currentInstruction[3].u.operand);
     2143            set(currentInstruction[1].u.operand, makeSafe(addToGraph(ArithMod, op1, op2)));
    21472144            NEXT_OPCODE(op_mod);
    21482145        }
    21492146
    21502147        case op_div: {
    2151             Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand));
    2152             Node* op2 = get(VirtualRegister(currentInstruction[3].u.operand));
    2153             set(VirtualRegister(currentInstruction[1].u.operand), makeDivSafe(addToGraph(ArithDiv, op1, op2)));
     2148            Node* op1 = get(currentInstruction[2].u.operand);
     2149            Node* op2 = get(currentInstruction[3].u.operand);
     2150            set(currentInstruction[1].u.operand, makeDivSafe(addToGraph(ArithDiv, op1, op2)));
    21542151            NEXT_OPCODE(op_div);
    21552152        }
     
    21632160#endif
    21642161        case op_mov: {
    2165             Node* op = get(VirtualRegister(currentInstruction[2].u.operand));
    2166             set(VirtualRegister(currentInstruction[1].u.operand), op);
     2162            Node* op = get(currentInstruction[2].u.operand);
     2163            set(currentInstruction[1].u.operand, op);
    21672164            NEXT_OPCODE(op_mov);
    21682165        }
    21692166
    21702167        case op_check_has_instance:
    2171             addToGraph(CheckHasInstance, get(VirtualRegister(currentInstruction[3].u.operand)));
     2168            addToGraph(CheckHasInstance, get(currentInstruction[3].u.operand));
    21722169            NEXT_OPCODE(op_check_has_instance);
    21732170
    21742171        case op_instanceof: {
    2175             Node* value = get(VirtualRegister(currentInstruction[2].u.operand));
    2176             Node* prototype = get(VirtualRegister(currentInstruction[3].u.operand));
    2177             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(InstanceOf, value, prototype));
     2172            Node* value = get(currentInstruction[2].u.operand);
     2173            Node* prototype = get(currentInstruction[3].u.operand);
     2174            set(currentInstruction[1].u.operand, addToGraph(InstanceOf, value, prototype));
    21782175            NEXT_OPCODE(op_instanceof);
    21792176        }
    21802177           
    21812178        case op_is_undefined: {
    2182             Node* value = get(VirtualRegister(currentInstruction[2].u.operand));
    2183             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(IsUndefined, value));
     2179            Node* value = get(currentInstruction[2].u.operand);
     2180            set(currentInstruction[1].u.operand, addToGraph(IsUndefined, value));
    21842181            NEXT_OPCODE(op_is_undefined);
    21852182        }
    21862183
    21872184        case op_is_boolean: {
    2188             Node* value = get(VirtualRegister(currentInstruction[2].u.operand));
    2189             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(IsBoolean, value));
     2185            Node* value = get(currentInstruction[2].u.operand);
     2186            set(currentInstruction[1].u.operand, addToGraph(IsBoolean, value));
    21902187            NEXT_OPCODE(op_is_boolean);
    21912188        }
    21922189
    21932190        case op_is_number: {
    2194             Node* value = get(VirtualRegister(currentInstruction[2].u.operand));
    2195             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(IsNumber, value));
     2191            Node* value = get(currentInstruction[2].u.operand);
     2192            set(currentInstruction[1].u.operand, addToGraph(IsNumber, value));
    21962193            NEXT_OPCODE(op_is_number);
    21972194        }
    21982195
    21992196        case op_is_string: {
    2200             Node* value = get(VirtualRegister(currentInstruction[2].u.operand));
    2201             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(IsString, value));
     2197            Node* value = get(currentInstruction[2].u.operand);
     2198            set(currentInstruction[1].u.operand, addToGraph(IsString, value));
    22022199            NEXT_OPCODE(op_is_string);
    22032200        }
    22042201
    22052202        case op_is_object: {
    2206             Node* value = get(VirtualRegister(currentInstruction[2].u.operand));
    2207             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(IsObject, value));
     2203            Node* value = get(currentInstruction[2].u.operand);
     2204            set(currentInstruction[1].u.operand, addToGraph(IsObject, value));
    22082205            NEXT_OPCODE(op_is_object);
    22092206        }
    22102207
    22112208        case op_is_function: {
    2212             Node* value = get(VirtualRegister(currentInstruction[2].u.operand));
    2213             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(IsFunction, value));
     2209            Node* value = get(currentInstruction[2].u.operand);
     2210            set(currentInstruction[1].u.operand, addToGraph(IsFunction, value));
    22142211            NEXT_OPCODE(op_is_function);
    22152212        }
    22162213
    22172214        case op_not: {
    2218             Node* value = get(VirtualRegister(currentInstruction[2].u.operand));
    2219             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(LogicalNot, value));
     2215            Node* value = get(currentInstruction[2].u.operand);
     2216            set(currentInstruction[1].u.operand, addToGraph(LogicalNot, value));
    22202217            NEXT_OPCODE(op_not);
    22212218        }
    22222219           
    22232220        case op_to_primitive: {
    2224             Node* value = get(VirtualRegister(currentInstruction[2].u.operand));
    2225             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(ToPrimitive, value));
     2221            Node* value = get(currentInstruction[2].u.operand);
     2222            set(currentInstruction[1].u.operand, addToGraph(ToPrimitive, value));
    22262223            NEXT_OPCODE(op_to_primitive);
    22272224        }
     
    22392236            auto toStringNodes = std::make_unique<Node*[]>(numOperands);
    22402237            for (int i = 0; i < numOperands; i++)
    2241                 toStringNodes[i] = addToGraph(ToString, get(VirtualRegister(startOperand - i)));
     2238                toStringNodes[i] = addToGraph(ToString, get(startOperand - i));
    22422239
    22432240            for (int i = 0; i < numOperands; i++)
     
    22602257                operands[indexInOperands++] = toStringNodes[operandIdx];
    22612258            }
    2262             set(VirtualRegister(currentInstruction[1].u.operand),
     2259            set(currentInstruction[1].u.operand,
    22632260                addToGraph(MakeRope, operands[0], operands[1], operands[2]));
    22642261            NEXT_OPCODE(op_strcat);
     
    22662263
    22672264        case op_less: {
    2268             Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand));
    2269             Node* op2 = get(VirtualRegister(currentInstruction[3].u.operand));
     2265            Node* op1 = get(currentInstruction[2].u.operand);
     2266            Node* op2 = get(currentInstruction[3].u.operand);
    22702267            if (canFold(op1) && canFold(op2)) {
    22712268                JSValue a = valueOfJSConstant(op1);
    22722269                JSValue b = valueOfJSConstant(op2);
    22732270                if (a.isNumber() && b.isNumber()) {
    2274                     set(VirtualRegister(currentInstruction[1].u.operand),
     2271                    set(currentInstruction[1].u.operand,
    22752272                        getJSConstantForValue(jsBoolean(a.asNumber() < b.asNumber())));
    22762273                    NEXT_OPCODE(op_less);
    22772274                }
    22782275            }
    2279             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(CompareLess, op1, op2));
     2276            set(currentInstruction[1].u.operand, addToGraph(CompareLess, op1, op2));
    22802277            NEXT_OPCODE(op_less);
    22812278        }
    22822279
    22832280        case op_lesseq: {
    2284             Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand));
    2285             Node* op2 = get(VirtualRegister(currentInstruction[3].u.operand));
     2281            Node* op1 = get(currentInstruction[2].u.operand);
     2282            Node* op2 = get(currentInstruction[3].u.operand);
    22862283            if (canFold(op1) && canFold(op2)) {
    22872284                JSValue a = valueOfJSConstant(op1);
    22882285                JSValue b = valueOfJSConstant(op2);
    22892286                if (a.isNumber() && b.isNumber()) {
    2290                     set(VirtualRegister(currentInstruction[1].u.operand),
     2287                    set(currentInstruction[1].u.operand,
    22912288                        getJSConstantForValue(jsBoolean(a.asNumber() <= b.asNumber())));
    22922289                    NEXT_OPCODE(op_lesseq);
    22932290                }
    22942291            }
    2295             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(CompareLessEq, op1, op2));
     2292            set(currentInstruction[1].u.operand, addToGraph(CompareLessEq, op1, op2));
    22962293            NEXT_OPCODE(op_lesseq);
    22972294        }
    22982295
    22992296        case op_greater: {
    2300             Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand));
    2301             Node* op2 = get(VirtualRegister(currentInstruction[3].u.operand));
     2297            Node* op1 = get(currentInstruction[2].u.operand);
     2298            Node* op2 = get(currentInstruction[3].u.operand);
    23022299            if (canFold(op1) && canFold(op2)) {
    23032300                JSValue a = valueOfJSConstant(op1);
    23042301                JSValue b = valueOfJSConstant(op2);
    23052302                if (a.isNumber() && b.isNumber()) {
    2306                     set(VirtualRegister(currentInstruction[1].u.operand),
     2303                    set(currentInstruction[1].u.operand,
    23072304                        getJSConstantForValue(jsBoolean(a.asNumber() > b.asNumber())));
    23082305                    NEXT_OPCODE(op_greater);
    23092306                }
    23102307            }
    2311             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(CompareGreater, op1, op2));
     2308            set(currentInstruction[1].u.operand, addToGraph(CompareGreater, op1, op2));
    23122309            NEXT_OPCODE(op_greater);
    23132310        }
    23142311
    23152312        case op_greatereq: {
    2316             Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand));
    2317             Node* op2 = get(VirtualRegister(currentInstruction[3].u.operand));
     2313            Node* op1 = get(currentInstruction[2].u.operand);
     2314            Node* op2 = get(currentInstruction[3].u.operand);
    23182315            if (canFold(op1) && canFold(op2)) {
    23192316                JSValue a = valueOfJSConstant(op1);
    23202317                JSValue b = valueOfJSConstant(op2);
    23212318                if (a.isNumber() && b.isNumber()) {
    2322                     set(VirtualRegister(currentInstruction[1].u.operand),
     2319                    set(currentInstruction[1].u.operand,
    23232320                        getJSConstantForValue(jsBoolean(a.asNumber() >= b.asNumber())));
    23242321                    NEXT_OPCODE(op_greatereq);
    23252322                }
    23262323            }
    2327             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(CompareGreaterEq, op1, op2));
     2324            set(currentInstruction[1].u.operand, addToGraph(CompareGreaterEq, op1, op2));
    23282325            NEXT_OPCODE(op_greatereq);
    23292326        }
    23302327
    23312328        case op_eq: {
    2332             Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand));
    2333             Node* op2 = get(VirtualRegister(currentInstruction[3].u.operand));
     2329            Node* op1 = get(currentInstruction[2].u.operand);
     2330            Node* op2 = get(currentInstruction[3].u.operand);
    23342331            if (canFold(op1) && canFold(op2)) {
    23352332                JSValue a = valueOfJSConstant(op1);
    23362333                JSValue b = valueOfJSConstant(op2);
    2337                 set(VirtualRegister(currentInstruction[1].u.operand),
     2334                set(currentInstruction[1].u.operand,
    23382335                    getJSConstantForValue(jsBoolean(JSValue::equal(m_codeBlock->globalObject()->globalExec(), a, b))));
    23392336                NEXT_OPCODE(op_eq);
    23402337            }
    2341             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(CompareEq, op1, op2));
     2338            set(currentInstruction[1].u.operand, addToGraph(CompareEq, op1, op2));
    23422339            NEXT_OPCODE(op_eq);
    23432340        }
    23442341
    23452342        case op_eq_null: {
    2346             Node* value = get(VirtualRegister(currentInstruction[2].u.operand));
    2347             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(CompareEqConstant, value, constantNull()));
     2343            Node* value = get(currentInstruction[2].u.operand);
     2344            set(currentInstruction[1].u.operand, addToGraph(CompareEqConstant, value, constantNull()));
    23482345            NEXT_OPCODE(op_eq_null);
    23492346        }
    23502347
    23512348        case op_stricteq: {
    2352             Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand));
    2353             Node* op2 = get(VirtualRegister(currentInstruction[3].u.operand));
     2349            Node* op1 = get(currentInstruction[2].u.operand);
     2350            Node* op2 = get(currentInstruction[3].u.operand);
    23542351            if (canFold(op1) && canFold(op2)) {
    23552352                JSValue a = valueOfJSConstant(op1);
    23562353                JSValue b = valueOfJSConstant(op2);
    2357                 set(VirtualRegister(currentInstruction[1].u.operand),
     2354                set(currentInstruction[1].u.operand,
    23582355                    getJSConstantForValue(jsBoolean(JSValue::strictEqual(m_codeBlock->globalObject()->globalExec(), a, b))));
    23592356                NEXT_OPCODE(op_stricteq);
    23602357            }
    23612358            if (isConstantForCompareStrictEq(op1))
    2362                 set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(CompareStrictEqConstant, op2, op1));
     2359                set(currentInstruction[1].u.operand, addToGraph(CompareStrictEqConstant, op2, op1));
    23632360            else if (isConstantForCompareStrictEq(op2))
    2364                 set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(CompareStrictEqConstant, op1, op2));
     2361                set(currentInstruction[1].u.operand, addToGraph(CompareStrictEqConstant, op1, op2));
    23652362            else
    2366                 set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(CompareStrictEq, op1, op2));
     2363                set(currentInstruction[1].u.operand, addToGraph(CompareStrictEq, op1, op2));
    23672364            NEXT_OPCODE(op_stricteq);
    23682365        }
    23692366
    23702367        case op_neq: {
    2371             Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand));
    2372             Node* op2 = get(VirtualRegister(currentInstruction[3].u.operand));
     2368            Node* op1 = get(currentInstruction[2].u.operand);
     2369            Node* op2 = get(currentInstruction[3].u.operand);
    23732370            if (canFold(op1) && canFold(op2)) {
    23742371                JSValue a = valueOfJSConstant(op1);
    23752372                JSValue b = valueOfJSConstant(op2);
    2376                 set(VirtualRegister(currentInstruction[1].u.operand),
     2373                set(currentInstruction[1].u.operand,
    23772374                    getJSConstantForValue(jsBoolean(!JSValue::equal(m_codeBlock->globalObject()->globalExec(), a, b))));
    23782375                NEXT_OPCODE(op_neq);
    23792376            }
    2380             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(LogicalNot, addToGraph(CompareEq, op1, op2)));
     2377            set(currentInstruction[1].u.operand, addToGraph(LogicalNot, addToGraph(CompareEq, op1, op2)));
    23812378            NEXT_OPCODE(op_neq);
    23822379        }
    23832380
    23842381        case op_neq_null: {
    2385             Node* value = get(VirtualRegister(currentInstruction[2].u.operand));
    2386             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(LogicalNot, addToGraph(CompareEqConstant, value, constantNull())));
     2382            Node* value = get(currentInstruction[2].u.operand);
     2383            set(currentInstruction[1].u.operand, addToGraph(LogicalNot, addToGraph(CompareEqConstant, value, constantNull())));
    23872384            NEXT_OPCODE(op_neq_null);
    23882385        }
    23892386
    23902387        case op_nstricteq: {
    2391             Node* op1 = get(VirtualRegister(currentInstruction[2].u.operand));
    2392             Node* op2 = get(VirtualRegister(currentInstruction[3].u.operand));
     2388            Node* op1 = get(currentInstruction[2].u.operand);
     2389            Node* op2 = get(currentInstruction[3].u.operand);
    23932390            if (canFold(op1) && canFold(op2)) {
    23942391                JSValue a = valueOfJSConstant(op1);
    23952392                JSValue b = valueOfJSConstant(op2);
    2396                 set(VirtualRegister(currentInstruction[1].u.operand),
     2393                set(currentInstruction[1].u.operand,
    23972394                    getJSConstantForValue(jsBoolean(!JSValue::strictEqual(m_codeBlock->globalObject()->globalExec(), a, b))));
    23982395                NEXT_OPCODE(op_nstricteq);
     
    24052402            else
    24062403                invertedResult = addToGraph(CompareStrictEq, op1, op2);
    2407             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(LogicalNot, invertedResult));
     2404            set(currentInstruction[1].u.operand, addToGraph(LogicalNot, invertedResult));
    24082405            NEXT_OPCODE(op_nstricteq);
    24092406        }
     
    24142411            SpeculatedType prediction = getPrediction();
    24152412           
    2416             Node* base = get(VirtualRegister(currentInstruction[2].u.operand));
     2413            Node* base = get(currentInstruction[2].u.operand);
    24172414            ArrayMode arrayMode = getArrayModeConsideringSlowPath(currentInstruction[4].u.arrayProfile, Array::Read);
    2418             Node* property = get(VirtualRegister(currentInstruction[3].u.operand));
     2415            Node* property = get(currentInstruction[3].u.operand);
    24192416            Node* getByVal = addToGraph(GetByVal, OpInfo(arrayMode.asWord()), OpInfo(prediction), base, property);
    2420             set(VirtualRegister(currentInstruction[1].u.operand), getByVal);
     2417            set(currentInstruction[1].u.operand, getByVal);
    24212418
    24222419            NEXT_OPCODE(op_get_by_val);
     
    24242421
    24252422        case op_put_by_val: {
    2426             Node* base = get(VirtualRegister(currentInstruction[1].u.operand));
     2423            Node* base = get(currentInstruction[1].u.operand);
    24272424
    24282425            ArrayMode arrayMode = getArrayModeConsideringSlowPath(currentInstruction[4].u.arrayProfile, Array::Write);
    24292426           
    2430             Node* property = get(VirtualRegister(currentInstruction[2].u.operand));
    2431             Node* value = get(VirtualRegister(currentInstruction[3].u.operand));
     2427            Node* property = get(currentInstruction[2].u.operand);
     2428            Node* value = get(currentInstruction[3].u.operand);
    24322429           
    24332430            addVarArgChild(base);
     
    24452442            SpeculatedType prediction = getPrediction();
    24462443           
    2447             Node* base = get(VirtualRegister(currentInstruction[2].u.operand));
     2444            Node* base = get(currentInstruction[2].u.operand);
    24482445            unsigned identifierNumber = m_inlineStackTop->m_identifierRemap[currentInstruction[3].u.operand];
    24492446           
     
    24632460        case op_put_by_id_transition_direct_out_of_line:
    24642461        case op_put_by_id_transition_normal_out_of_line: {
    2465             Node* value = get(VirtualRegister(currentInstruction[3].u.operand));
    2466             Node* base = get(VirtualRegister(currentInstruction[1].u.operand));
     2462            Node* value = get(currentInstruction[3].u.operand);
     2463            Node* base = get(currentInstruction[1].u.operand);
    24672464            unsigned identifierNumber = m_inlineStackTop->m_identifierRemap[currentInstruction[2].u.operand];
    24682465            bool direct = currentInstruction[8].u.operand;
     
    25702567
    25712568        case op_init_global_const: {
    2572             Node* value = get(VirtualRegister(currentInstruction[2].u.operand));
     2569            Node* value = get(currentInstruction[2].u.operand);
    25732570            addToGraph(
    25742571                PutGlobalVar,
     
    25882585        case op_jtrue: {
    25892586            unsigned relativeOffset = currentInstruction[2].u.operand;
    2590             Node* condition = get(VirtualRegister(currentInstruction[1].u.operand));
     2587            Node* condition = get(currentInstruction[1].u.operand);
    25912588            if (canFold(condition)) {
    25922589                TriState state = valueOfJSConstant(condition).pureToBoolean();
     
    26072604        case op_jfalse: {
    26082605            unsigned relativeOffset = currentInstruction[2].u.operand;
    2609             Node* condition = get(VirtualRegister(currentInstruction[1].u.operand));
     2606            Node* condition = get(currentInstruction[1].u.operand);
    26102607            if (canFold(condition)) {
    26112608                TriState state = valueOfJSConstant(condition).pureToBoolean();
     
    26262623        case op_jeq_null: {
    26272624            unsigned relativeOffset = currentInstruction[2].u.operand;
    2628             Node* value = get(VirtualRegister(currentInstruction[1].u.operand));
     2625            Node* value = get(currentInstruction[1].u.operand);
    26292626            Node* condition = addToGraph(CompareEqConstant, value, constantNull());
    26302627            addToGraph(Branch, OpInfo(m_currentIndex + relativeOffset), OpInfo(m_currentIndex + OPCODE_LENGTH(op_jeq_null)), condition);
     
    26342631        case op_jneq_null: {
    26352632            unsigned relativeOffset = currentInstruction[2].u.operand;
    2636             Node* value = get(VirtualRegister(currentInstruction[1].u.operand));
     2633            Node* value = get(currentInstruction[1].u.operand);
    26372634            Node* condition = addToGraph(CompareEqConstant, value, constantNull());
    26382635            addToGraph(Branch, OpInfo(m_currentIndex + OPCODE_LENGTH(op_jneq_null)), OpInfo(m_currentIndex + relativeOffset), condition);
     
    26422639        case op_jless: {
    26432640            unsigned relativeOffset = currentInstruction[3].u.operand;
    2644             Node* op1 = get(VirtualRegister(currentInstruction[1].u.operand));
    2645             Node* op2 = get(VirtualRegister(currentInstruction[2].u.operand));
     2641            Node* op1 = get(currentInstruction[1].u.operand);
     2642            Node* op2 = get(currentInstruction[2].u.operand);
    26462643            if (canFold(op1) && canFold(op2)) {
    26472644                JSValue aValue = valueOfJSConstant(op1);
     
    26682665        case op_jlesseq: {
    26692666            unsigned relativeOffset = currentInstruction[3].u.operand;
    2670             Node* op1 = get(VirtualRegister(currentInstruction[1].u.operand));
    2671             Node* op2 = get(VirtualRegister(currentInstruction[2].u.operand));
     2667            Node* op1 = get(currentInstruction[1].u.operand);
     2668            Node* op2 = get(currentInstruction[2].u.operand);
    26722669            if (canFold(op1) && canFold(op2)) {
    26732670                JSValue aValue = valueOfJSConstant(op1);
     
    26942691        case op_jgreater: {
    26952692            unsigned relativeOffset = currentInstruction[3].u.operand;
    2696             Node* op1 = get(VirtualRegister(currentInstruction[1].u.operand));
    2697             Node* op2 = get(VirtualRegister(currentInstruction[2].u.operand));
     2693            Node* op1 = get(currentInstruction[1].u.operand);
     2694            Node* op2 = get(currentInstruction[2].u.operand);
    26982695            if (canFold(op1) && canFold(op2)) {
    26992696                JSValue aValue = valueOfJSConstant(op1);
     
    27202717        case op_jgreatereq: {
    27212718            unsigned relativeOffset = currentInstruction[3].u.operand;
    2722             Node* op1 = get(VirtualRegister(currentInstruction[1].u.operand));
    2723             Node* op2 = get(VirtualRegister(currentInstruction[2].u.operand));
     2719            Node* op1 = get(currentInstruction[1].u.operand);
     2720            Node* op2 = get(currentInstruction[2].u.operand);
    27242721            if (canFold(op1) && canFold(op2)) {
    27252722                JSValue aValue = valueOfJSConstant(op1);
     
    27462743        case op_jnless: {
    27472744            unsigned relativeOffset = currentInstruction[3].u.operand;
    2748             Node* op1 = get(VirtualRegister(currentInstruction[1].u.operand));
    2749             Node* op2 = get(VirtualRegister(currentInstruction[2].u.operand));
     2745            Node* op1 = get(currentInstruction[1].u.operand);
     2746            Node* op2 = get(currentInstruction[2].u.operand);
    27502747            if (canFold(op1) && canFold(op2)) {
    27512748                JSValue aValue = valueOfJSConstant(op1);
     
    27722769        case op_jnlesseq: {
    27732770            unsigned relativeOffset = currentInstruction[3].u.operand;
    2774             Node* op1 = get(VirtualRegister(currentInstruction[1].u.operand));
    2775             Node* op2 = get(VirtualRegister(currentInstruction[2].u.operand));
     2771            Node* op1 = get(currentInstruction[1].u.operand);
     2772            Node* op2 = get(currentInstruction[2].u.operand);
    27762773            if (canFold(op1) && canFold(op2)) {
    27772774                JSValue aValue = valueOfJSConstant(op1);
     
    27982795        case op_jngreater: {
    27992796            unsigned relativeOffset = currentInstruction[3].u.operand;
    2800             Node* op1 = get(VirtualRegister(currentInstruction[1].u.operand));
    2801             Node* op2 = get(VirtualRegister(currentInstruction[2].u.operand));
     2797            Node* op1 = get(currentInstruction[1].u.operand);
     2798            Node* op2 = get(currentInstruction[2].u.operand);
    28022799            if (canFold(op1) && canFold(op2)) {
    28032800                JSValue aValue = valueOfJSConstant(op1);
     
    28242821        case op_jngreatereq: {
    28252822            unsigned relativeOffset = currentInstruction[3].u.operand;
    2826             Node* op1 = get(VirtualRegister(currentInstruction[1].u.operand));
    2827             Node* op2 = get(VirtualRegister(currentInstruction[2].u.operand));
     2823            Node* op1 = get(currentInstruction[1].u.operand);
     2824            Node* op2 = get(currentInstruction[2].u.operand);
    28282825            if (canFold(op1) && canFold(op2)) {
    28292826                JSValue aValue = valueOfJSConstant(op1);
     
    28632860            }
    28642861            m_graph.m_switchData.append(data);
    2865             addToGraph(Switch, OpInfo(&m_graph.m_switchData.last()), get(VirtualRegister(currentInstruction[3].u.operand)));
     2862            addToGraph(Switch, OpInfo(&m_graph.m_switchData.last()), get(currentInstruction[3].u.operand));
    28662863            LAST_OPCODE(op_switch_imm);
    28672864        }
     
    28832880            }
    28842881            m_graph.m_switchData.append(data);
    2885             addToGraph(Switch, OpInfo(&m_graph.m_switchData.last()), get(VirtualRegister(currentInstruction[3].u.operand)));
     2882            addToGraph(Switch, OpInfo(&m_graph.m_switchData.last()), get(currentInstruction[3].u.operand));
    28862883            LAST_OPCODE(op_switch_char);
    28872884        }
     
    29032900            }
    29042901            m_graph.m_switchData.append(data);
    2905             addToGraph(Switch, OpInfo(&m_graph.m_switchData.last()), get(VirtualRegister(currentInstruction[3].u.operand)));
     2902            addToGraph(Switch, OpInfo(&m_graph.m_switchData.last()), get(currentInstruction[3].u.operand));
    29062903            LAST_OPCODE(op_switch_string);
    29072904        }
     
    29102907            flushArgumentsAndCapturedVariables();
    29112908            if (inlineCallFrame()) {
    2912                 ASSERT(m_inlineStackTop->m_returnValue.isValid());
    2913                 setDirect(m_inlineStackTop->m_returnValue, get(VirtualRegister(currentInstruction[1].u.operand)));
     2909                ASSERT(m_inlineStackTop->m_returnValue != InvalidVirtualRegister);
     2910                setDirect(m_inlineStackTop->m_returnValue, get(currentInstruction[1].u.operand));
    29142911                m_inlineStackTop->m_didReturn = true;
    29152912                if (m_inlineStackTop->m_unlinkedBlocks.isEmpty()) {
     
    29322929                LAST_OPCODE(op_ret);
    29332930            }
    2934             addToGraph(Return, get(VirtualRegister(currentInstruction[1].u.operand)));
     2931            addToGraph(Return, get(currentInstruction[1].u.operand));
    29352932            LAST_OPCODE(op_ret);
    29362933           
     
    29382935            flushArgumentsAndCapturedVariables();
    29392936            ASSERT(!inlineCallFrame());
    2940             addToGraph(Return, get(VirtualRegister(currentInstruction[1].u.operand)));
     2937            addToGraph(Return, get(currentInstruction[1].u.operand));
    29412938            LAST_OPCODE(op_end);
    29422939
    29432940        case op_throw:
    2944             addToGraph(Throw, get(VirtualRegister(currentInstruction[1].u.operand)));
     2941            addToGraph(Throw, get(currentInstruction[1].u.operand));
    29452942            flushAllArgumentsAndCapturedVariablesInInlineStack();
    29462943            addToGraph(Unreachable);
     
    29632960        case op_call_varargs: {
    29642961            ASSERT(inlineCallFrame());
    2965             ASSERT(currentInstruction[4].u.operand == m_inlineStackTop->m_codeBlock->argumentsRegister().offset());
     2962            ASSERT(currentInstruction[4].u.operand == m_inlineStackTop->m_codeBlock->argumentsRegister());
    29662963            ASSERT(!m_inlineStackTop->m_codeBlock->symbolTable()->slowArguments());
    29672964            // It would be cool to funnel this into handleCall() so that it can handle
     
    29782975                m_parameterSlots = JSStack::CallFrameHeaderSize + argCount;
    29792976           
    2980             addVarArgChild(get(VirtualRegister(currentInstruction[2].u.operand))); // callee
    2981             addVarArgChild(get(VirtualRegister(currentInstruction[3].u.operand))); // this
     2977            addVarArgChild(get(currentInstruction[2].u.operand)); // callee
     2978            addVarArgChild(get(currentInstruction[3].u.operand)); // this
    29822979            for (unsigned argument = 1; argument < argCount; ++argument)
    2983                 addVarArgChild(get(virtualRegisterForArgument(argument)));
    2984            
    2985             set(VirtualRegister(currentInstruction[1].u.operand),
     2980                addVarArgChild(get(argumentToOperand(argument)));
     2981           
     2982            set(currentInstruction[1].u.operand,
    29862983                addToGraph(Node::VarArg, Call, OpInfo(0), OpInfo(prediction)));
    29872984           
     
    29972994                CheckFunction,
    29982995                OpInfo(actualPointerFor(m_inlineStackTop->m_codeBlock, currentInstruction[2].u.specialPointer)),
    2999                 get(VirtualRegister(currentInstruction[1].u.operand)));
     2996                get(currentInstruction[1].u.operand));
    30002997            addToGraph(Jump, OpInfo(m_currentIndex + OPCODE_LENGTH(op_jneq_ptr)));
    30012998            LAST_OPCODE(op_jneq_ptr);
     
    30153012            case GlobalPropertyWithVarInjectionChecks:
    30163013            case GlobalVarWithVarInjectionChecks:
    3017                 set(VirtualRegister(dst), cellConstant(m_inlineStackTop->m_codeBlock->globalObject()));
     3014                set(dst, cellConstant(m_inlineStackTop->m_codeBlock->globalObject()));
    30183015                break;
    30193016            case ClosureVar:
    30203017            case ClosureVarWithVarInjectionChecks:
    3021                 set(VirtualRegister(dst), getScope(m_inlineStackTop->m_codeBlock->needsActivation(), depth));
     3018                set(dst, getScope(m_inlineStackTop->m_codeBlock->needsActivation(), depth));
    30223019                break;
    30233020            case Dynamic:
     
    30513048                GetByIdStatus status = GetByIdStatus::computeFor(*m_vm, structure, uid);
    30523049                if (status.takesSlowPath()) {
    3053                     set(VirtualRegister(dst), addToGraph(GetByIdFlush, OpInfo(identifierNumber), OpInfo(prediction), get(VirtualRegister(scope))));
     3050                    set(dst, addToGraph(GetByIdFlush, OpInfo(identifierNumber), OpInfo(prediction), get(scope)));
    30543051                    break;
    30553052                }
    30563053                Node* base = cellConstantWithStructureCheck(globalObject, status.structureSet().singletonStructure());
    30573054                if (JSValue specificValue = status.specificValue())
    3058                     set(VirtualRegister(dst), cellConstant(specificValue.asCell()));
     3055                    set(dst, cellConstant(specificValue.asCell()));
    30593056                else
    3060                     set(VirtualRegister(dst), handleGetByOffset(prediction, base, identifierNumber, operand));
     3057                    set(dst, handleGetByOffset(prediction, base, identifierNumber, operand));
    30613058                break;
    30623059            }
     
    30653062                SymbolTableEntry entry = globalObject->symbolTable()->get(uid);
    30663063                if (!entry.couldBeWatched() || !m_graph.watchpoints().isStillValid(entry.watchpointSet())) {
    3067                     set(VirtualRegister(dst), addToGraph(GetGlobalVar, OpInfo(operand), OpInfo(prediction)));
     3064                    set(dst, addToGraph(GetGlobalVar, OpInfo(operand), OpInfo(prediction)));
    30683065                    break;
    30693066                }
     
    30713068                addToGraph(GlobalVarWatchpoint, OpInfo(operand), OpInfo(identifierNumber));
    30723069                JSValue specificValue = globalObject->registerAt(entry.getIndex()).get();
    3073                 set(VirtualRegister(dst), cellConstant(specificValue.asCell()));
     3070                set(dst, cellConstant(specificValue.asCell()));
    30743071                break;
    30753072            }
    30763073            case ClosureVar:
    30773074            case ClosureVarWithVarInjectionChecks:
    3078                 set(VirtualRegister(dst),
     3075                set(dst,
    30793076                    addToGraph(GetClosureVar, OpInfo(operand), OpInfo(prediction),
    3080                         addToGraph(GetClosureRegisters, get(VirtualRegister(scope)))));
     3077                        addToGraph(GetClosureRegisters, get(scope))));
    30813078                break;
    30823079            case Dynamic:
     
    31093106                PutByIdStatus status = PutByIdStatus::computeFor(*m_vm, globalObject, structure, uid, false);
    31103107                if (!status.isSimpleReplace()) {
    3111                     addToGraph(PutById, OpInfo(identifierNumber), get(VirtualRegister(scope)), get(VirtualRegister(value)));
     3108                    addToGraph(PutById, OpInfo(identifierNumber), get(scope), get(value));
    31123109                    break;
    31133110                }
    31143111                Node* base = cellConstantWithStructureCheck(globalObject, status.oldStructure());
    3115                 handlePutByOffset(base, identifierNumber, static_cast<PropertyOffset>(operand), get(VirtualRegister(value)));
     3112                handlePutByOffset(base, identifierNumber, static_cast<PropertyOffset>(operand), get(value));
    31163113                // Keep scope alive until after put.
    3117                 addToGraph(Phantom, get(VirtualRegister(scope)));
     3114                addToGraph(Phantom, get(scope));
    31183115                break;
    31193116            }
     
    31223119                SymbolTableEntry entry = globalObject->symbolTable()->get(uid);
    31233120                ASSERT(!entry.couldBeWatched() || !m_graph.watchpoints().isStillValid(entry.watchpointSet()));
    3124                 addToGraph(PutGlobalVar, OpInfo(operand), get(VirtualRegister(value)));
     3121                addToGraph(PutGlobalVar, OpInfo(operand), get(value));
    31253122                // Keep scope alive until after put.
    3126                 addToGraph(Phantom, get(VirtualRegister(scope)));
     3123                addToGraph(Phantom, get(scope));
    31273124                break;
    31283125            }
    31293126            case ClosureVar:
    31303127            case ClosureVarWithVarInjectionChecks: {
    3131                 Node* scopeNode = get(VirtualRegister(scope));
     3128                Node* scopeNode = get(scope);
    31323129                Node* scopeRegisters = addToGraph(GetClosureRegisters, scopeNode);
    3133                 addToGraph(PutClosureVar, OpInfo(operand), scopeNode, scopeRegisters, get(VirtualRegister(value)));
     3130                addToGraph(PutClosureVar, OpInfo(operand), scopeNode, scopeRegisters, get(value));
    31343131                break;
    31353132            }
     
    31623159           
    31633160        case op_init_lazy_reg: {
    3164             set(VirtualRegister(currentInstruction[1].u.operand), getJSConstantForValue(JSValue()));
     3161            set(currentInstruction[1].u.operand, getJSConstantForValue(JSValue()));
    31653162            ASSERT(operandIsLocal(currentInstruction[1].u.operand));
    3166             m_graph.m_lazyVars.set(VirtualRegister(currentInstruction[1].u.operand).toLocal());
     3163            m_graph.m_lazyVars.set(operandToLocal(currentInstruction[1].u.operand));
    31673164            NEXT_OPCODE(op_init_lazy_reg);
    31683165        }
    31693166           
    31703167        case op_create_activation: {
    3171             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(CreateActivation, get(VirtualRegister(currentInstruction[1].u.operand))));
     3168            set(currentInstruction[1].u.operand, addToGraph(CreateActivation, get(currentInstruction[1].u.operand)));
    31723169            NEXT_OPCODE(op_create_activation);
    31733170        }
     
    31753172        case op_create_arguments: {
    31763173            m_graph.m_hasArguments = true;
    3177             Node* createArguments = addToGraph(CreateArguments, get(VirtualRegister(currentInstruction[1].u.operand)));
    3178             set(VirtualRegister(currentInstruction[1].u.operand), createArguments);
    3179             set(unmodifiedArgumentsRegister(VirtualRegister(currentInstruction[1].u.operand)), createArguments);
     3174            Node* createArguments = addToGraph(CreateArguments, get(currentInstruction[1].u.operand));
     3175            set(currentInstruction[1].u.operand, createArguments);
     3176            set(unmodifiedArgumentsRegister(currentInstruction[1].u.operand), createArguments);
    31803177            NEXT_OPCODE(op_create_arguments);
    31813178        }
    31823179           
    31833180        case op_tear_off_activation: {
    3184             addToGraph(TearOffActivation, get(VirtualRegister(currentInstruction[1].u.operand)));
     3181            addToGraph(TearOffActivation, get(currentInstruction[1].u.operand));
    31853182            NEXT_OPCODE(op_tear_off_activation);
    31863183        }
     
    31883185        case op_tear_off_arguments: {
    31893186            m_graph.m_hasArguments = true;
    3190             addToGraph(TearOffArguments, get(unmodifiedArgumentsRegister(VirtualRegister(currentInstruction[1].u.operand))), get(VirtualRegister(currentInstruction[2].u.operand)));
     3187            addToGraph(TearOffArguments, get(unmodifiedArgumentsRegister(currentInstruction[1].u.operand)), get(currentInstruction[2].u.operand));
    31913188            NEXT_OPCODE(op_tear_off_arguments);
    31923189        }
     
    31943191        case op_get_arguments_length: {
    31953192            m_graph.m_hasArguments = true;
    3196             set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(GetMyArgumentsLengthSafe));
     3193            set(currentInstruction[1].u.operand, addToGraph(GetMyArgumentsLengthSafe));
    31973194            NEXT_OPCODE(op_get_arguments_length);
    31983195        }
     
    32003197        case op_get_argument_by_val: {
    32013198            m_graph.m_hasArguments = true;
    3202             set(VirtualRegister(currentInstruction[1].u.operand),
     3199            set(currentInstruction[1].u.operand,
    32033200                addToGraph(
    32043201                    GetMyArgumentByValSafe, OpInfo(0), OpInfo(getPrediction()),
    3205                     get(VirtualRegister(currentInstruction[3].u.operand))));
     3202                    get(currentInstruction[3].u.operand)));
    32063203            NEXT_OPCODE(op_get_argument_by_val);
    32073204        }
     
    32093206        case op_new_func: {
    32103207            if (!currentInstruction[3].u.operand) {
    3211                 set(VirtualRegister(currentInstruction[1].u.operand),
     3208                set(currentInstruction[1].u.operand,
    32123209                    addToGraph(NewFunctionNoCheck, OpInfo(currentInstruction[2].u.operand)));
    32133210            } else {
    3214                 set(VirtualRegister(currentInstruction[1].u.operand),
     3211                set(currentInstruction[1].u.operand,
    32153212                    addToGraph(
    32163213                        NewFunction,
    32173214                        OpInfo(currentInstruction[2].u.operand),
    3218                         get(VirtualRegister(currentInstruction[1].u.operand))));
     3215                        get(currentInstruction[1].u.operand)));
    32193216            }
    32203217            NEXT_OPCODE(op_new_func);
     
    32223219           
    32233220        case op_new_func_exp: {
    3224             set(VirtualRegister(currentInstruction[1].u.operand),
     3221            set(currentInstruction[1].u.operand,
    32253222                addToGraph(NewFunctionExpression, OpInfo(currentInstruction[2].u.operand)));
    32263223            NEXT_OPCODE(op_new_func_exp);
     
    32283225
    32293226        case op_typeof: {
    3230             set(VirtualRegister(currentInstruction[1].u.operand),
    3231                 addToGraph(TypeOf, get(VirtualRegister(currentInstruction[2].u.operand))));
     3227            set(currentInstruction[1].u.operand,
     3228                addToGraph(TypeOf, get(currentInstruction[2].u.operand)));
    32323229            NEXT_OPCODE(op_typeof);
    32333230        }
    32343231
    32353232        case op_to_number: {
    3236             set(VirtualRegister(currentInstruction[1].u.operand),
    3237                 addToGraph(Identity, Edge(get(VirtualRegister(currentInstruction[2].u.operand)), NumberUse)));
     3233            set(currentInstruction[1].u.operand,
     3234                addToGraph(Identity, Edge(get(currentInstruction[2].u.operand), NumberUse)));
    32383235            NEXT_OPCODE(op_to_number);
    32393236        }
    32403237           
    32413238        case op_in: {
    3242             set(VirtualRegister(currentInstruction[1].u.operand),
    3243                 addToGraph(In, get(VirtualRegister(currentInstruction[2].u.operand)), get(VirtualRegister(currentInstruction[3].u.operand))));
     3239            set(currentInstruction[1].u.operand,
     3240                addToGraph(In, get(currentInstruction[2].u.operand), get(currentInstruction[3].u.operand)));
    32443241            NEXT_OPCODE(op_in);
    32453242        }
     
    33643361        // Inline case.
    33653362        ASSERT(codeBlock != byteCodeParser->m_codeBlock);
    3366         ASSERT(inlineCallFrameStart.isValid());
     3363        ASSERT(inlineCallFrameStart != InvalidVirtualRegister);
    33673364        ASSERT(callsiteBlockHead);
    33683365       
     
    33753372            byteCodeParser->m_codeBlock->ownerExecutable(),
    33763373            codeBlock->ownerExecutable());
    3377         m_inlineCallFrame->stackOffset = inlineCallFrameStart.offset() - JSStack::CallFrameHeaderSize;
     3374        m_inlineCallFrame->stackOffset = inlineCallFrameStart - JSStack::CallFrameHeaderSize;
    33783375        if (callee) {
    33793376            initializeLazyWriteBarrierForInlineCallFrameCallee(
     
    33933390        else {
    33943391            for (int i = byteCodeParser->m_codeBlock->m_numVars; i--;) {
    3395                 if (byteCodeParser->m_codeBlock->isCaptured(virtualRegisterForLocal(i)))
     3392                if (byteCodeParser->m_codeBlock->isCaptured(localToOperand(i)))
    33963393                    m_inlineCallFrame->capturedVars.set(i);
    33973394            }
     
    33993396
    34003397        for (int i = argumentCountIncludingThis; i--;) {
    3401             VirtualRegister argument = virtualRegisterForArgument(i);
    3402             if (codeBlock->isCaptured(argument))
    3403                 m_inlineCallFrame->capturedVars.set(VirtualRegister(argument.offset() + m_inlineCallFrame->stackOffset).toLocal());
     3398            if (codeBlock->isCaptured(argumentToOperand(i)))
     3399                m_inlineCallFrame->capturedVars.set(operandToLocal(argumentToOperand(i) + m_inlineCallFrame->stackOffset));
    34043400        }
    34053401        for (size_t i = codeBlock->m_numVars; i--;) {
    3406             VirtualRegister local = virtualRegisterForLocal(i);
    3407             if (codeBlock->isCaptured(local))
    3408                 m_inlineCallFrame->capturedVars.set(VirtualRegister(local.offset() + m_inlineCallFrame->stackOffset).toLocal());
     3402            int localOperand = localToOperand(i);
     3403            if (codeBlock->isCaptured(localOperand))
     3404                m_inlineCallFrame->capturedVars.set(operandToLocal(localOperand + m_inlineCallFrame->stackOffset));
    34093405        }
    34103406
     
    34703466        ASSERT(codeBlock == byteCodeParser->m_codeBlock);
    34713467        ASSERT(!callee);
    3472         ASSERT(!returnValueVR.isValid());
    3473         ASSERT(!inlineCallFrameStart.isValid());
     3468        ASSERT(returnValueVR == InvalidVirtualRegister);
     3469        ASSERT(inlineCallFrameStart == InvalidVirtualRegister);
    34743470        ASSERT(!callsiteBlockHead);
    34753471
     
    36243620   
    36253621    InlineStackEntry inlineStackEntry(
    3626         this, m_codeBlock, m_profiledBlock, 0, 0, VirtualRegister(), VirtualRegister(),
     3622        this, m_codeBlock, m_profiledBlock, 0, 0, InvalidVirtualRegister, InvalidVirtualRegister,
    36273623        m_codeBlock->numParameters(), CodeForCall);
    36283624   
  • trunk/Source/JavaScriptCore/dfg/DFGCFGSimplificationPhase.cpp

    r156474 r156482  
    312312    }
    313313
    314     void keepOperandAlive(BasicBlock* block, BasicBlock* jettisonedBlock, CodeOrigin codeOrigin, VirtualRegister operand)
     314    void keepOperandAlive(BasicBlock* block, BasicBlock* jettisonedBlock, CodeOrigin codeOrigin, int operand)
    315315    {
    316316        Node* livenessNode = jettisonedBlock->variablesAtHead.operand(operand);
     
    327327    {
    328328        for (size_t i = 0; i < jettisonedBlock->variablesAtHead.numberOfArguments(); ++i)
    329             keepOperandAlive(block, jettisonedBlock, boundaryCodeOrigin, virtualRegisterForArgument(i));
     329            keepOperandAlive(block, jettisonedBlock, boundaryCodeOrigin, argumentToOperand(i));
    330330        for (size_t i = 0; i < jettisonedBlock->variablesAtHead.numberOfLocals(); ++i)
    331             keepOperandAlive(block, jettisonedBlock, boundaryCodeOrigin, virtualRegisterForLocal(i));
     331            keepOperandAlive(block, jettisonedBlock, boundaryCodeOrigin, localToOperand(i));
    332332       
    333333        fixJettisonedPredecessors(block, jettisonedBlock);
     
    381381           
    382382            for (size_t i = 0; i < jettisonedBlock->variablesAtHead.numberOfArguments(); ++i)
    383                 keepOperandAlive(firstBlock, jettisonedBlock, boundaryCodeOrigin, virtualRegisterForArgument(i));
     383                keepOperandAlive(firstBlock, jettisonedBlock, boundaryCodeOrigin, argumentToOperand(i));
    384384            for (size_t i = 0; i < jettisonedBlock->variablesAtHead.numberOfLocals(); ++i)
    385                 keepOperandAlive(firstBlock, jettisonedBlock, boundaryCodeOrigin, virtualRegisterForLocal(i));
     385                keepOperandAlive(firstBlock, jettisonedBlock, boundaryCodeOrigin, localToOperand(i));
    386386        }
    387387       
  • trunk/Source/JavaScriptCore/dfg/DFGCPSRethreadingPhase.cpp

    r156474 r156482  
    218218    {
    219219        VariableAccessData* variable = node->variableAccessData();
    220         if (variable->local().isArgument())
    221             canonicalizeGetLocalFor<ArgumentOperand>(node, variable, variable->local().toArgument());
     220        if (operandIsArgument(variable->local()))
     221            canonicalizeGetLocalFor<ArgumentOperand>(node, variable, operandToArgument(variable->local()));
    222222        else
    223             canonicalizeGetLocalFor<LocalOperand>(node, variable, variable->local().toLocal());
     223            canonicalizeGetLocalFor<LocalOperand>(node, variable, operandToLocal(variable->local()));
    224224    }
    225225   
     
    286286    {
    287287        VariableAccessData* variable = node->variableAccessData();
    288         if (variable->local().isArgument())
    289             canonicalizeFlushOrPhantomLocalFor<nodeType, ArgumentOperand>(node, variable, variable->local().toArgument());
     288        if (operandIsArgument(variable->local()))
     289            canonicalizeFlushOrPhantomLocalFor<nodeType, ArgumentOperand>(node, variable, operandToArgument(variable->local()));
    290290        else
    291             canonicalizeFlushOrPhantomLocalFor<nodeType, LocalOperand>(node, variable, variable->local().toLocal());
     291            canonicalizeFlushOrPhantomLocalFor<nodeType, LocalOperand>(node, variable, operandToLocal(variable->local()));
    292292    }
    293293   
    294294    void canonicalizeSetArgument(Node* node)
    295295    {
    296         VirtualRegister local = node->local();
    297         ASSERT(local.isArgument());
    298         int argument = local.toArgument();
     296        int local = node->local();
     297        ASSERT(operandIsArgument(local));
     298        int argument = operandToArgument(local);
    299299        m_block->variablesAtHead.setArgumentFirstTime(argument, node);
    300300        m_block->variablesAtTail.setArgumentFirstTime(argument, node);
  • trunk/Source/JavaScriptCore/dfg/DFGCapabilities.cpp

    r156474 r156482  
    191191
    192192    case op_call_varargs:
    193         if (codeBlock->usesArguments() && pc[4].u.operand == codeBlock->argumentsRegister().offset())
     193        if (codeBlock->usesArguments() && pc[4].u.operand == codeBlock->argumentsRegister())
    194194            return CanInline;
    195195        return CannotCompile;
  • trunk/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp

    r156474 r156482  
    386386        return changed;
    387387    }
    388 
     388   
     389#if !ASSERT_DISABLED
     390    bool isCapturedAtOrAfter(BasicBlock* block, unsigned indexInBlock, int operand)
     391    {
     392        for (; indexInBlock < block->size(); ++indexInBlock) {
     393            Node* node = block->at(indexInBlock);
     394            if (!node->hasLocal(m_graph))
     395                continue;
     396            if (node->local() != operand)
     397                continue;
     398            if (node->variableAccessData()->isCaptured())
     399                return true;
     400        }
     401        return false;
     402    }
     403#endif // !ASSERT_DISABLED
     404   
    389405    void addStructureTransitionCheck(CodeOrigin codeOrigin, unsigned indexInBlock, JSCell* cell)
    390406    {
  • trunk/Source/JavaScriptCore/dfg/DFGFlushLivenessAnalysisPhase.cpp

    r156474 r156482  
    168168    }
    169169   
    170     void setForNode(Node* node, VirtualRegister operand, FlushFormat nodeFormat, FlushFormat newFormat)
     170    void setForNode(Node* node, int operand, FlushFormat nodeFormat, FlushFormat newFormat)
    171171    {
    172172        FlushFormat& currentFormat = m_live.operand(operand);
  • trunk/Source/JavaScriptCore/dfg/DFGGraph.cpp

    r156474 r156482  
    235235    if (node->hasVariableAccessData(*this)) {
    236236        VariableAccessData* variableAccessData = node->variableAccessData();
    237         VirtualRegister operand = variableAccessData->local();
    238         if (operand.isArgument())
    239             out.print(comma, "arg", operand.toArgument(), "(", VariableAccessDataDump(*this, variableAccessData), ")");
     237        int operand = variableAccessData->operand();
     238        if (operandIsArgument(operand))
     239            out.print(comma, "arg", operandToArgument(operand), "(", VariableAccessDataDump(*this, variableAccessData), ")");
    240240        else
    241             out.print(comma, "loc", operand.toLocal(), "(", VariableAccessDataDump(*this, variableAccessData), ")");
     241            out.print(comma, "loc", operandToLocal(operand), "(", VariableAccessDataDump(*this, variableAccessData), ")");
    242242    }
    243243    if (node->hasUnlinkedLocal()) {
    244         VirtualRegister operand = node->unlinkedLocal();
    245         if (operand.isArgument())
    246             out.print(comma, "arg", operand.toArgument());
     244        int operand = node->unlinkedLocal();
     245        if (operandIsArgument(operand))
     246            out.print(comma, "arg", operandToArgument(operand));
    247247        else
    248             out.print(comma, "loc", operand.toLocal());
     248            out.print(comma, "loc", operandToLocal(operand));
    249249    }
    250250    if (node->hasConstantBuffer()) {
  • trunk/Source/JavaScriptCore/dfg/DFGGraph.h

    r156474 r156482  
    430430    }
    431431   
    432     VirtualRegister argumentsRegisterFor(const CodeOrigin& codeOrigin)
     432    int argumentsRegisterFor(const CodeOrigin& codeOrigin)
    433433    {
    434434        if (!codeOrigin.inlineCallFrame)
    435435            return m_codeBlock->argumentsRegister();
    436436       
    437         return VirtualRegister(baselineCodeBlockForInlineCallFrame(
    438             codeOrigin.inlineCallFrame)->argumentsRegister().offset() +
    439             codeOrigin.inlineCallFrame->stackOffset);
    440     }
    441    
    442     VirtualRegister uncheckedArgumentsRegisterFor(const CodeOrigin& codeOrigin)
     437        return baselineCodeBlockForInlineCallFrame(
     438            codeOrigin.inlineCallFrame)->argumentsRegister() +
     439            codeOrigin.inlineCallFrame->stackOffset;
     440    }
     441   
     442    int uncheckedArgumentsRegisterFor(const CodeOrigin& codeOrigin)
    443443    {
    444444        if (!codeOrigin.inlineCallFrame)
     
    448448            codeOrigin.inlineCallFrame);
    449449        if (!codeBlock->usesArguments())
    450             return VirtualRegister();
    451        
    452         return VirtualRegister(codeBlock->argumentsRegister().offset() +
    453             codeOrigin.inlineCallFrame->stackOffset);
    454     }
    455    
    456     VirtualRegister uncheckedActivationRegisterFor(const CodeOrigin&)
     450            return InvalidVirtualRegister;
     451       
     452        return codeBlock->argumentsRegister() +
     453            codeOrigin.inlineCallFrame->stackOffset;
     454    }
     455   
     456    int uncheckedActivationRegisterFor(const CodeOrigin&)
    457457    {
    458458        // This will ignore CodeOrigin because we don't inline code that uses activations.
     
    473473       
    474474        if (node->op() == GetArgument)
    475             return profiledBlock->valueProfileForArgument(node->local().toArgument());
     475            return profiledBlock->valueProfileForArgument(operandToArgument(node->local()));
    476476       
    477477        if (node->hasLocal(*this)) {
    478478            if (m_form == SSA)
    479479                return 0;
    480             if (!node->local().isArgument())
     480            if (!operandIsArgument(node->local()))
    481481                return 0;
    482             int argument = node->local().toArgument();
     482            int argument = operandToArgument(node->local());
    483483            if (node->variableAccessData() != m_arguments[argument]->variableAccessData())
    484484                return 0;
  • trunk/Source/JavaScriptCore/dfg/DFGJITCode.cpp

    r156474 r156482  
    8282       
    8383        if (operandIsArgument(operand)
    84             && !VirtualRegister(operand).toArgument()
     84            && !operandToArgument(operand)
    8585            && codeBlock->codeType() == FunctionCode
    8686            && codeBlock->specializationKind() == CodeForConstruct) {
  • trunk/Source/JavaScriptCore/dfg/DFGNode.h

    r156474 r156482  
    165165        , codeOriginForExitTarget(codeOrigin)
    166166        , children(children)
    167         , m_virtualRegister(VirtualRegister())
     167        , m_virtualRegister(InvalidVirtualRegister)
    168168        , m_refCount(1)
    169169        , m_prediction(SpecNone)
     
    178178        , codeOriginForExitTarget(codeOrigin)
    179179        , children(AdjacencyList::Fixed, child1, child2, child3)
    180         , m_virtualRegister(VirtualRegister())
     180        , m_virtualRegister(InvalidVirtualRegister)
    181181        , m_refCount(1)
    182182        , m_prediction(SpecNone)
     
    192192        , codeOriginForExitTarget(codeOrigin)
    193193        , children(AdjacencyList::Fixed, child1, child2, child3)
    194         , m_virtualRegister(VirtualRegister())
     194        , m_virtualRegister(InvalidVirtualRegister)
    195195        , m_refCount(1)
    196196        , m_prediction(SpecNone)
     
    207207        , codeOriginForExitTarget(codeOrigin)
    208208        , children(AdjacencyList::Fixed, child1, child2, child3)
    209         , m_virtualRegister(VirtualRegister())
     209        , m_virtualRegister(InvalidVirtualRegister)
    210210        , m_refCount(1)
    211211        , m_prediction(SpecNone)
     
    223223        , codeOriginForExitTarget(codeOrigin)
    224224        , children(AdjacencyList::Variable, firstChild, numChildren)
    225         , m_virtualRegister(VirtualRegister())
     225        , m_virtualRegister(InvalidVirtualRegister)
    226226        , m_refCount(1)
    227227        , m_prediction(SpecNone)
     
    391391        m_op = GetLocalUnlinked;
    392392        m_flags &= ~(NodeMustGenerate | NodeMightClobber | NodeClobbersWorld);
    393         m_opInfo = local.offset();
     393        m_opInfo = local;
    394394        children.reset();
    395395    }
     
    10581058    bool hasVirtualRegister()
    10591059    {
    1060         return m_virtualRegister.isValid();
     1060        return m_virtualRegister != InvalidVirtualRegister;
    10611061    }
    10621062   
     
    10641064    {
    10651065        ASSERT(hasResult());
    1066         ASSERT(m_virtualRegister.isValid());
     1066        ASSERT(m_virtualRegister != InvalidVirtualRegister);
    10671067        return m_virtualRegister;
    10681068    }
     
    10711071    {
    10721072        ASSERT(hasResult());
    1073         ASSERT(!m_virtualRegister.isValid());
     1073        ASSERT(m_virtualRegister == InvalidVirtualRegister);
    10741074        m_virtualRegister = virtualRegister;
    10751075    }
  • trunk/Source/JavaScriptCore/dfg/DFGOSREntry.cpp

    r156474 r156482  
    139139   
    140140    for (size_t local = 0; local < entry->m_expectedValues.numberOfLocals(); ++local) {
    141         int localOffset = virtualRegisterForLocal(local).offset();
    142141        if (entry->m_localsForcedDouble.get(local)) {
    143             if (!exec->registers()[localOffset].jsValue().isNumber()) {
     142            if (!exec->registers()[localToOperand(local)].jsValue().isNumber()) {
    144143                if (Options::verboseOSR()) {
    145144                    dataLog(
    146                         "    OSR failed because variable ", localOffset, " is ",
    147                         exec->registers()[localOffset].jsValue(), ", expected number.\n");
     145                        "    OSR failed because variable ", localToOperand(local), " is ",
     146                        exec->registers()[localToOperand(local)].jsValue(), ", expected number.\n");
    148147                }
    149148                return 0;
     
    152151        }
    153152        if (entry->m_localsForcedMachineInt.get(local)) {
    154             if (!exec->registers()[localOffset].jsValue().isMachineInt()) {
     153            if (!exec->registers()[localToOperand(local)].jsValue().isMachineInt()) {
    155154                if (Options::verboseOSR()) {
    156155                    dataLog(
    157                         "    OSR failed because variable ", localOffset, " is ",
    158                         exec->registers()[localOffset].jsValue(), ", expected ",
     156                        "    OSR failed because variable ", localToOperand(local), " is ",
     157                        exec->registers()[localToOperand(local)].jsValue(), ", expected ",
    159158                        "machine int.\n");
    160159                }
     
    163162            continue;
    164163        }
    165         if (!entry->m_expectedValues.local(local).validate(exec->registers()[localOffset].jsValue())) {
     164        if (!entry->m_expectedValues.local(local).validate(exec->registers()[localToOperand(local)].jsValue())) {
    166165            if (Options::verboseOSR()) {
    167166                dataLog(
    168                     "    OSR failed because variable ", localOffset, " is ",
    169                     exec->registers()[localOffset].jsValue(), ", expected ",
     167                    "    OSR failed because variable ", localToOperand(local), " is ",
     168                    exec->registers()[localToOperand(local)].jsValue(), ", expected ",
    170169                    entry->m_expectedValues.local(local), ".\n");
    171170            }
     
    181180    //    would have otherwise just kept running albeit less quickly.
    182181   
    183     if (!vm->interpreter->stack().grow(&exec->registers()[virtualRegisterForLocal(codeBlock->m_numCalleeRegisters).offset()])) {
     182    if (!vm->interpreter->stack().grow(&exec->registers()[localToOperand(codeBlock->m_numCalleeRegisters)])) {
    184183        if (Options::verboseOSR())
    185184            dataLogF("    OSR failed because stack growth failed.\n");
     
    193192    for (size_t local = 0; local < entry->m_expectedValues.numberOfLocals(); ++local) {
    194193        if (entry->m_localsForcedDouble.get(local))
    195             *bitwise_cast<double*>(exec->registers() + virtualRegisterForLocal(local).offset()) = exec->registers()[virtualRegisterForLocal(local).offset()].jsValue().asNumber();
     194            *bitwise_cast<double*>(exec->registers() + localToOperand(local)) = exec->registers()[localToOperand(local)].jsValue().asNumber();
    196195        if (entry->m_localsForcedMachineInt.get(local))
    197             *bitwise_cast<int64_t*>(exec->registers() + virtualRegisterForLocal(local).offset()) = exec->registers()[virtualRegisterForLocal(local).offset()].jsValue().asMachineInt() << JSValue::int52ShiftAmount;
     196            *bitwise_cast<int64_t*>(exec->registers() + localToOperand(local)) = exec->registers()[localToOperand(local)].jsValue().asMachineInt() << JSValue::int52ShiftAmount;
    198197    }
    199198   
  • trunk/Source/JavaScriptCore/dfg/DFGOSREntrypointCreationPhase.cpp

    r156474 r156482  
    102102            Node* node = newRoot->appendNode(
    103103                m_graph, variable->prediction(), ExtractOSREntryLocal, codeOrigin,
    104                 OpInfo(variable->local().offset()));
     104                OpInfo(variable->local()));
    105105            newRoot->appendNode(
    106106                m_graph, SpecNone, SetLocal, codeOrigin, OpInfo(variable), Edge(node));
  • trunk/Source/JavaScriptCore/dfg/DFGOSRExit.h

    r156474 r156482  
    107107
    108108    unsigned m_streamIndex;
    109     VirtualRegister m_lastSetOperand;
     109    int m_lastSetOperand;
    110110   
    111111    RefPtr<ValueRecoveryOverride> m_valueRecoveryOverride;
  • trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp

    r156474 r156482  
    202202        case BooleanDisplacedInJSStack: {
    203203            numberOfDisplacedVirtualRegisters++;
    204             ASSERT(recovery.virtualRegister().isLocal());
     204            ASSERT(operandIsLocal(recovery.virtualRegister()));
    205205           
    206206            // See if we might like to store to this virtual register before doing
     
    211211            // to be rare, so the handling of it is optimized for the cases in
    212212            // which it does not happen.
    213             int local = recovery.virtualRegister().toLocal();
     213            int local = operandToLocal(recovery.virtualRegister());
    214214            if (local < (int)operands.numberOfLocals()) {
    215215                switch (operands.local(local).technique()) {
     
    536536   
    537537    if (numberOfPoisonedVirtualRegisters) {
    538         for (int localIndex = 0; localIndex < (int)operands.numberOfLocals(); ++localIndex) {
    539             if (!poisonedVirtualRegisters[localIndex])
     538        for (int virtualRegister = 0; virtualRegister < (int)operands.numberOfLocals(); ++virtualRegister) {
     539            if (!poisonedVirtualRegisters[virtualRegister])
    540540                continue;
    541541           
    542             VirtualRegister virtualRegister = virtualRegisterForLocal(localIndex);
    543 
    544             const ValueRecovery& recovery = operands.local(localIndex);
     542            const ValueRecovery& recovery = operands.local(virtualRegister);
    545543            switch (recovery.technique()) {
    546544            case InGPR:
    547545            case UnboxedInt32InGPR:
    548546            case UnboxedBooleanInGPR: {
    549                 m_jit.load32(reinterpret_cast<char*>(scratchDataBuffer + poisonIndex(localIndex)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload), GPRInfo::regT0);
    550                 m_jit.store32(GPRInfo::regT0, AssemblyHelpers::payloadFor(virtualRegister));
     547                m_jit.load32(reinterpret_cast<char*>(scratchDataBuffer + poisonIndex(virtualRegister)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload), GPRInfo::regT0);
     548                m_jit.store32(GPRInfo::regT0, AssemblyHelpers::payloadFor((VirtualRegister)localToOperand(virtualRegister)));
    551549                uint32_t tag = JSValue::EmptyValueTag;
    552550                if (recovery.technique() == InGPR)
     
    556554                else
    557555                    tag = JSValue::BooleanTag;
    558                 m_jit.store32(AssemblyHelpers::TrustedImm32(tag), AssemblyHelpers::tagFor(virtualRegister));
     556                m_jit.store32(AssemblyHelpers::TrustedImm32(tag), AssemblyHelpers::tagFor((VirtualRegister)localToOperand(virtualRegister)));
    559557                break;
    560558            }
     
    563561            case InPair:
    564562            case UInt32InGPR:
    565                 m_jit.load32(reinterpret_cast<char*>(scratchDataBuffer + poisonIndex(localIndex)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload), GPRInfo::regT0);
    566                 m_jit.load32(reinterpret_cast<char*>(scratchDataBuffer + poisonIndex(localIndex)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag), GPRInfo::regT1);
    567                 m_jit.store32(GPRInfo::regT0, AssemblyHelpers::payloadFor(virtualRegister));
    568                 m_jit.store32(GPRInfo::regT1, AssemblyHelpers::tagFor(virtualRegister));
     563                m_jit.load32(reinterpret_cast<char*>(scratchDataBuffer + poisonIndex(virtualRegister)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload), GPRInfo::regT0);
     564                m_jit.load32(reinterpret_cast<char*>(scratchDataBuffer + poisonIndex(virtualRegister)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag), GPRInfo::regT1);
     565                m_jit.store32(GPRInfo::regT0, AssemblyHelpers::payloadFor((VirtualRegister)localToOperand(virtualRegister)));
     566                m_jit.store32(GPRInfo::regT1, AssemblyHelpers::tagFor((VirtualRegister)localToOperand(virtualRegister)));
    569567                break;
    570568               
     
    709707    // 15) Load the result of the last bytecode operation into regT0.
    710708   
    711     if (exit.m_lastSetOperand.isValid()) {
    712         m_jit.load32(AssemblyHelpers::payloadFor(exit.m_lastSetOperand), GPRInfo::cachedResultRegister);
    713         m_jit.load32(AssemblyHelpers::tagFor(exit.m_lastSetOperand), GPRInfo::cachedResultRegister2);
     709    if (exit.m_lastSetOperand != std::numeric_limits<int>::max()) {
     710        m_jit.load32(AssemblyHelpers::payloadFor((VirtualRegister)exit.m_lastSetOperand), GPRInfo::cachedResultRegister);
     711        m_jit.load32(AssemblyHelpers::tagFor((VirtualRegister)exit.m_lastSetOperand), GPRInfo::cachedResultRegister2);
    714712    }
    715713   
  • trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp

    r156474 r156482  
    3232#include "DFGOSRExitCompilerCommon.h"
    3333#include "Operations.h"
    34 #include "VirtualRegister.h"
    35 
    3634#include <wtf/DataLog.h>
    3735
     
    397395            if (!m_jit.baselineCodeBlockFor(inlineCallFrame)->usesArguments())
    398396                continue;
    399             VirtualRegister argumentsRegister = m_jit.argumentsRegisterFor(inlineCallFrame);
     397            int argumentsRegister = m_jit.argumentsRegisterFor(inlineCallFrame);
    400398            if (didCreateArgumentsObject.add(inlineCallFrame).isNewEntry) {
    401399                // We know this call frame optimized out an arguments object that
     
    425423    // 10) Load the result of the last bytecode operation into regT0.
    426424   
    427     if (exit.m_lastSetOperand.isValid())
     425    if (exit.m_lastSetOperand != std::numeric_limits<int>::max())
    428426        m_jit.load64(AssemblyHelpers::addressFor(exit.m_lastSetOperand), GPRInfo::cachedResultRegister);
    429427   
  • trunk/Source/JavaScriptCore/dfg/DFGRegisterBank.h

    r156474 r156482  
    8686    RegID tryAllocate()
    8787    {
    88         VirtualRegister ignored = VirtualRegister();
     88        VirtualRegister ignored;
    8989       
    9090        for (uint32_t i = 0; i < NUM_REGS; ++i) {
    91             if (!m_data[i].lockCount && !m_data[i].name.isValid())
     91            if (!m_data[i].lockCount && m_data[i].name == InvalidVirtualRegister)
    9292                return allocateInternal(i, ignored);
    9393        }
     
    148148        ++m_data[index].lockCount;
    149149        VirtualRegister name = nameAtIndex(index);
    150         if (name.isValid())
     150        if (name != InvalidVirtualRegister)
    151151            releaseAtIndex(index);
    152152       
     
    166166        ASSERT(m_data[index].lockCount);
    167167        // 'index' should not currently be named, the new name must be valid.
    168         ASSERT(!m_data[index].name.isValid());
    169         ASSERT(name.isValid());
     168        ASSERT(m_data[index].name == InvalidVirtualRegister);
     169        ASSERT(name != InvalidVirtualRegister);
    170170        // 'index' should not currently have a spillOrder.
    171171        ASSERT(m_data[index].spillOrder == SpillHintInvalid);
     
    202202
    203203    // Get the name (VirtualRegister) associated with the
    204     // given register (or default VirtualRegister() for none).
     204    // given register (or InvalidVirtualRegister for none).
    205205    VirtualRegister name(RegID reg) const
    206206    {
     
    210210    bool isInUse(RegID reg) const
    211211    {
    212         return isLocked(reg) || name(reg).isValid();
     212        return isLocked(reg) || name(reg) != InvalidVirtualRegister;
    213213    }
    214214   
     
    218218        // For each register, print the VirtualRegister 'name'.
    219219        for (uint32_t i =0; i < NUM_REGS; ++i) {
    220             if (m_data[i].name.isValid())
    221                 dataLogF("[%02d]", m_data[i].name.offset());
     220            if (m_data[i].name != InvalidVirtualRegister)
     221                dataLogF("[%02d]", m_data[i].name);
    222222            else
    223223                dataLogF("[--]");
     
    313313        ASSERT(index < NUM_REGS);
    314314        // 'index' should currently be named.
    315         ASSERT(m_data[index].name.isValid());
     315        ASSERT(m_data[index].name != InvalidVirtualRegister);
    316316        // 'index' should currently have a valid spill order.
    317317        ASSERT(m_data[index].spillOrder != SpillHintInvalid);
    318318
    319         m_data[index].name = VirtualRegister();
     319        m_data[index].name = InvalidVirtualRegister;
    320320        m_data[index].spillOrder = SpillHintInvalid;
    321321    }
     
    328328
    329329        // Return the VirtualRegister of the named value currently stored in
    330         // the register being returned - or default VirtualRegister() if none.
     330        // the register being returned - or InvalidVirtualRegister if none.
    331331        spillMe = m_data[i].name;
    332332
     
    346346    struct MapEntry {
    347347        MapEntry()
    348             : name(VirtualRegister())
     348            : name(InvalidVirtualRegister)
    349349            , spillOrder(SpillHintInvalid)
    350350            , lockCount(0)
  • trunk/Source/JavaScriptCore/dfg/DFGScoreBoard.h

    r156474 r156482  
    9090            ASSERT(!m_used[index]);
    9191            m_highWatermark = std::max(m_highWatermark, static_cast<unsigned>(index) + 1);
    92             return virtualRegisterForLocal(index);
     92            return (VirtualRegister)localToOperand(index);
    9393        }
    9494
     
    9797        m_used.append(0);
    9898        m_highWatermark = std::max(m_highWatermark, static_cast<unsigned>(next) + 1);
    99         return virtualRegisterForLocal(next);
     99        return (VirtualRegister)localToOperand(next);
    100100    }
    101101
     
    108108
    109109        // Find the virtual register number for this child, increment its use count.
    110         uint32_t index = child->virtualRegister().toLocal();
     110        uint32_t index = operandToLocal(child->virtualRegister());
    111111        ASSERT(m_used[index] != max());
    112112        if (child->refCount() == ++m_used[index]) {
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r156474 r156482  
    4949    , m_arguments(jit.codeBlock()->numParameters())
    5050    , m_variables(jit.graph().m_localVars)
    51     , m_lastSetOperand(VirtualRegister())
     51    , m_lastSetOperand(std::numeric_limits<int>::max())
    5252    , m_state(m_jit.graph())
    5353    , m_interpreter(m_jit.graph(), m_state)
     
    11841184    for (gpr_iterator iter = m_gprs.begin(); iter != m_gprs.end(); ++iter) {
    11851185        VirtualRegister virtualRegister = iter.name();
    1186         if (!virtualRegister.isValid())
     1186        if (virtualRegister == InvalidVirtualRegister)
    11871187            continue;
    11881188
     
    12101210    for (fpr_iterator iter = m_fprs.begin(); iter != m_fprs.end(); ++iter) {
    12111211        VirtualRegister virtualRegister = iter.name();
    1212         if (!virtualRegister.isValid())
     1212        if (virtualRegister == InvalidVirtualRegister)
    12131213            continue;
    12141214
     
    15391539        noticeOSRBirth(child->child1().node());
    15401540   
    1541     m_stream->appendAndLog(VariableEvent::movHint(MinifiedID(child), node->local().offset()));
     1541    m_stream->appendAndLog(VariableEvent::movHint(MinifiedID(child), node->local()));
    15421542}
    15431543
     
    15571557    for (int i = 0; i < argumentCountIncludingThis; ++i) {
    15581558        ValueRecovery recovery;
    1559         if (codeBlock->isCaptured(virtualRegisterForArgument(i)))
     1559        if (codeBlock->isCaptured(argumentToOperand(i)))
    15601560            recovery = ValueRecovery::alreadyInJSStack();
    15611561        else {
     
    16401640        ValueSource valueSource = ValueSource(ValueInJSStack);
    16411641        m_arguments[i] = valueSource;
    1642         m_stream->appendAndLog(VariableEvent::setLocal(virtualRegisterForArgument(i), valueSource.dataFormat()));
     1642        m_stream->appendAndLog(VariableEvent::setLocal(argumentToOperand(i), valueSource.dataFormat()));
    16431643    }
    16441644   
     
    16601660        m_variables[i] = valueSource;
    16611661        // FIXME: Don't emit SetLocal(Dead). https://bugs.webkit.org/show_bug.cgi?id=108019
    1662         m_stream->appendAndLog(VariableEvent::setLocal(virtualRegisterForLocal(i), valueSource.dataFormat()));
    1663     }
    1664    
    1665     m_lastSetOperand = VirtualRegister();
     1662        m_stream->appendAndLog(VariableEvent::setLocal(localToOperand(i), valueSource.dataFormat()));
     1663    }
     1664   
     1665    m_lastSetOperand = std::numeric_limits<int>::max();
    16661666    m_codeOriginForExitTarget = CodeOrigin();
    16671667    m_codeOriginForExitProfile = CodeOrigin();
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h

    r156474 r156482  
    4242#include "MarkedAllocator.h"
    4343#include "ValueRecovery.h"
    44 #include "VirtualRegister.h"
    4544
    4645namespace JSC { namespace DFG {
     
    186185        VirtualRegister spillMe;
    187186        GPRReg gpr = m_gprs.allocate(spillMe);
    188         if (spillMe.isValid()) {
     187        if (spillMe != InvalidVirtualRegister) {
    189188#if USE(JSVALUE32_64)
    190189            GenerationInfo& info = generationInfoFromVirtualRegister(spillMe);
     
    203202#endif
    204203        VirtualRegister spillMe = m_gprs.allocateSpecific(specific);
    205         if (spillMe.isValid()) {
     204        if (spillMe != InvalidVirtualRegister) {
    206205#if USE(JSVALUE32_64)
    207206            GenerationInfo& info = generationInfoFromVirtualRegister(spillMe);
     
    225224        VirtualRegister spillMe;
    226225        FPRReg fpr = m_fprs.allocate(spillMe);
    227         if (spillMe.isValid())
     226        if (spillMe != InvalidVirtualRegister)
    228227            spill(spillMe);
    229228        return fpr;
     
    362361        for (gpr_iterator iter = m_gprs.begin(); iter != m_gprs.end(); ++iter) {
    363362            GPRReg gpr = iter.regID();
    364             if (iter.name().isValid() && gpr != exclude && gpr != exclude2) {
     363            if (iter.name() != InvalidVirtualRegister && gpr != exclude && gpr != exclude2) {
    365364                SilentRegisterSavePlan plan = silentSavePlanForGPR(iter.name(), gpr);
    366365                if (doSpill)
     
    370369        }
    371370        for (fpr_iterator iter = m_fprs.begin(); iter != m_fprs.end(); ++iter) {
    372             if (iter.name().isValid() && iter.regID() != fprExclude) {
     371            if (iter.name() != InvalidVirtualRegister && iter.regID() != fprExclude) {
    373372                SilentRegisterSavePlan plan = silentSavePlanForFPR(iter.name(), iter.regID());
    374373                if (doSpill)
     
    603602    {
    604603        for (gpr_iterator iter = m_gprs.begin(); iter != m_gprs.end(); ++iter) {
    605             if (iter.name().isValid()) {
     604            if (iter.name() != InvalidVirtualRegister) {
    606605                spill(iter.name());
    607606                iter.release();
     
    609608        }
    610609        for (fpr_iterator iter = m_fprs.begin(); iter != m_fprs.end(); ++iter) {
    611             if (iter.name().isValid()) {
     610            if (iter.name() != InvalidVirtualRegister) {
    612611                spill(iter.name());
    613612                iter.release();
     
    622621    {
    623622        for (gpr_iterator iter = m_gprs.begin(); iter != m_gprs.end(); ++iter) {
    624             if (iter.name().isValid())
     623            if (iter.name() != InvalidVirtualRegister)
    625624                return false;
    626625        }
    627626        for (fpr_iterator iter = m_fprs.begin(); iter != m_fprs.end(); ++iter) {
    628             if (iter.name().isValid())
     627            if (iter.name() != InvalidVirtualRegister)
    629628                return false;
    630629        }
     
    761760    MacroAssembler::Address argumentSlot(int argument)
    762761    {
    763         return MacroAssembler::Address(GPRInfo::callFrameRegister, (-m_jit.codeBlock()->m_numCalleeRegisters + virtualRegisterForArgument(argument).offset()) * static_cast<int>(sizeof(Register)));
     762        return MacroAssembler::Address(GPRInfo::callFrameRegister, (-m_jit.codeBlock()->m_numCalleeRegisters + argumentToOperand(argument)) * static_cast<int>(sizeof(Register)));
    764763    }
    765764
     
    776775    MacroAssembler::Address argumentTagSlot(int argument)
    777776    {
    778         return MacroAssembler::Address(GPRInfo::callFrameRegister, (-m_jit.codeBlock()->m_numCalleeRegisters + virtualRegisterForArgument(argument).offset()) * static_cast<int>(sizeof(Register)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag));
     777        return MacroAssembler::Address(GPRInfo::callFrameRegister, (-m_jit.codeBlock()->m_numCalleeRegisters + argumentToOperand(argument)) * static_cast<int>(sizeof(Register)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag));
    779778    }
    780779
    781780    MacroAssembler::Address argumentPayloadSlot(int argument)
    782781    {
    783         return MacroAssembler::Address(GPRInfo::callFrameRegister, (-m_jit.codeBlock()->m_numCalleeRegisters + virtualRegisterForArgument(argument).offset()) * static_cast<int>(sizeof(Register)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload));
     782        return MacroAssembler::Address(GPRInfo::callFrameRegister, (-m_jit.codeBlock()->m_numCalleeRegisters + argumentToOperand(argument)) * static_cast<int>(sizeof(Register)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload));
    784783    }
    785784
     
    21902189    // operand-indexed variables.
    21912190   
    2192     ValueSource valueSourceForOperand(VirtualRegister operand)
     2191    ValueSource valueSourceForOperand(int operand)
    21932192    {
    21942193        return valueSourceReferenceForOperand(operand);
    21952194    }
    21962195   
    2197     void setNodeForOperand(Node* node, VirtualRegister operand)
     2196    void setNodeForOperand(Node* node, int operand)
    21982197    {
    21992198        valueSourceReferenceForOperand(operand) = ValueSource(MinifiedID(node));
     
    22042203    // twice and then perform operands on both references, since the one from
    22052204    // the first call may no longer be valid.
    2206     ValueSource& valueSourceReferenceForOperand(VirtualRegister operand)
    2207     {
    2208         if (operand.isArgument()) {
    2209             int argument = operand.toArgument();
     2205    ValueSource& valueSourceReferenceForOperand(int operand)
     2206    {
     2207        if (operandIsArgument(operand)) {
     2208            int argument = operandToArgument(operand);
    22102209            return m_arguments[argument];
    22112210        }
    22122211
    2213         int local = operand.toLocal();
     2212        int local = operandToLocal(operand);
    22142213        if ((unsigned)local >= m_variables.size())
    22152214            m_variables.resize(local + 1);
     
    22182217    }
    22192218   
    2220     void recordSetLocal(VirtualRegister operand, ValueSource valueSource)
     2219    void recordSetLocal(int operand, ValueSource valueSource)
    22212220    {
    22222221        valueSourceReferenceForOperand(operand) = valueSource;
     
    22262225    GenerationInfo& generationInfoFromVirtualRegister(VirtualRegister virtualRegister)
    22272226    {
    2228         return m_generationInfo[virtualRegister.toLocal()];
     2227        return m_generationInfo[operandToLocal(virtualRegister)];
    22292228    }
    22302229   
     
    22692268    Vector<ValueSource, 0> m_arguments;
    22702269    Vector<ValueSource, 0> m_variables;
    2271     VirtualRegister m_lastSetOperand;
     2270    int m_lastSetOperand;
    22722271    CodeOrigin m_codeOriginForExitTarget;
    22732272    CodeOrigin m_codeOriginForExitProfile;
     
    22882287    ValueRecovery computeValueRecoveryFor(int operand)
    22892288    {
    2290         return computeValueRecoveryFor(valueSourceForOperand(VirtualRegister(operand)));
     2289        return computeValueRecoveryFor(valueSourceForOperand(operand));
    22912290    }
    22922291};
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp

    r156474 r156482  
    47814781            slowPathCall(
    47824782                created, this, operationGetArgumentsLength, resultGPR,
    4783                 m_jit.argumentsRegisterFor(node->codeOrigin).offset()));
     4783                m_jit.argumentsRegisterFor(node->codeOrigin)));
    47844784       
    47854785        jsValueResult(resultGPR, node);
     
    49204920                slowPathCall(
    49214921                    slowPath, this, operationGetInlinedArgumentByVal, resultGPR,
    4922                     m_jit.argumentsRegisterFor(node->codeOrigin).offset(),
     4922                    m_jit.argumentsRegisterFor(node->codeOrigin),
    49234923                    node->codeOrigin.inlineCallFrame,
    49244924                    indexGPR));
     
    49274927                slowPathCall(
    49284928                    slowPath, this, operationGetArgumentByVal, resultGPR,
    4929                     m_jit.argumentsRegisterFor(node->codeOrigin).offset(),
     4929                    m_jit.argumentsRegisterFor(node->codeOrigin),
    49304930                    indexGPR));
    49314931        }
  • trunk/Source/JavaScriptCore/dfg/DFGValidate.cpp

    r156474 r156482  
    7979        BasicBlock* root = m_graph.block(0);
    8080        for (unsigned i = 0; i < root->variablesAtHead.numberOfLocals(); ++i)
    81             V_EQUAL((virtualRegisterForLocal(i), 0), static_cast<Node*>(0), root->variablesAtHead.local(i));
     81            V_EQUAL((static_cast<VirtualRegister>(localToOperand(i)), 0), static_cast<Node*>(0), root->variablesAtHead.local(i));
    8282       
    8383        // Validate ref counts and uses.
     
    318318           
    319319            for (size_t i = 0; i < block->variablesAtHead.numberOfArguments(); ++i) {
    320                 VALIDATE((virtualRegisterForArgument(i), block), !block->variablesAtHead.argument(i) || block->variablesAtHead.argument(i)->hasVariableAccessData(m_graph));
     320                VALIDATE((static_cast<VirtualRegister>(argumentToOperand(i)), block), !block->variablesAtHead.argument(i) || block->variablesAtHead.argument(i)->hasVariableAccessData(m_graph));
    321321                if (m_graph.m_form == ThreadedCPS)
    322                     VALIDATE((virtualRegisterForArgument(i), block), !block->variablesAtTail.argument(i) || block->variablesAtTail.argument(i)->hasVariableAccessData(m_graph));
     322                    VALIDATE((static_cast<VirtualRegister>(argumentToOperand(i)), block), !block->variablesAtTail.argument(i) || block->variablesAtTail.argument(i)->hasVariableAccessData(m_graph));
    323323               
    324324                getLocalPositions.argument(i) = notSet;
     
    326326            }
    327327            for (size_t i = 0; i < block->variablesAtHead.numberOfLocals(); ++i) {
    328                 VALIDATE((virtualRegisterForLocal(i), block), !block->variablesAtHead.local(i) || block->variablesAtHead.local(i)->hasVariableAccessData(m_graph));
     328                VALIDATE((static_cast<VirtualRegister>(localToOperand(i)), block), !block->variablesAtHead.local(i) || block->variablesAtHead.local(i)->hasVariableAccessData(m_graph));
    329329                if (m_graph.m_form == ThreadedCPS)
    330                     VALIDATE((virtualRegisterForLocal(i), block), !block->variablesAtTail.local(i) || block->variablesAtTail.local(i)->hasVariableAccessData(m_graph));
     330                    VALIDATE((static_cast<VirtualRegister>(localToOperand(i)), block), !block->variablesAtTail.local(i) || block->variablesAtTail.local(i)->hasVariableAccessData(m_graph));
    331331
    332332                getLocalPositions.local(i) = notSet;
     
    390390            for (size_t i = 0; i < block->variablesAtHead.numberOfArguments(); ++i) {
    391391                checkOperand(
    392                     block, getLocalPositions, setLocalPositions, virtualRegisterForArgument(i));
     392                    block, getLocalPositions, setLocalPositions, argumentToOperand(i));
    393393            }
    394394            for (size_t i = 0; i < block->variablesAtHead.numberOfLocals(); ++i) {
    395395                checkOperand(
    396                     block, getLocalPositions, setLocalPositions, virtualRegisterForLocal(i));
     396                    block, getLocalPositions, setLocalPositions, localToOperand(i));
    397397            }
    398398        }
     
    401401    void checkOperand(
    402402        BasicBlock* block, Operands<size_t>& getLocalPositions,
    403         Operands<size_t>& setLocalPositions, VirtualRegister operand)
     403        Operands<size_t>& setLocalPositions, int operand)
    404404    {
    405405        if (getLocalPositions.operand(operand) == notSet)
     
    433433    {
    434434        if (!block) {
    435             dataLog("r", local, " in null Block ");
     435            dataLog("r", static_cast<int>(local), " in null Block ");
    436436            return;
    437437        }
    438438
    439         dataLog("r", local, " in Block ", *block);
     439        dataLog("r", static_cast<int>(local), " in Block ", *block);
    440440    }
    441441   
     
    443443        VirtualRegister local, BasicBlock* sourceBlock, BasicBlock* destinationBlock)
    444444    {
    445         dataLog("r", local, " in Block ", *sourceBlock, " -> ", *destinationBlock);
     445        dataLog("r", static_cast<int>(local), " in Block ", *sourceBlock, " -> ", *destinationBlock);
    446446    }
    447447   
     
    449449        VirtualRegister local, BasicBlock* sourceBlock, Node* prevNode)
    450450    {
    451         dataLog(prevNode, " for r", local, " in Block ", *sourceBlock);
     451        dataLog(prevNode, " for r", static_cast<int>(local), " in Block ", *sourceBlock);
    452452    }
    453453   
  • trunk/Source/JavaScriptCore/dfg/DFGValueRecoveryOverride.h

    r156474 r156482  
    4040    ValueRecoveryOverride() { }
    4141   
    42     ValueRecoveryOverride(VirtualRegister operand, const ValueRecovery& recovery)
     42    ValueRecoveryOverride(int operand, const ValueRecovery& recovery)
    4343        : operand(operand)
    4444        , recovery(recovery)
     
    4646    }
    4747   
    48     VirtualRegister operand;
     48    int operand;
    4949    ValueRecovery recovery;
    5050};
  • trunk/Source/JavaScriptCore/dfg/DFGVariableAccessData.h

    r156474 r156482  
    8181        return m_local;
    8282    }
    83 
     83   
     84    int operand()
     85    {
     86        return static_cast<int>(local());
     87    }
     88   
    8489    bool mergeIsCaptured(bool isCaptured)
    8590    {
     
    226231        // We don't support this facility for arguments, yet.
    227232        // FIXME: make this work for arguments.
    228         if (local().isArgument())
     233        if (operandIsArgument(operand()))
    229234            return false;
    230235       
     
    274279        ASSERT(isRoot());
    275280       
    276         if (local().isArgument() || shouldNeverUnbox())
     281        if (operandIsArgument(local()) || shouldNeverUnbox())
    277282            return DFG::mergeDoubleFormatState(m_doubleFormatState, NotUsingDoubleFormat);
    278283       
     
    329334            return FlushedInt32;
    330335       
    331         if (enableInt52() && !m_local.isArgument() && isMachineIntSpeculation(prediction))
     336        if (enableInt52() && !operandIsArgument(m_local) && isMachineIntSpeculation(prediction))
    332337            return FlushedInt52;
    333338       
  • trunk/Source/JavaScriptCore/dfg/DFGVariableEvent.h

    r156474 r156482  
    142142        VariableEvent event;
    143143        event.m_id = id;
    144         event.u.virtualReg = virtualRegister.offset();
     144        event.u.virtualReg = virtualRegister;
    145145        event.m_kind = kind;
    146146        event.m_dataFormat = format;
     
    156156    }
    157157   
    158     static VariableEvent setLocal(VirtualRegister virtualRegister, DataFormat format)
    159     {
    160         VariableEvent event;
    161         event.u.virtualReg = virtualRegister.offset();
     158    static VariableEvent setLocal(int operand, DataFormat format)
     159    {
     160        VariableEvent event;
     161        event.u.virtualReg = operand;
    162162        event.m_kind = SetLocalEvent;
    163163        event.m_dataFormat = format;
  • trunk/Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp

    r156474 r156482  
    116116    unsigned numVariables;
    117117    if (codeOrigin.inlineCallFrame)
    118         numVariables = baselineCodeBlockForInlineCallFrame(codeOrigin.inlineCallFrame)->m_numCalleeRegisters + VirtualRegister(codeOrigin.inlineCallFrame->stackOffset).toLocal();
     118        numVariables = baselineCodeBlockForInlineCallFrame(codeOrigin.inlineCallFrame)->m_numCalleeRegisters + operandToLocal(codeOrigin.inlineCallFrame->stackOffset);
    119119    else
    120120        numVariables = baselineCodeBlock->m_numCalleeRegisters;
     
    284284    for (InlineCallFrame* inlineCallFrame = codeOrigin.inlineCallFrame; inlineCallFrame; inlineCallFrame = inlineCallFrame->caller.inlineCallFrame) {
    285285        for (unsigned i = JSStack::CallFrameHeaderSize; i--;)
    286             valueRecoveries.setLocal(VirtualRegister(inlineCallFrame->stackOffset).toLocal() - i - 1, ValueRecovery::alreadyInJSStack());
     286            valueRecoveries.setLocal(operandToLocal(inlineCallFrame->stackOffset) - i - 1, ValueRecovery::alreadyInJSStack());
    287287    }
    288288}
  • trunk/Source/JavaScriptCore/dfg/DFGVirtualRegisterAllocationPhase.cpp

    r156474 r156482  
    127127            InlineCallFrame* inlineCallFrame = m_graph.m_inlineCallFrames->at(i);
    128128            CodeBlock* codeBlock = baselineCodeBlockForInlineCallFrame(inlineCallFrame);
    129             unsigned requiredCalleeRegisters = VirtualRegister(inlineCallFrame->stackOffset).toLocal() + codeBlock->m_numCalleeRegisters;
     129            unsigned requiredCalleeRegisters = operandToLocal(inlineCallFrame->stackOffset) + codeBlock->m_numCalleeRegisters;
    130130            if (requiredCalleeRegisters > calleeRegisters)
    131131                calleeRegisters = requiredCalleeRegisters;
  • trunk/Source/JavaScriptCore/ftl/FTLExitArgumentForOperand.h

    r156474 r156482  
    3939public:
    4040    ExitArgumentForOperand()
    41         : m_operand(VirtualRegister())
     41        : m_operand(InvalidVirtualRegister)
    4242    {
    4343    }
    4444   
    45     ExitArgumentForOperand(ExitArgument exitArgument, VirtualRegister operand)
     45    ExitArgumentForOperand(ExitArgument exitArgument, int operand)
    4646        : m_exitArgument(exitArgument)
    4747        , m_operand(operand)
     
    5252   
    5353    const ExitArgument& exitArgument() const { return m_exitArgument; }
    54     VirtualRegister operand() const { return m_operand; }
     54    int operand() const { return m_operand; }
    5555   
    5656    void dump(PrintStream&) const;
     
    5858private:
    5959    ExitArgument m_exitArgument;
    60     VirtualRegister m_operand;
     60    int m_operand;
    6161};
    6262
  • trunk/Source/JavaScriptCore/ftl/FTLLink.cpp

    r156474 r156482  
    3636#include "JITStubs.h"
    3737#include "LinkBuffer.h"
    38 #include "VirtualRegister.h"
    3938#include <wtf/LLVMHeaders.h>
    4039
     
    7776        // FIXME: https://bugs.webkit.org/show_bug.cgi?id=56291
    7877        jit.addPtr(
    79             CCallHelpers::TrustedImm32(virtualRegisterForLocal(codeBlock->m_numCalleeRegisters).offset() * sizeof(Register)),
     78            CCallHelpers::TrustedImm32(localToOperand(codeBlock->m_numCalleeRegisters) * sizeof(Register)),
    8079            GPRInfo::callFrameRegister, GPRInfo::regT1);
    8180        CCallHelpers::Jump stackCheck = jit.branchPtr(
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp

    r156474 r156482  
    4343#include "OperandsInlines.h"
    4444#include "Operations.h"
    45 #include "VirtualRegister.h"
    46 
    4745#include <wtf/ProcessID.h>
    4846
     
    7270        , m_out(state.context)
    7371        , m_valueSources(OperandsLike, state.graph.block(0)->variablesAtHead)
    74         , m_lastSetOperand(VirtualRegister())
     72        , m_lastSetOperand(std::numeric_limits<int>::max())
    7573        , m_exitThunkGenerator(state)
    7674        , m_state(state.graph)
     
    527525    {
    528526        VariableAccessData* variable = m_node->variableAccessData();
    529         VirtualRegister operand = variable->local();
     527        int operand = variable->operand();
    530528
    531529        LValue jsValue = m_out.load64(addressFor(operand));
     
    557555        EncodedJSValue* buffer = static_cast<EncodedJSValue*>(
    558556            m_ftlState.jitCode->ftlForOSREntry()->entryBuffer()->dataBuffer());
    559         setJSValue(m_out.load64(m_out.absolute(buffer + m_node->unlinkedLocal().toLocal())));
     557        setJSValue(m_out.load64(m_out.absolute(buffer + operandToLocal(m_node->unlinkedLocal()))));
    560558    }
    561559   
     
    20062004        LValue calleeFrame = m_out.add(
    20072005            m_callFrame,
    2008             m_out.constIntPtr(sizeof(Register) * virtualRegisterForLocal(codeBlock()->m_numCalleeRegisters).offset()));
     2006            m_out.constIntPtr(sizeof(Register) * localToOperand(codeBlock()->m_numCalleeRegisters)));
    20092007       
    20102008        m_out.store32(
     
    20192017            m_out.store64(
    20202018                lowJSValue(m_graph.varArgChild(m_node, 1 + i)),
    2021                 addressFor(calleeFrame, virtualRegisterForArgument(i + dummyThisArgument).offset()));
     2019                addressFor(calleeFrame, argumentToOperand(i + dummyThisArgument)));
    20222020        }
    20232021       
     
    33543352        m_ftlState.jitCode->osrExit.append(OSRExit(
    33553353            kind, lowValue.format(), m_graph.methodOfGettingAValueProfileFor(highValue),
    3356             m_codeOriginForExitTarget, m_codeOriginForExitProfile, m_lastSetOperand.offset(),
     3354            m_codeOriginForExitTarget, m_codeOriginForExitProfile, m_lastSetOperand,
    33573355            m_valueSources.numberOfArguments(), m_valueSources.numberOfLocals()));
    33583356        m_ftlState.osrExit.append(OSRExitCompilationInfo());
     
    36293627        ASSERT(node->op() != ZombieHint);
    36303628       
    3631         VirtualRegister operand = node->local();
     3629        int operand = node->local();
    36323630       
    36333631        m_lastSetOperand = operand;
     
    37473745        return addressFor(m_callFrame, operand);
    37483746    }
    3749     TypedPointer addressFor(VirtualRegister operand)
    3750     {
    3751         return addressFor(m_callFrame, operand.offset());
    3752     }
    37533747    TypedPointer payloadFor(int operand)
    37543748    {
    37553749        return payloadFor(m_callFrame, operand);
    37563750    }
    3757     TypedPointer payloadFor(VirtualRegister operand)
    3758     {
    3759         return payloadFor(m_callFrame, operand.offset());
    3760     }
    37613751    TypedPointer tagFor(int operand)
    37623752    {
    37633753        return tagFor(m_callFrame, operand);
    3764     }
    3765     TypedPointer tagFor(VirtualRegister operand)
    3766     {
    3767         return tagFor(m_callFrame, operand.offset());
    37683754    }
    37693755   
     
    37963782   
    37973783    Operands<ValueSource> m_valueSources;
    3798     VirtualRegister m_lastSetOperand;
     3784    int m_lastSetOperand;
    37993785    ExitThunkGenerator m_exitThunkGenerator;
    38003786   
  • trunk/Source/JavaScriptCore/ftl/FTLOSREntry.cpp

    r156474 r156482  
    6666    for (int argument = values.numberOfArguments(); argument--;) {
    6767        RELEASE_ASSERT(
    68             exec->r(virtualRegisterForArgument(argument).offset()).jsValue() == values.argument(argument));
     68            exec->r(argumentToOperand(argument)).jsValue() == values.argument(argument));
    6969    }
    7070   
     
    7979   
    8080    int stackFrameSize = entryCodeBlock->m_numCalleeRegisters;
    81     if (!vm.interpreter->stack().grow(&exec->registers()[virtualRegisterForLocal(stackFrameSize).offset()])) {
     81    if (!vm.interpreter->stack().grow(&exec->registers()[localToOperand(stackFrameSize)])) {
    8282        if (Options::verboseOSR())
    8383            dataLog("    OSR failed bcause stack growth failed.\n");
  • trunk/Source/JavaScriptCore/ftl/FTLOSRExit.cpp

    r156474 r156482  
    7979        return;
    8080   
    81     VirtualRegister overriddenOperand = lastMovHint->local();
     81    int overriddenOperand = lastMovHint->local();
    8282    m_lastSetOperand = overriddenOperand;
    8383   
     
    8585    // it something else? If it's an argument already, then replace that argument;
    8686    // otherwise add another argument.
    87     if (m_values[overriddenOperand.offset()].isArgument()) {
    88         ExitArgument exitArgument = m_values[overriddenOperand.offset()].exitArgument();
     87    if (m_values[overriddenOperand].isArgument()) {
     88        ExitArgument exitArgument = m_values[overriddenOperand].exitArgument();
    8989        arguments[exitArgument.argument()] = value.value();
    90         m_values[overriddenOperand.offset()] = ExitValue::exitArgument(
     90        m_values[overriddenOperand] = ExitValue::exitArgument(
    9191            exitArgument.withFormat(value.format()));
    9292        return;
     
    9595    unsigned argument = arguments.size();
    9696    arguments.append(value.value());
    97     m_values[m_lastSetOperand.offset()] = ExitValue::exitArgument(
     97    m_values[m_lastSetOperand] = ExitValue::exitArgument(
    9898        ExitArgument(value.format(), argument));
    9999}
  • trunk/Source/JavaScriptCore/ftl/FTLOSRExit.h

    r156474 r156482  
    4141#include "Operands.h"
    4242#include "ValueProfile.h"
    43 #include "VirtualRegister.h"
    4443
    4544namespace JSC { namespace FTL {
     
    162161    unsigned m_patchableCodeOffset;
    163162   
    164     VirtualRegister m_lastSetOperand;
     163    int m_lastSetOperand;
    165164   
    166165    Operands<ExitValue> m_values;
  • trunk/Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp

    r156474 r156482  
    9494            continue;
    9595       
    96         sortedArguments.append(ExitArgumentForOperand(value.exitArgument(), VirtualRegister(operand)));
     96        sortedArguments.append(ExitArgumentForOperand(value.exitArgument(), operand));
    9797    }
    9898    std::sort(sortedArguments.begin(), sortedArguments.end(), lesserArgumentIndex);
     
    159159    jit.pop(GPRInfo::nonArgGPR0); // ignore the result.
    160160   
    161     if (exit.m_lastSetOperand.isValid()) {
     161    if (exit.m_lastSetOperand != std::numeric_limits<int>::max()) {
    162162        jit.load64(
    163163            AssemblyHelpers::addressFor(exit.m_lastSetOperand), GPRInfo::cachedResultRegister);
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.h

    r156474 r156482  
    219219        // Read a register from the codeframe (or constant from the CodeBlock).
    220220        Register& r(int);
    221         // Read a register for a non-constant
     221        // Read a register for a non-constant 
    222222        Register& uncheckedR(int);
    223223
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r156474 r156482  
    6868#include "StrongInlines.h"
    6969#include "VMStackBounds.h"
    70 #include "VirtualRegister.h"
    71 
    7270#include <limits.h>
    7371#include <stdio.h>
     
    321319        JSValue v = it->jsValue();
    322320        int registerNumber = it - callFrame->registers();
    323         String name = codeBlock->nameForRegister(VirtualRegister(registerNumber));
     321        String name = codeBlock->nameForRegister(registerNumber);
    324322        dataLogF("[r% 3d %14s]      | %10p | %-16s 0x%lld \n", registerNumber, name.ascii().data(), it, toCString(v).data(), (long long)JSValue::encode(v));
    325323        it++;
     
    355353            JSValue v = it->jsValue();
    356354            int registerNumber = it - callFrame->registers();
    357             String name = codeBlock->nameForRegister(VirtualRegister(registerNumber));
     355            String name = codeBlock->nameForRegister(registerNumber);
    358356            dataLogF("[r% 3d %14s]      | %10p | %-16s 0x%lld \n", registerNumber, name.ascii().data(), it, toCString(v).data(), (long long)JSValue::encode(v));
    359357            --it;
     
    411409        RELEASE_ASSERT(!visitor->isInlinedFrame());
    412410#endif
    413         activation = callFrame->uncheckedR(oldCodeBlock->activationRegister().offset()).jsValue();
     411        activation = callFrame->uncheckedR(oldCodeBlock->activationRegister()).jsValue();
    414412        if (activation)
    415413            jsCast<JSActivation*>(activation)->tearOff(*scope->vm());
     
    417415
    418416    if (oldCodeBlock->codeType() == FunctionCode && oldCodeBlock->usesArguments()) {
    419         if (JSValue arguments = visitor->r(unmodifiedArgumentsRegister(oldCodeBlock->argumentsRegister()).offset()).jsValue()) {
     417        if (JSValue arguments = visitor->r(unmodifiedArgumentsRegister(oldCodeBlock->argumentsRegister())).jsValue()) {
    420418            if (activation)
    421419                jsCast<Arguments*>(arguments)->didTearOffActivation(callFrame, jsCast<JSActivation*>(activation));
     
    692690    // Unwind the scope chain within the exception handler's call frame.
    693691    int targetScopeDepth = handler->scopeDepth;
    694     if (codeBlock->needsActivation() && callFrame->uncheckedR(codeBlock->activationRegister().offset()).jsValue())
     692    if (codeBlock->needsActivation() && callFrame->uncheckedR(codeBlock->activationRegister()).jsValue())
    695693        ++targetScopeDepth;
    696694
  • trunk/Source/JavaScriptCore/jit/AssemblyHelpers.h

    r156474 r156482  
    157157    static Address addressFor(VirtualRegister virtualRegister)
    158158    {
    159         return Address(GPRInfo::callFrameRegister, virtualRegister.offset() * sizeof(Register));
     159        return Address(GPRInfo::callFrameRegister, virtualRegister * sizeof(Register));
    160160    }
    161161    static Address addressFor(int operand)
     
    166166    static Address tagFor(VirtualRegister virtualRegister)
    167167    {
    168         return Address(GPRInfo::callFrameRegister, virtualRegister.offset() * sizeof(Register) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag));
     168        return Address(GPRInfo::callFrameRegister, virtualRegister * sizeof(Register) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag));
    169169    }
    170170    static Address tagFor(int operand)
     
    175175    static Address payloadFor(VirtualRegister virtualRegister)
    176176    {
    177         return Address(GPRInfo::callFrameRegister, virtualRegister.offset() * sizeof(Register) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload));
     177        return Address(GPRInfo::callFrameRegister, virtualRegister * sizeof(Register) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload));
    178178    }
    179179    static Address payloadFor(int operand)
     
    381381    }
    382382   
    383     VirtualRegister argumentsRegisterFor(InlineCallFrame* inlineCallFrame)
     383    int argumentsRegisterFor(InlineCallFrame* inlineCallFrame)
    384384    {
    385385        if (!inlineCallFrame)
    386386            return codeBlock()->argumentsRegister();
    387387       
    388         return VirtualRegister(baselineCodeBlockForInlineCallFrame(
    389             inlineCallFrame)->argumentsRegister().offset() + inlineCallFrame->stackOffset);
    390     }
    391    
    392     VirtualRegister argumentsRegisterFor(const CodeOrigin& codeOrigin)
     388        return baselineCodeBlockForInlineCallFrame(
     389            inlineCallFrame)->argumentsRegister() + inlineCallFrame->stackOffset;
     390    }
     391   
     392    int argumentsRegisterFor(const CodeOrigin& codeOrigin)
    393393    {
    394394        return argumentsRegisterFor(codeOrigin.inlineCallFrame);
  • trunk/Source/JavaScriptCore/jit/JIT.h

    r156474 r156482  
    584584
    585585        void emitGetVirtualRegister(int src, RegisterID dst);
    586         void emitGetVirtualRegister(VirtualRegister src, RegisterID dst);
    587586        void emitGetVirtualRegisters(int src1, RegisterID dst1, int src2, RegisterID dst2);
    588         void emitGetVirtualRegisters(VirtualRegister src1, RegisterID dst1, VirtualRegister src2, RegisterID dst2);
    589587        void emitPutVirtualRegister(int dst, RegisterID from = regT0);
    590         void emitPutVirtualRegister(VirtualRegister dst, RegisterID from = regT0);
    591588        void emitStoreCell(int dst, RegisterID payload, bool /* only used in JSValue32_64 */ = false)
    592589        {
  • trunk/Source/JavaScriptCore/jit/JITCall.cpp

    r156474 r156482  
    7777    JumpList end;
    7878    bool canOptimize = m_codeBlock->usesArguments()
    79         && arguments == m_codeBlock->argumentsRegister().offset()
     79        && arguments == m_codeBlock->argumentsRegister()
    8080        && !m_codeBlock->symbolTable()->slowArguments();
    8181
  • trunk/Source/JavaScriptCore/jit/JITInlines.h

    r156474 r156482  
    759759    }
    760760
    761     if (src == m_lastResultBytecodeRegister && operandIsLocal(src) && m_codeBlock->isTemporaryRegisterIndex(VirtualRegister(src).toLocal()) && !atJumpTarget()) {
     761    if (src == m_lastResultBytecodeRegister && m_codeBlock->isTemporaryRegisterIndex(operandToLocal(src)) && !atJumpTarget()) {
    762762        // The argument we want is already stored in eax
    763763        if (dst != cachedResultRegister)
     
    769769    load64(Address(callFrameRegister, src * sizeof(Register)), dst);
    770770    killLastResultRegister();
    771 }
    772 
    773 ALWAYS_INLINE void JIT::emitGetVirtualRegister(VirtualRegister src, RegisterID dst)
    774 {
    775     emitGetVirtualRegister(src.offset(), dst);
    776771}
    777772
     
    787782}
    788783
    789 ALWAYS_INLINE void JIT::emitGetVirtualRegisters(VirtualRegister src1, RegisterID dst1, VirtualRegister src2, RegisterID dst2)
    790 {
    791     emitGetVirtualRegisters(src1.offset(), dst1, src2.offset(), dst2);
    792 }
    793 
    794784ALWAYS_INLINE int32_t JIT::getConstantOperandImmediateInt(int src)
    795785{
     
    806796    store64(from, Address(callFrameRegister, dst * sizeof(Register)));
    807797    m_lastResultBytecodeRegister = (from == cachedResultRegister) ? dst : std::numeric_limits<int>::max();
    808 }
    809 
    810 ALWAYS_INLINE void JIT::emitPutVirtualRegister(VirtualRegister dst, RegisterID from)
    811 {
    812     emitPutVirtualRegister(dst.offset(), from);
    813798}
    814799
  • trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp

    r156474 r156482  
    4040#include "LinkBuffer.h"
    4141#include "SlowPathCall.h"
    42 #include "VirtualRegister.h"
    4342
    4443namespace JSC {
     
    259258    int activation = currentInstruction[2].u.operand;
    260259
    261     Jump argsNotCreated = branchTest64(Zero, Address(callFrameRegister, sizeof(Register) * (unmodifiedArgumentsRegister(VirtualRegister(arguments)).offset())));
     260    Jump argsNotCreated = branchTest64(Zero, Address(callFrameRegister, sizeof(Register) * (unmodifiedArgumentsRegister(arguments))));
    262261    JITStubCall stubCall(this, cti_op_tear_off_arguments);
    263     stubCall.addArgument(unmodifiedArgumentsRegister(VirtualRegister(arguments)).offset(), regT2);
     262    stubCall.addArgument(unmodifiedArgumentsRegister(arguments), regT2);
    264263    stubCall.addArgument(activation, regT2);
    265264    stubCall.call();
     
    509508    if (!m_codeBlock->isKnownNotImmediate(base))
    510509        isNotObject.append(emitJumpIfNotJSCell(regT0));
    511     if (base != m_codeBlock->thisRegister().offset() || m_codeBlock->isStrictMode()) {
     510    if (base != m_codeBlock->thisRegister() || m_codeBlock->isStrictMode()) {
    512511        loadPtr(Address(regT0, JSCell::structureOffset()), regT2);
    513512        isNotObject.append(emitJumpIfNotObject(regT2));
     
    835834    size_t count = m_codeBlock->m_numVars;
    836835    for (size_t j = 0; j < count; ++j)
    837         emitInitRegister(virtualRegisterForLocal(j).offset());
     836        emitInitRegister(localToOperand(j));
    838837}
    839838
     
    854853    JITStubCall(this, cti_op_create_arguments).call();
    855854    emitPutVirtualRegister(dst);
    856     emitPutVirtualRegister(unmodifiedArgumentsRegister(VirtualRegister(dst)));
     855    emitPutVirtualRegister(unmodifiedArgumentsRegister(dst));
    857856    argsCreated.link(this);
    858857}
     
    11471146    JITStubCall(this, cti_op_create_arguments).call();
    11481147    emitPutVirtualRegister(arguments);
    1149     emitPutVirtualRegister(unmodifiedArgumentsRegister(VirtualRegister(arguments)));
     1148    emitPutVirtualRegister(unmodifiedArgumentsRegister(arguments));
    11501149   
    11511150    skipArgumentsCreation.link(this);
  • trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp

    r156474 r156482  
    4040#include "LinkBuffer.h"
    4141#include "SlowPathCall.h"
    42 #include "VirtualRegister.h"
    4342
    4443namespace JSC {
     
    10981097    // object lifetime and increasing GC pressure.
    10991098    for (int i = 0; i < m_codeBlock->m_numVars; ++i)
    1100         emitStore(virtualRegisterForLocal(i).offset(), jsUndefined());
     1099        emitStore(localToOperand(i), jsUndefined());
    11011100}
    11021101
  • trunk/Source/JavaScriptCore/jit/JITStubs.cpp

    r156474 r156482  
    10481048            int operand = mustHandleValues.operandForIndex(i);
    10491049            if (operandIsArgument(operand)
    1050                 && !VirtualRegister(operand).toArgument()
     1050                && !operandToArgument(operand)
    10511051                && codeBlock->codeType() == FunctionCode
    10521052                && codeBlock->specializationKind() == CodeForConstruct) {
     
    11551155    STUB_INIT_STACK_FRAME(stackFrame);
    11561156   
    1157     ASSERT(stackFrame.callFrame->codeBlock()->codeType() != FunctionCode || !stackFrame.callFrame->codeBlock()->needsFullScopeChain() || stackFrame.callFrame->uncheckedR(stackFrame.callFrame->codeBlock()->activationRegister().offset()).jsValue());
     1157    ASSERT(stackFrame.callFrame->codeBlock()->codeType() != FunctionCode || !stackFrame.callFrame->codeBlock()->needsFullScopeChain() || stackFrame.callFrame->uncheckedR(stackFrame.callFrame->codeBlock()->activationRegister()).jsValue());
    11581158    return JSFunction::create(stackFrame.callFrame, stackFrame.args[0].function(), stackFrame.callFrame->scope());
    11591159}
     
    19321932    FunctionExecutable* function = stackFrame.args[0].function();
    19331933    JSFunction* func = JSFunction::create(callFrame, function, callFrame->scope());
    1934     ASSERT(callFrame->codeBlock()->codeType() != FunctionCode || !callFrame->codeBlock()->needsFullScopeChain() || callFrame->uncheckedR(callFrame->codeBlock()->activationRegister().offset()).jsValue());
     1934    ASSERT(callFrame->codeBlock()->codeType() != FunctionCode || !callFrame->codeBlock()->needsFullScopeChain() || callFrame->uncheckedR(callFrame->codeBlock()->activationRegister()).jsValue());
    19351935
    19361936    return func;
     
    19601960    ASSERT(callFrame->callerFrame()->codeBlock()->codeType() != FunctionCode
    19611961        || !callFrame->callerFrame()->codeBlock()->needsFullScopeChain()
    1962         || callFrame->callerFrame()->uncheckedR(callFrame->callerFrame()->codeBlock()->activationRegister().offset()).jsValue());
     1962        || callFrame->callerFrame()->uncheckedR(callFrame->callerFrame()->codeBlock()->activationRegister()).jsValue());
    19631963
    19641964    callFrame->setScope(callerFrame->scope());
  • trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp

    r156474 r156482  
    698698        LLINT_CHECK_EXCEPTION();
    699699        LLINT_OP(2) = arguments;
    700         exec->uncheckedR(unmodifiedArgumentsRegister(VirtualRegister(pc[2].u.operand)).offset()) = arguments;
     700        exec->uncheckedR(unmodifiedArgumentsRegister(pc[2].u.operand)) = arguments;
    701701    }
    702702   
     
    918918    ASSERT(codeBlock->codeType() != FunctionCode
    919919           || !codeBlock->needsFullScopeChain()
    920            || exec->uncheckedR(codeBlock->activationRegister().offset()).jsValue());
     920           || exec->uncheckedR(codeBlock->activationRegister()).jsValue());
    921921#if LLINT_SLOW_PATH_TRACING
    922922    dataLogF("Creating function!\n");
     
    11291129    LLINT_BEGIN();
    11301130    ASSERT(exec->codeBlock()->usesArguments());
    1131     Arguments* arguments = jsCast<Arguments*>(exec->uncheckedR(unmodifiedArgumentsRegister(VirtualRegister(pc[1].u.operand)).offset()).jsValue());
     1131    Arguments* arguments = jsCast<Arguments*>(exec->uncheckedR(unmodifiedArgumentsRegister(pc[1].u.operand)).jsValue());
    11321132    if (JSValue activationValue = LLINT_OP_C(2).jsValue())
    11331133        arguments->didTearOffActivation(exec, jsCast<JSActivation*>(activationValue));
  • trunk/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp

    r156474 r156482  
    4646            continue;
    4747        out.reset();
    48         out.print("arg", i, " (r", virtualRegisterForArgument(i).offset(), "): ", description);
     48        out.print("arg", i, " (r", argumentToOperand(i), "): ", description);
    4949        m_header.append(out.toCString());
    5050    }
  • trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp

    r156474 r156482  
    208208    CHECK_EXCEPTION();
    209209    exec->uncheckedR(pc[1].u.operand) = arguments;
    210     exec->uncheckedR(unmodifiedArgumentsRegister(VirtualRegister(pc[1].u.operand)).offset()) = arguments;
     210    exec->uncheckedR(unmodifiedArgumentsRegister(pc[1].u.operand)) = arguments;
    211211    END();
    212212}
  • trunk/Source/JavaScriptCore/runtime/JSActivation.cpp

    r156474 r156482  
    219219        return jsUndefined();
    220220
    221     VirtualRegister argumentsRegister = callFrame->codeBlock()->argumentsRegister();
    222     if (JSValue arguments = callFrame->uncheckedR(argumentsRegister.offset()).jsValue())
     221    int argumentsRegister = callFrame->codeBlock()->argumentsRegister();
     222    if (JSValue arguments = callFrame->uncheckedR(argumentsRegister).jsValue())
    223223        return arguments;
    224     int realArgumentsRegister = unmodifiedArgumentsRegister(argumentsRegister).offset();
     224    int realArgumentsRegister = unmodifiedArgumentsRegister(argumentsRegister);
    225225
    226226    JSValue arguments = JSValue(Arguments::create(callFrame->vm(), callFrame));
    227     callFrame->uncheckedR(argumentsRegister.offset()) = arguments;
     227    callFrame->uncheckedR(argumentsRegister) = arguments;
    228228    callFrame->uncheckedR(realArgumentsRegister) = arguments;
    229229   
Note: See TracChangeset for help on using the changeset viewer.