Ignore:
Timestamp:
Jul 24, 2013, 9:02:03 PM (12 years ago)
Author:
[email protected]
Message:

fourthTier: Disambiguate between CallFrame bytecodeOffset and codeOriginIndex.
https://bugs.webkit.org/show_bug.cgi?id=117262.

Reviewed by Geoffrey Garen.

When writing to the ArgumentCount tag in CallFrame, we will set the high
bit if the written value is a codeOriginIndex.

(CodeOrigin):
(JSC::CodeOrigin::isHandle):
(JSC::CodeOrigin::encodeHandle):
(JSC::CodeOrigin::decodeHandle):

  • dfg/DFGJITCompiler.h:

(JSC::DFG::JITCompiler::beginCall):

  • dfg/DFGRepatch.cpp:

(JSC::DFG::tryBuildGetByIDList):

  • interpreter/CallFrame.cpp:

(JSC::CallFrame::locationAsBytecodeOffset):
(JSC::CallFrame::setLocationAsBytecodeOffset):
(JSC::CallFrame::currentVPC):
(JSC::CallFrame::setCurrentVPC):
(JSC::CallFrame::trueCallFrame):

  • interpreter/CallFrame.h:

(ExecState):
(JSC::ExecState::inlineCallFrame):

  • interpreter/CallFrameInlines.h: Added.

(JSC::CallFrame::hasLocationAsBytecodeOffset):
(JSC::CallFrame::hasLocationAsCodeOriginIndex):
(JSC::CallFrame::locationAsRawBits):
(JSC::CallFrame::setLocationAsRawBits):
(JSC::CallFrame::locationAsBytecodeOffset):
(JSC::CallFrame::setLocationAsBytecodeOffset):
(JSC::CallFrame::locationAsCodeOriginIndex):

  • interpreter/Interpreter.cpp:

(JSC::getBytecodeOffsetForCallFrame):
(JSC::getCallerInfo):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp

    r153183 r153209  
    2727#include "CallFrame.h"
    2828
     29#include "CallFrameInlines.h"
    2930#include "CodeBlock.h"
    3031#include "Interpreter.h"
     
    4243
    4344#if USE(JSVALUE32_64)
    44 unsigned CallFrame::bytecodeOffsetForNonDFGCode() const
     45unsigned CallFrame::locationAsBytecodeOffset() const
    4546{
    4647    ASSERT(codeBlock());
     48    ASSERT(hasLocationAsBytecodeOffset());
    4749    return currentVPC() - codeBlock()->instructions().begin();
    4850}
    4951
    50 void CallFrame::setBytecodeOffsetForNonDFGCode(unsigned offset)
     52void CallFrame::setLocationAsBytecodeOffset(unsigned offset)
    5153{
    5254    ASSERT(codeBlock());
     55    ASSERT(!CodeOrigin::isHandle(offset));
    5356    setCurrentVPC(codeBlock()->instructions().begin() + offset);
     57    ASSERT(hasLocationAsBytecodeOffset());
    5458}
    5559#else
    5660Instruction* CallFrame::currentVPC() const
    5761{
    58     return codeBlock()->instructions().begin() + bytecodeOffsetForNonDFGCode();
     62    return codeBlock()->instructions().begin() + locationAsBytecodeOffset();
    5963}
    6064void CallFrame::setCurrentVPC(Instruction* vpc)
    6165{
    62     setBytecodeOffsetForNonDFGCode(vpc - codeBlock()->instructions().begin());
     66    setLocationAsBytecodeOffset(vpc - codeBlock()->instructions().begin());
    6367}
    6468#endif
     
    120124        }
    121125    } else {
    122         unsigned index = codeOriginIndexForDFG();
     126        unsigned index = locationAsCodeOriginIndex();
    123127        ASSERT(machineCodeBlock->canGetCodeOrigin(index));
    124128        if (!machineCodeBlock->canGetCodeOrigin(index)) {
Note: See TracChangeset for help on using the changeset viewer.