Skip to content
  • msaboff@apple.com's avatar
    Change local variable register allocation to start at offset -1 · d19c4622
    msaboff@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=123182
    
    Reviewed by Geoffrey Garen.
    
    Adjusted the virtual register mapping down by one slot.  Reduced
    the CallFrame header slots offsets by one.  They now start at 0.
    Changed arity fixup to no longer skip passed register slot 0 as this
    is now part of the CallFrame header.
    
    * bytecode/VirtualRegister.h:
    (JSC::operandIsLocal):
    (JSC::operandIsArgument):
    (JSC::VirtualRegister::localToOperand):
    (JSC::VirtualRegister::operandToLocal):
      Adjusted functions for shift in mapping from local to register offset.
    
    * dfg/DFGByteCodeParser.cpp:
    (JSC::DFG::ByteCodeParser::findArgumentPositionForLocal):
    (JSC::DFG::ByteCodeParser::addCall):
    (JSC::DFG::ByteCodeParser::handleInlining):
    (JSC::DFG::ByteCodeParser::parseBlock):
    * dfg/DFGVariableEventStream.cpp:
    (JSC::DFG::VariableEventStream::reconstruct):
    * dfg/DFGVirtualRegisterAllocationPhase.cpp:
    (JSC::DFG::VirtualRegisterAllocationPhase::run):
    * interpreter/CallFrame.h:
    (JSC::ExecState::frameExtent):
    (JSC::ExecState::offsetFor):
    * interpreter/Interpreter.cpp:
    (JSC::loadVarargs):
    (JSC::Interpreter::dumpRegisters):
    (JSC::Interpreter::executeCall):
    * llint/LLIntData.cpp:
    (JSC::LLInt::Data::performAssertions):
    * llint/LowLevelInterpreter.asm:
      Adjusted math to accomodate for shift in call frame slots.
    
    * dfg/DFGJITCompiler.cpp:
    (JSC::DFG::JITCompiler::compileFunction):
    * dfg/DFGSpeculativeJIT.h:
    (JSC::DFG::SpeculativeJIT::calleeFrameOffset):
    * interpreter/CallFrame.cpp:
    (JSC::CallFrame::frameExtentInternal):
    * interpreter/JSStackInlines.h:
    (JSC::JSStack::pushFrame):
    * jit/JIT.cpp:
    (JSC::JIT::privateCompile):
    * jit/JITOperations.cpp:
    * llint/LLIntSlowPaths.cpp:
    (JSC::LLInt::llint_slow_path_stack_check):
    * runtime/CommonSlowPaths.h:
    (JSC::CommonSlowPaths::arityCheckFor):
      Fixed offset calculation to use VirtualRegister and related calculation instead of
      doing seperate calculations.
    
    * interpreter/JSStack.h:
      Adjusted CallFrame slots down by one.  Did some miscellaneous fixing of dumpRegisters()
      in the process of testing the fixes.
    
    * jit/ThunkGenerators.cpp:
    (JSC::arityFixup):
      Changed arity fixup to no longer skip passed register slot 0 as this
      is now part of the CallFrame header.
    
    * llint/LowLevelInterpreter32_64.asm:
    * llint/LowLevelInterpreter64.asm:
      Changed arity fixup to no longer skip passed register slot 0 as this
      is now part of the CallFrame header.  Updated op_enter processing for
      the change in local registers.
    
    * runtime/JSGlobalObject.h:
      Removed the now unneeded extra slot in the global callframe
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158237 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    d19c4622