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/bytecode/UnlinkedCodeBlock.h

    r156286 r156474  
    255255
    256256    // Special registers
    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; }
     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; }
    268268
    269269    // Parameter information
     
    400400    CodeType codeType() const { return m_codeType; }
    401401
    402     int thisRegister() const { return m_thisRegister; }
    403     int activationRegister() const { return m_activationRegister; }
     402    VirtualRegister thisRegister() const { return m_thisRegister; }
     403    VirtualRegister activationRegister() const { return m_activationRegister; }
    404404
    405405
     
    480480    VM* m_vm;
    481481
    482     int m_thisRegister;
    483     int m_argumentsRegister;
    484     int m_activationRegister;
    485     int m_globalObjectRegister;
     482    VirtualRegister m_thisRegister;
     483    VirtualRegister m_argumentsRegister;
     484    VirtualRegister m_activationRegister;
     485    VirtualRegister m_globalObjectRegister;
    486486
    487487    bool m_needsFullScopeChain : 1;
Note: See TracChangeset for help on using the changeset viewer.