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/DFGNode.h

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