Ignore:
Timestamp:
Sep 26, 2013, 10:50:46 AM (12 years ago)
Author:
[email protected]
Message:

VirtualRegister should be a class
https://bugs.webkit.org/show_bug.cgi?id=121732

Reviewed by Geoffrey Garen.

This is a refactoring change. Changed VirtualRegister from an enum to a class.
Moved Operands::operandIsArgument(), operandToArgument(), argumentToOperand()
and the similar functions for locals to VirtualRegister class.

This is in preparation for changing the offset for the first local register from
0 to -1. This is needed since most native calling conventions have the architected
frame pointer (e.g. %rbp for X86) point at the slot that stores the previous frame
pointer. Local values start below that address.

  • bytecode/CodeBlock.cpp:
  • bytecode/CodeBlock.h:
  • bytecode/Instruction.h:
  • bytecode/LazyOperandValueProfile.h:
  • bytecode/MethodOfGettingAValueProfile.cpp:
  • bytecode/Operands.h:
  • bytecode/UnlinkedCodeBlock.cpp:
  • bytecode/UnlinkedCodeBlock.h:
  • bytecode/ValueRecovery.h:
  • bytecode/VirtualRegister.h:
  • bytecompiler/BytecodeGenerator.cpp:
  • bytecompiler/BytecodeGenerator.h:
  • bytecompiler/RegisterID.h:
  • debugger/DebuggerCallFrame.cpp:
  • dfg/DFGAbstractHeap.h:
  • dfg/DFGAbstractInterpreterInlines.h:
  • dfg/DFGArgumentPosition.h:
  • dfg/DFGArgumentsSimplificationPhase.cpp:
  • dfg/DFGByteCodeParser.cpp:
  • dfg/DFGCFGSimplificationPhase.cpp:
  • dfg/DFGCPSRethreadingPhase.cpp:
  • dfg/DFGCapabilities.cpp:
  • dfg/DFGConstantFoldingPhase.cpp:
  • dfg/DFGFlushLivenessAnalysisPhase.cpp:
  • dfg/DFGGraph.cpp:
  • dfg/DFGGraph.h:
  • dfg/DFGJITCode.cpp:
  • dfg/DFGNode.h:
  • dfg/DFGOSREntry.cpp:
  • dfg/DFGOSREntrypointCreationPhase.cpp:
  • dfg/DFGOSRExit.h:
  • dfg/DFGOSRExitCompiler32_64.cpp:
  • dfg/DFGOSRExitCompiler64.cpp:
  • dfg/DFGRegisterBank.h:
  • dfg/DFGScoreBoard.h:
  • dfg/DFGSpeculativeJIT.cpp:
  • dfg/DFGSpeculativeJIT.h:
  • dfg/DFGSpeculativeJIT64.cpp:
  • dfg/DFGValidate.cpp:
  • dfg/DFGValueRecoveryOverride.h:
  • dfg/DFGVariableAccessData.h:
  • dfg/DFGVariableEvent.h:
  • dfg/DFGVariableEventStream.cpp:
  • dfg/DFGVirtualRegisterAllocationPhase.cpp:
  • ftl/FTLExitArgumentForOperand.h:
  • ftl/FTLLink.cpp:
  • ftl/FTLLowerDFGToLLVM.cpp:
  • ftl/FTLOSREntry.cpp:
  • ftl/FTLOSRExit.cpp:
  • ftl/FTLOSRExit.h:
  • ftl/FTLOSRExitCompiler.cpp:
  • interpreter/CallFrame.h:
  • interpreter/Interpreter.cpp:
  • jit/AssemblyHelpers.h:
  • jit/JIT.h:
  • jit/JITCall.cpp:
  • jit/JITInlines.h:
  • jit/JITOpcodes.cpp:
  • jit/JITOpcodes32_64.cpp:
  • jit/JITStubs.cpp:
  • llint/LLIntSlowPaths.cpp:
  • profiler/ProfilerBytecodeSequence.cpp:
  • runtime/CommonSlowPaths.cpp:
  • runtime/JSActivation.cpp:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h

    r156211 r156474  
    143143        ASSERT(m_graph.m_form == SSA);
    144144        VariableAccessData* variable = node->variableAccessData();
    145         AbstractValue& value = m_state.variables().operand(variable->local());
     145        AbstractValue& value = m_state.variables().operand(variable->local().offset());
    146146        ASSERT(value.isHeapTop());
    147147        FiltrationResult result =
     
    153153       
    154154    case ExtractOSREntryLocal: {
    155         if (!operandIsArgument(node->unlinkedLocal())
    156             && m_graph.m_lazyVars.get(operandToLocal(node->unlinkedLocal()))) {
     155        if (!(node->unlinkedLocal().isArgument())
     156            && m_graph.m_lazyVars.get(node->unlinkedLocal().toLocal())) {
    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());
     174        AbstractValue value = m_state.variables().operand(variableAccessData->local().offset());
    175175        if (!variableAccessData->isCaptured()) {
    176176            if (value.isClear())
     
    184184       
    185185    case GetLocalUnlinked: {
    186         AbstractValue value = m_state.variables().operand(node->unlinkedLocal());
     186        AbstractValue value = m_state.variables().operand(node->unlinkedLocal().offset());
    187187        if (value.value())
    188188            m_state.setFoundConstants(true);
     
    192192       
    193193    case SetLocal: {
    194         m_state.variables().operand(node->local()) = forNode(node->child1());
     194        m_state.variables().operand(node->local().offset()) = forNode(node->child1());
    195195        break;
    196196    }
     
    11341134        if (isEmptySpeculation(
    11351135                m_state.variables().operand(
    1136                     m_graph.argumentsRegisterFor(node->codeOrigin)).m_type))
     1136                    m_graph.argumentsRegisterFor(node->codeOrigin).offset()).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(localToOperand(i)))
     1610            if (m_codeBlock->isCaptured(virtualRegisterForLocal(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(argumentToOperand(i)))
     1616        if (m_codeBlock->isCaptured(virtualRegisterForArgument(i)))
    16171617            m_state.variables().argument(i).makeHeapTop();
    16181618    }
Note: See TracChangeset for help on using the changeset viewer.