Changeset 158237 in webkit


Ignore:
Timestamp:
Oct 29, 2013 4:15:09 PM (10 years ago)
Author:
msaboff@apple.com
Message:

Change local variable register allocation to start at offset -1
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
Location:
trunk
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/fast/forms/select/popup-closes-on-blur-expected.txt

    r147548 r158237  
    44
    55
    6 PASS internals.isSelectPopupVisible(popup) is true
     6FAIL internals.isSelectPopupVisible(popup) should be true. Was false.
    77PASS internals.isSelectPopupVisible(popup) is false
    88PASS successfullyParsed is true
  • trunk/Source/JavaScriptCore/ChangeLog

    r158208 r158237  
     12013-10-29  Michael Saboff  <msaboff@apple.com>
     2
     3        Change local variable register allocation to start at offset -1
     4        https://bugs.webkit.org/show_bug.cgi?id=123182
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Adjusted the virtual register mapping down by one slot.  Reduced
     9        the CallFrame header slots offsets by one.  They now start at 0.
     10        Changed arity fixup to no longer skip passed register slot 0 as this
     11        is now part of the CallFrame header.
     12
     13        * bytecode/VirtualRegister.h:
     14        (JSC::operandIsLocal):
     15        (JSC::operandIsArgument):
     16        (JSC::VirtualRegister::localToOperand):
     17        (JSC::VirtualRegister::operandToLocal):
     18          Adjusted functions for shift in mapping from local to register offset.
     19
     20        * dfg/DFGByteCodeParser.cpp:
     21        (JSC::DFG::ByteCodeParser::findArgumentPositionForLocal):
     22        (JSC::DFG::ByteCodeParser::addCall):
     23        (JSC::DFG::ByteCodeParser::handleInlining):
     24        (JSC::DFG::ByteCodeParser::parseBlock):
     25        * dfg/DFGVariableEventStream.cpp:
     26        (JSC::DFG::VariableEventStream::reconstruct):
     27        * dfg/DFGVirtualRegisterAllocationPhase.cpp:
     28        (JSC::DFG::VirtualRegisterAllocationPhase::run):
     29        * interpreter/CallFrame.h:
     30        (JSC::ExecState::frameExtent):
     31        (JSC::ExecState::offsetFor):
     32        * interpreter/Interpreter.cpp:
     33        (JSC::loadVarargs):
     34        (JSC::Interpreter::dumpRegisters):
     35        (JSC::Interpreter::executeCall):
     36        * llint/LLIntData.cpp:
     37        (JSC::LLInt::Data::performAssertions):
     38        * llint/LowLevelInterpreter.asm:
     39          Adjusted math to accomodate for shift in call frame slots.
     40
     41        * dfg/DFGJITCompiler.cpp:
     42        (JSC::DFG::JITCompiler::compileFunction):
     43        * dfg/DFGSpeculativeJIT.h:
     44        (JSC::DFG::SpeculativeJIT::calleeFrameOffset):
     45        * interpreter/CallFrame.cpp:
     46        (JSC::CallFrame::frameExtentInternal):
     47        * interpreter/JSStackInlines.h:
     48        (JSC::JSStack::pushFrame):
     49        * jit/JIT.cpp:
     50        (JSC::JIT::privateCompile):
     51        * jit/JITOperations.cpp:
     52        * llint/LLIntSlowPaths.cpp:
     53        (JSC::LLInt::llint_slow_path_stack_check):
     54        * runtime/CommonSlowPaths.h:
     55        (JSC::CommonSlowPaths::arityCheckFor):
     56          Fixed offset calculation to use VirtualRegister and related calculation instead of
     57          doing seperate calculations.
     58
     59        * interpreter/JSStack.h:
     60          Adjusted CallFrame slots down by one.  Did some miscellaneous fixing of dumpRegisters()
     61          in the process of testing the fixes.
     62
     63        * jit/ThunkGenerators.cpp:
     64        (JSC::arityFixup):
     65          Changed arity fixup to no longer skip passed register slot 0 as this
     66          is now part of the CallFrame header.
     67
     68        * llint/LowLevelInterpreter32_64.asm:
     69        * llint/LowLevelInterpreter64.asm:
     70          Changed arity fixup to no longer skip passed register slot 0 as this
     71          is now part of the CallFrame header.  Updated op_enter processing for
     72          the change in local registers.
     73
     74        * runtime/JSGlobalObject.h:
     75          Removed the now unneeded extra slot in the global callframe
     76
    1772013-10-29  Julien Brianceau  <jbriance@cisco.com>
    278
  • trunk/Source/JavaScriptCore/bytecode/VirtualRegister.h

    r156511 r158237  
    3636inline bool operandIsLocal(int operand)
    3737{
    38     return operand <= 0;
     38    return operand < 0;
    3939}
    4040
    4141inline bool operandIsArgument(int operand)
    4242{
    43     return operand > 0;
     43    return operand >= 0;
    4444}
    4545
     
    7474    static const int s_firstConstantRegisterIndex = 0x40000000;
    7575
    76     static int localToOperand(int local) { return -local; }
    77     static int operandToLocal(int operand) { return -operand; }
     76    static int localToOperand(int local) { return -1 - local; }
     77    static int operandToLocal(int operand) { return -1 - operand; }
    7878    static int operandToArgument(int operand) { return operand - CallFrame::thisArgumentOffset(); }
    7979    static int argumentToOperand(int argument) { return argument + CallFrame::thisArgumentOffset(); }
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r158141 r158237  
    392392            if (!inlineCallFrame)
    393393                break;
    394             if (operand.offset() <= static_cast<int>(inlineCallFrame->stackOffset + JSStack::CallFrameHeaderSize))
     394            if (operand.offset() < static_cast<int>(inlineCallFrame->stackOffset + JSStack::CallFrameHeaderSize))
    395395                continue;
    396396            if (operand.offset() == inlineCallFrame->stackOffset + CallFrame::thisArgumentOffset())
    397397                continue;
    398             if (operand.offset() > static_cast<int>(inlineCallFrame->stackOffset + JSStack::CallFrameHeaderSize + inlineCallFrame->arguments.size()))
     398            if (operand.offset() >= static_cast<int>(inlineCallFrame->stackOffset + CallFrame::thisArgumentOffset() + inlineCallFrame->arguments.size()))
    399399                continue;
    400400            int argument = VirtualRegister(operand.offset() - inlineCallFrame->stackOffset).toArgument();
     
    770770        addVarArgChild(get(VirtualRegister(currentInstruction[2].u.operand)));
    771771        int argCount = currentInstruction[3].u.operand;
    772         if (JSStack::CallFrameHeaderSize + (unsigned)argCount > m_parameterSlots)
    773             m_parameterSlots = JSStack::CallFrameHeaderSize + argCount;
     772        if (JSStack::ThisArgument + (unsigned)argCount > m_parameterSlots)
     773            m_parameterSlots = JSStack::ThisArgument + argCount;
    774774
    775775        int registerOffset = -currentInstruction[4].u.operand;
     
    12911291   
    12921292    // Make sure that we have enough locals.
    1293     unsigned newNumLocals = VirtualRegister(inlineCallFrameStart).toLocal() + JSStack::CallFrameHeaderSize + codeBlock->m_numCalleeRegisters;
     1293    unsigned newNumLocals = VirtualRegister(inlineCallFrameStart).toLocal() + 1 + JSStack::CallFrameHeaderSize + codeBlock->m_numCalleeRegisters;
    12941294    if (newNumLocals > m_numLocals) {
    12951295        m_numLocals = newNumLocals;
     
    29792979           
    29802980            unsigned argCount = inlineCallFrame()->arguments.size();
    2981             if (JSStack::CallFrameHeaderSize + argCount > m_parameterSlots)
    2982                 m_parameterSlots = JSStack::CallFrameHeaderSize + argCount;
     2981            if (JSStack::ThisArgument + argCount > m_parameterSlots)
     2982                m_parameterSlots = JSStack::ThisArgument + argCount;
    29832983           
    29842984            addVarArgChild(get(VirtualRegister(currentInstruction[2].u.operand))); // callee
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp

    r158141 r158237  
    333333    // Plant a check that sufficient space is available in the JSStack.
    334334    // FIXME: https://bugs.webkit.org/show_bug.cgi?id=56291
    335     addPtr(TrustedImm32(-m_codeBlock->m_numCalleeRegisters * sizeof(Register)), GPRInfo::callFrameRegister, GPRInfo::regT1);
     335    addPtr(TrustedImm32(virtualRegisterForLocal(m_codeBlock->m_numCalleeRegisters).offset() * sizeof(Register)), GPRInfo::callFrameRegister, GPRInfo::regT1);
    336336    Jump stackCheck = branchPtr(Above, AbsoluteAddress(m_vm->interpreter->stack().addressOfEnd()), GPRInfo::regT1);
    337337    // Return here after stack check.
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h

    r158116 r158237  
    738738    ptrdiff_t calleeFrameOffset(int numArgs)
    739739    {
    740         return -(m_jit.graph().m_nextMachineLocal + JSStack::CallFrameHeaderSize + numArgs) * sizeof(Register);
     740        return virtualRegisterForLocal(m_jit.graph().m_nextMachineLocal + JSStack::CallFrameHeaderSize + numArgs).offset() * sizeof(Register);
    741741    }
    742742   
  • trunk/Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp

    r156747 r158237  
    116116    unsigned numVariables;
    117117    if (codeOrigin.inlineCallFrame)
    118         numVariables = baselineCodeBlockForInlineCallFrame(codeOrigin.inlineCallFrame)->m_numCalleeRegisters + VirtualRegister(codeOrigin.inlineCallFrame->stackOffset).toLocal();
     118        numVariables = baselineCodeBlockForInlineCallFrame(codeOrigin.inlineCallFrame)->m_numCalleeRegisters + VirtualRegister(codeOrigin.inlineCallFrame->stackOffset).toLocal() + 1;
    119119    else
    120120        numVariables = baselineCodeBlock->m_numCalleeRegisters;
  • trunk/Source/JavaScriptCore/dfg/DFGVirtualRegisterAllocationPhase.cpp

    r157576 r158237  
    129129            InlineCallFrame* inlineCallFrame = *iter;
    130130            CodeBlock* codeBlock = baselineCodeBlockForInlineCallFrame(inlineCallFrame);
    131             unsigned requiredCalleeRegisters = VirtualRegister(inlineCallFrame->stackOffset).toLocal() + codeBlock->m_numCalleeRegisters;
     131            unsigned requiredCalleeRegisters = VirtualRegister(inlineCallFrame->stackOffset).toLocal() + 1 + codeBlock->m_numCalleeRegisters;
    132132            if (requiredCalleeRegisters > calleeRegisters)
    133133                calleeRegisters = requiredCalleeRegisters;
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp

    r156242 r158237  
    120120    CodeBlock* codeBlock = this->codeBlock();
    121121    ASSERT(codeBlock);
    122     return registers() - codeBlock->m_numCalleeRegisters;
     122    return registers() + virtualRegisterForLocal(codeBlock->m_numCalleeRegisters).offset();
    123123}
    124124
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.h

    r157050 r158237  
    180180        {
    181181            if (!codeBlock())
    182                 return registers();
     182                return registers() - 1;
    183183            return frameExtentInternal();
    184184        }
    185185   
    186186        Register* frameExtentInternal();
    187    
     187
    188188#if USE(JSVALUE32_64)
    189189        Instruction* currentVPC() const
     
    225225        size_t argumentCount() const { return argumentCountIncludingThis() - 1; }
    226226        size_t argumentCountIncludingThis() const { return this[JSStack::ArgumentCount].payload(); }
    227         static int argumentOffset(int argument) { return (s_firstArgumentOffset + argument); }
    228         static int argumentOffsetIncludingThis(int argument) { return (s_thisArgumentOffset + argument); }
     227        static int argumentOffset(int argument) { return (JSStack::FirstArgument + argument); }
     228        static int argumentOffsetIncludingThis(int argument) { return (JSStack::ThisArgument + argument); }
    229229
    230230        // In the following (argument() and setArgument()), the 'argument'
     
    259259        JSValue argumentAfterCapture(size_t argument);
    260260
    261         static int offsetFor(size_t argumentCountIncludingThis) { return argumentCountIncludingThis + JSStack::CallFrameHeaderSize; }
     261        static int offsetFor(size_t argumentCountIncludingThis) { return argumentCountIncludingThis + JSStack::ThisArgument - 1; }
    262262
    263263        // FIXME: Remove these.
     
    289289    private:
    290290        static const intptr_t HostCallFrameFlag = 1;
    291         static const int s_thisArgumentOffset = JSStack::CallFrameHeaderSize + 1;
    292         static const int s_firstArgumentOffset = s_thisArgumentOffset + 1;
    293291
    294292#ifndef NDEBUG
     
    311309
    312310            // The offset is defined (based on argumentOffset()) to be:
    313             //       offset = s_firstArgumentOffset - argIndex;
     311            //       offset = JSStack::FirstArgument - argIndex;
    314312            // Hence:
    315             //       argIndex = s_firstArgumentOffset - offset;
    316             size_t argIndex = offset - s_firstArgumentOffset;
     313            //       argIndex = JSStack::FirstArgument - offset;
     314            size_t argIndex = offset - JSStack::FirstArgument;
    317315            return argIndex;
    318316        }
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r157746 r158237  
    155155    if (!arguments) { // f.apply(x, arguments), with arguments unmodified.
    156156        unsigned argumentCountIncludingThis = callFrame->argumentCountIncludingThis();
    157         CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + firstFreeRegister - argumentCountIncludingThis - JSStack::CallFrameHeaderSize);
     157        CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + firstFreeRegister - argumentCountIncludingThis - JSStack::CallFrameHeaderSize - 1);
    158158        if (argumentCountIncludingThis > Arguments::MaxArguments + 1 || !stack->grow(newCallFrame->registers())) {
    159159            callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame));
     
    169169
    170170    if (arguments.isUndefinedOrNull()) {
    171         CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + firstFreeRegister - 1 - JSStack::CallFrameHeaderSize);
     171        CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + firstFreeRegister - 1 - JSStack::CallFrameHeaderSize - 1);
    172172        if (!stack->grow(newCallFrame->registers())) {
    173173            callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame));
     
    296296        visitor->computeLineAndColumn(line, unusedColumn);
    297297        dataLogF("[ReturnVPC]                | %10p | %d (line %d)\n", m_it, visitor->bytecodeOffset(), line);
    298         ++m_it;
     298        --m_it;
    299299        return StackVisitor::Done;
    300300    }
     
    316316    const Register* end;
    317317
    318     it = callFrame->registers() + JSStack::CallFrameHeaderSize + callFrame->argumentCountIncludingThis();
    319     end = callFrame->registers() + JSStack::CallFrameHeaderSize;
     318    it = callFrame->registers() + JSStack::ThisArgument + callFrame->argumentCount();
     319    end = callFrame->registers() + JSStack::ThisArgument - 1;
    320320    while (it > end) {
    321321        JSValue v = it->jsValue();
     
    323323        String name = codeBlock->nameForRegister(VirtualRegister(registerNumber));
    324324        dataLogF("[r% 3d %14s]      | %10p | %-16s 0x%lld \n", registerNumber, name.ascii().data(), it, toCString(v).data(), (long long)JSValue::encode(v));
    325         it++;
     325        --it;
    326326    }
    327327   
     
    348348    dataLogF("-----------------------------------------------------------------------------\n");
    349349
    350     int registerCount = 0;
    351 
    352350    end = it - codeBlock->m_numVars;
    353351    if (it != end) {
     
    358356            dataLogF("[r% 3d %14s]      | %10p | %-16s 0x%lld \n", registerNumber, name.ascii().data(), it, toCString(v).data(), (long long)JSValue::encode(v));
    359357            --it;
    360             --registerCount;
    361358        } while (it != end);
    362359    }
    363360    dataLogF("-----------------------------------------------------------------------------\n");
    364361
    365     end = it + codeBlock->m_numCalleeRegisters - codeBlock->m_numVars;
     362    end = it - codeBlock->m_numCalleeRegisters + codeBlock->m_numVars;
    366363    if (it != end) {
    367364        do {
    368365            JSValue v = (*it).jsValue();
    369             dataLogF("[r% 3d]                     | %10p | %-16s 0x%lld \n", registerCount, it, toCString(v).data(), (long long)JSValue::encode(v));
    370             ++it;
    371             ++registerCount;
     366            int registerNumber = it - callFrame->registers();
     367            dataLogF("[r% 3d]                     | %10p | %-16s 0x%lld \n", registerNumber, it, toCString(v).data(), (long long)JSValue::encode(v));
     368            --it;
    372369        } while (it != end);
    373370    }
  • trunk/Source/JavaScriptCore/interpreter/JSStack.h

    r155711 r158237  
    5454        enum CallFrameHeaderEntry {
    5555            CallFrameHeaderSize = 6,
    56 
    57             ArgumentCount = 6,
    58             CallerFrame = 5,
    59             Callee = 4,
    60             ScopeChain = 3,
    61             ReturnPC = 2, // This is either an Instruction* or a pointer into JIT generated code stored as an Instruction*.
    62             CodeBlock = 1,
     56            FirstArgument = 7,
     57            ThisArgument = 6,
     58            ArgumentCount = 5,
     59            CallerFrame = 4,
     60            Callee = 3,
     61            ScopeChain = 2,
     62            ReturnPC = 1, // This is either an Instruction* or a pointer into JIT generated code stored as an Instruction*.
     63            CodeBlock = 0,
    6364        };
    6465
  • trunk/Source/JavaScriptCore/interpreter/JSStackInlines.h

    r155711 r158237  
    7373    Register* newEnd = newCallFrameSlot;
    7474    if (!!codeBlock)
    75         newEnd -= codeBlock->m_numCalleeRegisters;
     75        newEnd += virtualRegisterForLocal(codeBlock->m_numCalleeRegisters).offset();
    7676
    7777    // Ensure that we have the needed stack capacity to push the new frame:
  • trunk/Source/JavaScriptCore/jit/JIT.cpp

    r157685 r158237  
    587587#endif
    588588
    589         addPtr(TrustedImm32(-m_codeBlock->m_numCalleeRegisters * sizeof(Register)), callFrameRegister, regT1);
     589        addPtr(TrustedImm32(virtualRegisterForLocal(m_codeBlock->m_numCalleeRegisters).offset() * sizeof(Register)), callFrameRegister, regT1);
    590590        stackCheck = branchPtr(Above, AbsoluteAddress(m_vm->interpreter->stack().addressOfEnd()), regT1);
    591591    }
  • trunk/Source/JavaScriptCore/jit/JITOperations.cpp

    r157660 r158237  
    8080    JSStack& stack = vm->interpreter->stack();
    8181
    82     if (UNLIKELY(!stack.grow(&exec->registers()[-codeBlock->m_numCalleeRegisters])))
     82    if (UNLIKELY(!stack.grow(&exec->registers()[virtualRegisterForLocal(codeBlock->m_numCalleeRegisters).offset()])))
    8383        vm->throwException(callerFrame, createStackOverflowError(callerFrame));
    8484}
     
    17181718HIDE_SYMBOL(getHostCallReturnValue) "\n"
    17191719SYMBOL_STRING(getHostCallReturnValue) ":" "\n"
    1720     "mov 40(%r13), %r13\n"
     1720    "mov 32(%r13), %r13\n"
    17211721    "mov %r13, %rdi\n"
    17221722    "jmp " LOCAL_REFERENCE(getHostCallReturnValueWithExecState) "\n"
     
    17291729HIDE_SYMBOL(getHostCallReturnValue) "\n"
    17301730SYMBOL_STRING(getHostCallReturnValue) ":" "\n"
    1731     "mov 40(%edi), %edi\n"
     1731    "mov 32(%edi), %edi\n"
    17321732    "mov %edi, 4(%esp)\n"
    17331733    "jmp " LOCAL_REFERENCE(getHostCallReturnValueWithExecState) "\n"
     
    17431743".thumb_func " THUMB_FUNC_PARAM(getHostCallReturnValue) "\n"
    17441744SYMBOL_STRING(getHostCallReturnValue) ":" "\n"
    1745     "ldr r5, [r5, #40]" "\n"
     1745    "ldr r5, [r5, #32]" "\n"
    17461746    "mov r0, r5" "\n"
    17471747    "b " LOCAL_REFERENCE(getHostCallReturnValueWithExecState) "\n"
     
    17551755INLINE_ARM_FUNCTION(getHostCallReturnValue)
    17561756SYMBOL_STRING(getHostCallReturnValue) ":" "\n"
    1757     "ldr r5, [r5, #40]" "\n"
     1757    "ldr r5, [r5, #32]" "\n"
    17581758    "mov r0, r5" "\n"
    17591759    "b " LOCAL_REFERENCE(getHostCallReturnValueWithExecState) "\n"
     
    17671767HIDE_SYMBOL(getHostCallReturnValue) "\n"
    17681768SYMBOL_STRING(getHostCallReturnValue) ":" "\n"
    1769     "ldur x25, [x25, #-40]" "\n"
     1769    "ldur x25, [x25, #-32]" "\n"
    17701770     "mov x0, x25" "\n"
    17711771     "b " LOCAL_REFERENCE(getHostCallReturnValueWithExecState) "\n"
     
    17791779SYMBOL_STRING(getHostCallReturnValue) ":" "\n"
    17801780    LOAD_FUNCTION_TO_T9(getHostCallReturnValueWithExecState)
    1781     "lw $s0, 40($s0)" "\n"
     1781    "lw $s0, 32($s0)" "\n"
    17821782    "move $a0, $s0" "\n"
    17831783    "b " LOCAL_REFERENCE(getHostCallReturnValueWithExecState) "\n"
     
    17901790HIDE_SYMBOL(getHostCallReturnValue) "\n"
    17911791SYMBOL_STRING(getHostCallReturnValue) ":" "\n"
    1792     "add #40, r14" "\n"
     1792    "add #32, r14" "\n"
    17931793    "mov.l @r14, r14" "\n"
    17941794    "mov r14, r4" "\n"
     
    18051805    {
    18061806        __asm {
    1807             mov edi, [edi + 40];
     1807            mov edi, [edi + 32];
    18081808            mov [esp + 4], edi;
    18091809            jmp getHostCallReturnValueWithExecState
  • trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp

    r157636 r158237  
    500500#  endif
    501501    jit.neg64(JSInterfaceJIT::regT0);
    502     jit.addPtr(JSInterfaceJIT::TrustedImm32(8), JSInterfaceJIT::callFrameRegister, JSInterfaceJIT::regT3);
     502    jit.move(JSInterfaceJIT::callFrameRegister, JSInterfaceJIT::regT3);
    503503    jit.load32(JSInterfaceJIT::Address(JSInterfaceJIT::callFrameRegister, JSStack::ArgumentCount * 8), JSInterfaceJIT::regT2);
    504504    jit.add32(JSInterfaceJIT::TrustedImm32(JSStack::CallFrameHeaderSize), JSInterfaceJIT::regT2);
     
    532532#  endif
    533533    jit.neg32(JSInterfaceJIT::regT0);
    534     jit.addPtr(JSInterfaceJIT::TrustedImm32(8), JSInterfaceJIT::callFrameRegister, JSInterfaceJIT::regT3);
     534    jit.move(JSInterfaceJIT::callFrameRegister, JSInterfaceJIT::regT3);
    535535    jit.load32(JSInterfaceJIT::Address(JSInterfaceJIT::callFrameRegister, JSStack::ArgumentCount * 8), JSInterfaceJIT::regT2);
    536536    jit.add32(JSInterfaceJIT::TrustedImm32(JSStack::CallFrameHeaderSize), JSInterfaceJIT::regT2);
  • trunk/Source/JavaScriptCore/llint/LLIntData.cpp

    r156837 r158237  
    7272    // prepared to change LowLevelInterpreter.asm as well!!
    7373    ASSERT(JSStack::CallFrameHeaderSize * 8 == 48);
    74     ASSERT(JSStack::ArgumentCount * 8 == 48);
    75     ASSERT(JSStack::CallerFrame * 8 == 40);
    76     ASSERT(JSStack::Callee * 8 == 32);
    77     ASSERT(JSStack::ScopeChain * 8 == 24);
    78     ASSERT(JSStack::ReturnPC * 8 == 16);
    79     ASSERT(JSStack::CodeBlock * 8 == 8);
    80     ASSERT(CallFrame::argumentOffsetIncludingThis(0) == JSStack::CallFrameHeaderSize + 1);
     74    ASSERT(JSStack::ArgumentCount * 8 == 40);
     75    ASSERT(JSStack::CallerFrame * 8 == 32);
     76    ASSERT(JSStack::Callee * 8 == 24);
     77    ASSERT(JSStack::ScopeChain * 8 == 16);
     78    ASSERT(JSStack::ReturnPC * 8 == 8);
     79    ASSERT(JSStack::CodeBlock * 8 == 0);
     80    ASSERT(CallFrame::argumentOffsetIncludingThis(0) == JSStack::ThisArgument);
    8181#if CPU(BIG_ENDIAN)
    8282    ASSERT(OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag) == 0);
  • trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp

    r157868 r158237  
    428428    dataLogF("Current end is at %p.\n", exec->vm().interpreter->stack().end());
    429429#endif
    430     ASSERT(!exec->vm().interpreter->stack().containsAddress(&exec->registers()[-exec->codeBlock()->m_numCalleeRegisters]));
    431     if (UNLIKELY(!vm.interpreter->stack().grow(&exec->registers()[-exec->codeBlock()->m_numCalleeRegisters]))) {
     430    ASSERT(!exec->vm().interpreter->stack().containsAddress(&exec->registers()[virtualRegisterForLocal(exec->codeBlock()->m_numCalleeRegisters).offset()]));
     431    if (UNLIKELY(!vm.interpreter->stack().grow(&exec->registers()[virtualRegisterForLocal(exec->codeBlock()->m_numCalleeRegisters).offset()]))) {
    432432        exec = exec->callerFrame();
    433433        CommonSlowPaths::interpreterThrowInCaller(exec, createStackOverflowError(exec));
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm

    r157746 r158237  
    3434const CallFrameHeaderSize = 48
    3535const CallFrameHeaderSlots = 6
    36 const ArgumentCount = 48
    37 const CallerFrame = 40
    38 const Callee = 32
    39 const ScopeChain = 24
    40 const ReturnPC = 16
    41 const CodeBlock = 8
    42 
    43 const ThisArgumentOffset = CallFrameHeaderSize + 8
     36const ArgumentCount = 40
     37const CallerFrame = 32
     38const Callee = 24
     39const ScopeChain = 16
     40const ReturnPC = 8
     41const CodeBlock = 0
     42
     43const ThisArgumentOffset = ArgumentCount + 8
    4444
    4545# Some value representation constants.
     
    373373    # Check stack height.
    374374    loadi CodeBlock::m_numCalleeRegisters[t1], t0
     375    addi 1, t0 # Account that local0 goes at slot -1
    375376    loadp CodeBlock::m_vm[t1], t2
    376377    loadp VM::interpreter[t2], t2
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm

    r157937 r158237  
    317317    negi t1
    318318    move cfr, t3
    319     addp 8, t3
    320319    loadi PayloadOffset + ArgumentCount[cfr], t2
    321320    addi CallFrameHeaderSlots, t2
     
    359358    negi t2
    360359.opEnterLoop:
    361     addi 1, t2
    362360    storei t0, TagOffset[cfr, t2, 8]
    363361    storei t1, PayloadOffset[cfr, t2, 8]
     362    addi 1, t2
    364363    btinz t2, .opEnterLoop
    365364.opEnterDone:
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm

    r157937 r158237  
    213213    negq t1
    214214    move cfr, t3
    215     addp 8, t3
    216215    loadi PayloadOffset + ArgumentCount[cfr], t2
    217216    addi CallFrameHeaderSlots, t2
     
    253252    sxi2q t2, t2
    254253.opEnterLoop:
     254    storeq t0, [cfr, t2, 8]
    255255    addq 1, t2
    256     storeq t0, [cfr, t2, 8]
    257256    btqnz t2, .opEnterLoop
    258257.opEnterDone:
  • trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h

    r156376 r158237  
    5454   
    5555    // This ensures enough space for the worst case scenario of zero arguments passed by the caller.
    56     if (!stack->grow(exec->registers() - newCodeBlock->numParameters() - newCodeBlock->m_numCalleeRegisters))
     56    if (!stack->grow(exec->registers() - newCodeBlock->numParameters() + virtualRegisterForLocal(newCodeBlock->m_numCalleeRegisters).offset()))
    5757        return -1;
    5858   
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r157764 r158237  
    145145protected:
    146146
    147     // Add one so we don't need to index with -1 to get current frame pointer.
    148     // An index of -1 is an error for some compilers.
    149     Register m_globalCallFrame[JSStack::CallFrameHeaderSize + 1];
     147    Register m_globalCallFrame[JSStack::CallFrameHeaderSize];
    150148
    151149    WriteBarrier<JSObject> m_globalThis;
Note: See TracChangeset for help on using the changeset viewer.