Ignore:
Timestamp:
Sep 9, 2013, 10:37:51 PM (12 years ago)
Author:
[email protected]
Message:

Add local to/from operand helpers similar to argument to/from operand2
https://bugs.webkit.org/show_bug.cgi?id=121056

Reviewed by Geoffrey Garen.

Added localToOperand(), operandToLocal() and operandIsLocal() to Operands.h, very similar to
argumentToOperand(), et al. Used the new helpers everywhere where an index into a data
structure is intended instead of the actual virtual register offset. When the stack is
changed to grow down, local register offsets can be negative. Also added the helper
DFG::SpeculativeJIT::generationInfoFromVirtualRegister() for the common case accessing
m_generationInfo[operandToLocal(val)].

  • bytecode/CodeBlock.cpp:
  • bytecode/CodeBlock.h:
  • bytecode/Operands.h:

(JSC::localToOperand):
(JSC::operandIsLocal):
(JSC::operandToLocal):

  • bytecompiler/BytecodeGenerator.h:
  • dfg/DFGAbstractInterpreterInlines.h:
  • dfg/DFGByteCodeParser.cpp:
  • dfg/DFGCFGSimplificationPhase.cpp:
  • dfg/DFGCPSRethreadingPhase.cpp:
  • dfg/DFGOSREntry.cpp:
  • dfg/DFGOSRExitCompiler32_64.cpp:
  • dfg/DFGOSRExitCompiler64.cpp:
  • dfg/DFGScoreBoard.h:
  • dfg/DFGSpeculativeJIT.cpp:
  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::generationInfoFromVirtualRegister):

  • dfg/DFGSpeculativeJIT32_64.cpp:
  • dfg/DFGSpeculativeJIT64.cpp:
  • dfg/DFGValidate.cpp:
  • dfg/DFGVariableEventStream.cpp:
  • dfg/DFGVirtualRegisterAllocationPhase.cpp:
  • jit/JITInlines.h:
  • jit/JITOpcodes.cpp:
  • jit/JITOpcodes32_64.cpp:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h

    r153763 r155415  
    499499        RegisterID& registerFor(int index)
    500500        {
    501             if (index >= 0)
    502                 return m_calleeRegisters[index];
     501            if (operandIsLocal(index))
     502                return m_calleeRegisters[operandToLocal(index)];
    503503
    504504            if (index == JSStack::Callee)
     
    506506
    507507            ASSERT(m_parameters.size());
    508             return m_parameters[index + m_parameters.size() + JSStack::CallFrameHeaderSize];
     508            return m_parameters[operandToArgument(index)];
    509509        }
    510510
Note: See TracChangeset for help on using the changeset viewer.