Ignore:
Timestamp:
Jun 24, 2015, 3:37:30 PM (10 years ago)
Author:
[email protected]
Message:

Refactor CallLinkInfo from a struct to a class
https://bugs.webkit.org/show_bug.cgi?id=146292

Rubber stamped by Filip Pizlo.

Refactored CallLinkInfo from a struct to a class with proper accessors and made all the
data elements private.

Done in preparation for fixing https://bugs.webkit.org/show_bug.cgi?id=146285.

  • bytecode/CallLinkInfo.cpp:

(JSC::CallLinkInfo::clearStub):
(JSC::CallLinkInfo::unlink):
(JSC::CallLinkInfo::visitWeak):

  • bytecode/CallLinkInfo.h:

(JSC::CallLinkInfo::callTypeFor):
(JSC::CallLinkInfo::CallLinkInfo):
(JSC::CallLinkInfo::~CallLinkInfo):
(JSC::CallLinkInfo::specializationKindFor):
(JSC::CallLinkInfo::specializationKind):
(JSC::CallLinkInfo::isLinked):
(JSC::CallLinkInfo::setUpCall):
(JSC::CallLinkInfo::setCallLocations):
(JSC::CallLinkInfo::setUpCallFromFTL):
(JSC::CallLinkInfo::callReturnLocation):
(JSC::CallLinkInfo::hotPathBegin):
(JSC::CallLinkInfo::hotPathOther):
(JSC::CallLinkInfo::setCallee):
(JSC::CallLinkInfo::clearCallee):
(JSC::CallLinkInfo::callee):
(JSC::CallLinkInfo::setLastSeenCallee):
(JSC::CallLinkInfo::clearLastSeenCallee):
(JSC::CallLinkInfo::lastSeenCallee):
(JSC::CallLinkInfo::haveLastSeenCallee):
(JSC::CallLinkInfo::setStub):
(JSC::CallLinkInfo::stub):
(JSC::CallLinkInfo::seenOnce):
(JSC::CallLinkInfo::clearSeen):
(JSC::CallLinkInfo::setSeen):
(JSC::CallLinkInfo::hasSeenClosure):
(JSC::CallLinkInfo::setHasSeenClosure):
(JSC::CallLinkInfo::clearedByGC):
(JSC::CallLinkInfo::setCallType):
(JSC::CallLinkInfo::callType):
(JSC::CallLinkInfo::addressOfMaxNumArguments):
(JSC::CallLinkInfo::maxNumArguments):
(JSC::CallLinkInfo::offsetOfSlowPathCount):
(JSC::CallLinkInfo::setCalleeGPR):
(JSC::CallLinkInfo::calleeGPR):
(JSC::CallLinkInfo::slowPathCount):
(JSC::CallLinkInfo::setCodeOrigin):
(JSC::CallLinkInfo::codeOrigin):
(JSC::getCallLinkInfoCodeOrigin):

  • bytecode/CallLinkStatus.cpp:

(JSC::CallLinkStatus::computeFor):
(JSC::CallLinkStatus::computeFromCallLinkInfo):
(JSC::CallLinkStatus::computeDFGStatuses):

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

(JSC::CodeBlock::printCallOp):
(JSC::CodeBlock::getCallLinkInfoForBytecodeIndex):

  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::link):

  • dfg/DFGOSRExitCompilerCommon.cpp:

(JSC::DFG::reifyInlinedCallFrames):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::emitCall):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::emitCall):

  • ftl/FTLJSCallBase.cpp:

(JSC::FTL::JSCallBase::link):

  • jit/AccessorCallJITStubRoutine.h:
  • jit/JIT.cpp:

(JSC::JIT::privateCompile):

  • jit/JIT.h:
  • jit/JITCall.cpp:

(JSC::JIT::compileSetupVarargsFrame):
(JSC::JIT::compileOpCall):

  • jit/JITCall32_64.cpp:

(JSC::JIT::compileSetupVarargsFrame):
(JSC::JIT::compileOpCall):

  • jit/JITOperations.cpp:
  • jit/PolymorphicCallStubRoutine.cpp:

(JSC::PolymorphicCallNode::unlink):
(JSC::PolymorphicCallNode::clearCallLinkInfo):

  • jit/PolymorphicCallStubRoutine.h:
  • jit/Repatch.cpp:

(JSC::generateByIdStub):
(JSC::linkSlowFor):
(JSC::linkFor):
(JSC::revertCall):
(JSC::unlinkFor):
(JSC::linkPolymorphicCall):

  • jit/ThunkGenerators.cpp:

(JSC::virtualForThunkGenerator):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.cpp

    r185161 r185930  
    3838namespace JSC {
    3939
     40void CallLinkInfo::clearStub()
     41{
     42    if (!stub())
     43        return;
     44
     45    m_stub.clear();
     46}
     47
    4048void CallLinkInfo::unlink(RepatchBuffer& repatchBuffer)
    4149{
     
    4957    unlinkFor(
    5058        repatchBuffer, *this,
    51         (callType == Construct || callType == ConstructVarargs)? CodeForConstruct : CodeForCall,
    52         isFTL ? MustPreserveRegisters : RegisterPreservationNotRequired);
     59        (m_callType == Construct || m_callType == ConstructVarargs)? CodeForConstruct : CodeForCall,
     60        m_isFTL ? MustPreserveRegisters : RegisterPreservationNotRequired);
    5361
    5462    // It will be on a list if the callee has a code block.
     
    6169    auto handleSpecificCallee = [&] (JSFunction* callee) {
    6270        if (Heap::isMarked(callee->executable()))
    63             hasSeenClosure = true;
     71            m_hasSeenClosure = true;
    6472        else
    65             clearedByGC = true;
     73            m_clearedByGC = true;
    6674    };
    6775   
    6876    if (isLinked()) {
    69         if (stub) {
    70             if (!stub->visitWeak(repatchBuffer)) {
     77        if (stub()) {
     78            if (!stub()->visitWeak(repatchBuffer)) {
    7179                if (Options::verboseOSR()) {
    7280                    dataLog(
    7381                        "Clearing closure call from ", *repatchBuffer.codeBlock(), " to ",
    74                         listDump(stub->variants()), ", stub routine ", RawPointer(stub.get()),
     82                        listDump(stub()->variants()), ", stub routine ", RawPointer(stub()),
    7583                        ".\n");
    7684                }
    7785                unlink(repatchBuffer);
    78                 clearedByGC = true;
     86                m_clearedByGC = true;
    7987            }
    80         } else if (!Heap::isMarked(callee.get())) {
     88        } else if (!Heap::isMarked(m_callee.get())) {
    8189            if (Options::verboseOSR()) {
    8290                dataLog(
    8391                    "Clearing call from ", *repatchBuffer.codeBlock(), " to ",
    84                     RawPointer(callee.get()), " (",
    85                     callee.get()->executable()->hashFor(specializationKind()),
     92                    RawPointer(m_callee.get()), " (",
     93                    m_callee.get()->executable()->hashFor(specializationKind()),
    8694                    ").\n");
    8795            }
    88             handleSpecificCallee(callee.get());
     96            handleSpecificCallee(m_callee.get());
    8997            unlink(repatchBuffer);
    9098        }
    9199    }
    92     if (!!lastSeenCallee && !Heap::isMarked(lastSeenCallee.get())) {
    93         handleSpecificCallee(lastSeenCallee.get());
    94         lastSeenCallee.clear();
     100    if (haveLastSeenCallee() && !Heap::isMarked(lastSeenCallee())) {
     101        handleSpecificCallee(lastSeenCallee());
     102        clearLastSeenCallee();
    95103    }
    96104}
Note: See TracChangeset for help on using the changeset viewer.