Ignore:
Timestamp:
Mar 22, 2014, 9:34:38 PM (11 years ago)
Author:
[email protected]
Message:

Call linking slow paths should be passed a CallLinkInfo* directly so that you can create a call IC without adding it to any CodeBlocks
https://bugs.webkit.org/show_bug.cgi?id=130644

Reviewed by Andreas Kling.

This is conceptually a really simple change but it involves the following:

  • The inline part of the call IC stuffs a pointer to the CallLinkInfo into regT2.


  • CodeBlock uses a Bag of CallLinkInfos instead of a Vector.


  • Remove the significance of a CallLinkInfo's index. This means that DFG::JITCode no longer has a vector of slow path counts that shadows the CallLinkInfo vector.


  • Make CallLinkInfo have its own slowPathCount, which counts actual slow path executions and not all relinking.


This makes planting JS->JS calls inside other inline caches or stubs a lot easier, since
the CallLinkInfo and the call IC slow paths no longer rely on the call being associated
with a op_call/op_construct instruction and a machine code return PC within such an
instruction.

  • bytecode/CallLinkInfo.h:

(JSC::getCallLinkInfoCodeOrigin):

  • bytecode/CallLinkStatus.cpp:

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

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

(JSC::CodeBlock::printCallOp):
(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::finalizeUnconditionally):
(JSC::CodeBlock::getCallLinkInfoMap):
(JSC::CodeBlock::getCallLinkInfoForBytecodeIndex):
(JSC::CodeBlock::addCallLinkInfo):
(JSC::CodeBlock::unlinkCalls):

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::stubInfoBegin):
(JSC::CodeBlock::stubInfoEnd):
(JSC::CodeBlock::callLinkInfosBegin):
(JSC::CodeBlock::callLinkInfosEnd):
(JSC::CodeBlock::byValInfo):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::handleCall):
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):

  • dfg/DFGJITCode.h:
  • dfg/DFGJITCompiler.cpp:

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

  • dfg/DFGJITCompiler.h:

(JSC::DFG::JITCompiler::addJSCall):
(JSC::DFG::JITCompiler::JSCallRecord::JSCallRecord):

  • dfg/DFGOSRExitCompilerCommon.cpp:

(JSC::DFG::reifyInlinedCallFrames):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT.h:
  • dfg/DFGSpeculativeJIT32_64.cpp:

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

  • dfg/DFGSpeculativeJIT64.cpp:

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

  • ftl/FTLCompile.cpp:

(JSC::FTL::fixFunctionBasedOnStackMaps):

  • ftl/FTLInlineCacheSize.cpp:

(JSC::FTL::sizeOfCall):

  • ftl/FTLJSCall.cpp:

(JSC::FTL::JSCall::JSCall):
(JSC::FTL::JSCall::emit):
(JSC::FTL::JSCall::link):

  • ftl/FTLJSCall.h:
  • jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
(JSC::JIT::privateCompile):

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

(JSC::JIT::compileOpCall):
(JSC::JIT::compileOpCallSlowCase):

  • jit/JITCall32_64.cpp:

(JSC::JIT::compileOpCall):
(JSC::JIT::compileOpCallSlowCase):

  • jit/JITOperations.cpp:
  • jit/JITOperations.h:

(JSC::operationLinkFor):
(JSC::operationVirtualFor):
(JSC::operationLinkClosureCallFor):

  • jit/Repatch.cpp:

(JSC::linkClosureCall):

  • jit/ThunkGenerators.cpp:

(JSC::slowPathFor):
(JSC::virtualForThunkGenerator):

  • tests/stress/eval-that-is-not-eval.js: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.h

    r164764 r166135  
    11/*
    2  * Copyright (C) 2011, 2013 Apple Inc. All rights reserved.
     2 * Copyright (C) 2011, 2013, 2014 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    227227    }
    228228
    229     void addJSCall(Call fastCall, Call slowCall, DataLabelPtr targetToCheck, CallLinkInfo::CallType callType, GPRReg callee, CodeOrigin codeOrigin)
    230     {
    231         m_jsCalls.append(JSCallRecord(fastCall, slowCall, targetToCheck, callType, callee, codeOrigin));
     229    void addJSCall(Call fastCall, Call slowCall, DataLabelPtr targetToCheck, CallLinkInfo* info)
     230    {
     231        m_jsCalls.append(JSCallRecord(fastCall, slowCall, targetToCheck, info));
    232232    }
    233233   
     
    354354
    355355    struct JSCallRecord {
    356         JSCallRecord(Call fastCall, Call slowCall, DataLabelPtr targetToCheck, CallLinkInfo::CallType callType, GPRReg callee, CodeOrigin codeOrigin)
     356        JSCallRecord(Call fastCall, Call slowCall, DataLabelPtr targetToCheck, CallLinkInfo* info)
    357357            : m_fastCall(fastCall)
    358358            , m_slowCall(slowCall)
    359359            , m_targetToCheck(targetToCheck)
    360             , m_callType(callType)
    361             , m_callee(callee)
    362             , m_codeOrigin(codeOrigin)
     360            , m_info(info)
    363361        {
    364362        }
     
    367365        Call m_slowCall;
    368366        DataLabelPtr m_targetToCheck;
    369         CallLinkInfo::CallType m_callType;
    370         GPRReg m_callee;
    371         CodeOrigin m_codeOrigin;
     367        CallLinkInfo* m_info;
    372368    };
    373369   
Note: See TracChangeset for help on using the changeset viewer.