Changeset 107126 in webkit


Ignore:
Timestamp:
Feb 8, 2012 1:22:49 PM (12 years ago)
Author:
oliver@apple.com
Message:

updateTopCallframe in the baseline JIT doesn't provide enough information to the stubs
https://bugs.webkit.org/show_bug.cgi?id=78145

Reviewed by Gavin Barraclough.

Fix the updateTopCallFrame helper to store additional information
that becomes necessary when we are trying to provide more stack
frame information.

  • interpreter/CallFrame.h:

(JSC::ExecState::bytecodeOffsetForBaselineJIT):
(ExecState):

  • jit/JIT.cpp:

(JSC::JIT::privateCompile):

  • jit/JIT.h:

(JSC::JIT::compileGetByIdProto):
(JSC::JIT::compileGetByIdSelfList):
(JSC::JIT::compileGetByIdProtoList):
(JSC::JIT::compileGetByIdChainList):
(JSC::JIT::compileGetByIdChain):
(JSC::JIT::compilePutByIdTransition):
(JIT):

  • jit/JITInlineMethods.h:

(JSC::JIT::updateTopCallFrame):

Location:
trunk/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r107036 r107126  
     12012-02-08  Oliver Hunt  <oliver@apple.com>
     2
     3        updateTopCallframe in the baseline JIT doesn't provide enough information to the stubs
     4        https://bugs.webkit.org/show_bug.cgi?id=78145
     5
     6        Reviewed by Gavin Barraclough.
     7
     8        Fix the updateTopCallFrame helper to store additional information
     9        that becomes necessary when we are trying to provide more stack
     10        frame information.
     11
     12        * interpreter/CallFrame.h:
     13        (JSC::ExecState::bytecodeOffsetForBaselineJIT):
     14        (ExecState):
     15        * jit/JIT.cpp:
     16        (JSC::JIT::privateCompile):
     17        * jit/JIT.h:
     18        (JSC::JIT::compileGetByIdProto):
     19        (JSC::JIT::compileGetByIdSelfList):
     20        (JSC::JIT::compileGetByIdProtoList):
     21        (JSC::JIT::compileGetByIdChainList):
     22        (JSC::JIT::compileGetByIdChain):
     23        (JSC::JIT::compilePutByIdTransition):
     24        (JIT):
     25        * jit/JITInlineMethods.h:
     26        (JSC::JIT::updateTopCallFrame):
     27
    1282012-02-07  Robert Kroeger  <rjkroege@chromium.org>
    229
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.h

    r106067 r107126  
    107107#endif
    108108        AbstractPC abstractReturnPC(JSGlobalData& globalData) { return AbstractPC(globalData, this); }
     109        unsigned bytecodeOffsetForBaselineJIT() { return this[RegisterFile::ArgumentCount].tag(); }
     110
    109111#if ENABLE(DFG_JIT)
    110112        InlineCallFrame* inlineCallFrame() const { return this[RegisterFile::ReturnPC].asInlineCallFrame(); }
  • trunk/Source/JavaScriptCore/jit/JIT.cpp

    r106255 r107126  
    607607        branch32(AboveOrEqual, regT1, TrustedImm32(m_codeBlock->m_numParameters)).linkTo(beginLabel, this);
    608608
     609        m_bytecodeOffset = 0;
    609610        JITStubCall(this, m_codeBlock->m_isConstructor ? cti_op_construct_arityCheck : cti_op_call_arityCheck).call(callFrameRegister);
     611#if !ASSERT_DISABLED
     612        m_bytecodeOffset = (unsigned)-1; // Reset this, in order to guard its use with ASSERTs.
     613#endif
    610614
    611615        jump(beginLabel);
  • trunk/Source/JavaScriptCore/jit/JIT.h

    r106255 r107126  
    208208        {
    209209            JIT jit(globalData, codeBlock);
     210            jit.m_bytecodeOffset = stubInfo->bytecodeIndex;
    210211            jit.privateCompileGetByIdProto(stubInfo, structure, prototypeStructure, ident, slot, cachedOffset, returnAddress, callFrame);
    211212        }
     
    214215        {
    215216            JIT jit(globalData, codeBlock);
     217            jit.m_bytecodeOffset = stubInfo->bytecodeIndex;
    216218            jit.privateCompileGetByIdSelfList(stubInfo, polymorphicStructures, currentIndex, structure, ident, slot, cachedOffset);
    217219        }
     
    219221        {
    220222            JIT jit(globalData, codeBlock);
     223            jit.m_bytecodeOffset = stubInfo->bytecodeIndex;
    221224            jit.privateCompileGetByIdProtoList(stubInfo, prototypeStructureList, currentIndex, structure, prototypeStructure, ident, slot, cachedOffset, callFrame);
    222225        }
     
    224227        {
    225228            JIT jit(globalData, codeBlock);
     229            jit.m_bytecodeOffset = stubInfo->bytecodeIndex;
    226230            jit.privateCompileGetByIdChainList(stubInfo, prototypeStructureList, currentIndex, structure, chain, count, ident, slot, cachedOffset, callFrame);
    227231        }
     
    230234        {
    231235            JIT jit(globalData, codeBlock);
     236            jit.m_bytecodeOffset = stubInfo->bytecodeIndex;
    232237            jit.privateCompileGetByIdChain(stubInfo, structure, chain, count, ident, slot, cachedOffset, returnAddress, callFrame);
    233238        }
     
    236241        {
    237242            JIT jit(globalData, codeBlock);
     243            jit.m_bytecodeOffset = stubInfo->bytecodeIndex;
    238244            jit.privateCompilePutByIdTransition(stubInfo, oldStructure, newStructure, cachedOffset, chain, returnAddress, direct);
    239245        }
     
    399405        static const int patchOffsetGetByIdPutResult = 22;
    400406#if ENABLE(OPCODE_SAMPLING)
    401         static const int patchOffsetGetByIdSlowCaseCall = 37;
    402 #else
    403         static const int patchOffsetGetByIdSlowCaseCall = 33;
     407        static const int patchOffsetGetByIdSlowCaseCall = 44;
     408#else
     409        static const int patchOffsetGetByIdSlowCaseCall = 40;
    404410#endif
    405411        static const int patchOffsetOpCallCompareToJump = 6;
     
    422428        #error "OPCODE_SAMPLING is not yet supported"
    423429#else
    424         static const int patchOffsetGetByIdSlowCaseCall = 40;
     430        static const int patchOffsetGetByIdSlowCaseCall = 48;
    425431#endif
    426432        static const int patchOffsetOpCallCompareToJump = 12;
     
    459465        #error "OPCODE_SAMPLING is not yet supported"
    460466#else
    461         static const int patchOffsetGetByIdSlowCaseCall = 40;
     467        static const int patchOffsetGetByIdSlowCaseCall = 48;
    462468#endif
    463469        static const int patchOffsetOpCallCompareToJump = 16;
     
    635641        static const int patchOffsetGetByIdPutResult = 28;
    636642#if ENABLE(OPCODE_SAMPLING)
    637         static const int patchOffsetGetByIdSlowCaseCall = 64;
    638 #else
    639         static const int patchOffsetGetByIdSlowCaseCall = 54;
     643        static const int patchOffsetGetByIdSlowCaseCall = 72;
     644#else
     645        static const int patchOffsetGetByIdSlowCaseCall = 62;
    640646#endif
    641647        static const int patchOffsetOpCallCompareToJump = 9;
  • trunk/Source/JavaScriptCore/jit/JITInlineMethods.h

    r106676 r107126  
    265265ALWAYS_INLINE void JIT::updateTopCallFrame()
    266266{
     267    ASSERT(static_cast<int>(m_bytecodeOffset) >= 0);
     268    if (m_bytecodeOffset)
     269        store32(Imm32(m_bytecodeOffset + 1), intTagFor(RegisterFile::ArgumentCount));
    267270    storePtr(callFrameRegister, &m_globalData->topCallFrame);
    268271}
Note: See TracChangeset for help on using the changeset viewer.