Ignore:
Timestamp:
Jan 12, 2018, 4:36:37 PM (8 years ago)
Author:
[email protected]
Message:

Move ExitProfile to UnlinkedCodeBlock so it can be shared amongst CodeBlocks backed by the same UnlinkedCodeBlock
https://bugs.webkit.org/show_bug.cgi?id=181545

Reviewed by Michael Saboff.

This patch follows the theme of putting optimization profiling information on
UnlinkedCodeBlock. This allows the unlinked code cache to remember OSR exit data.
This often leads to the first compile of a CodeBlock, backed by an UnlinkedCodeBlock
pulled from the code cache, making better compilation decisions, usually
resulting in fewer exits, and fewer recompilations.

This is a 1% Speedometer progression in my testing.

  • bytecode/BytecodeDumper.cpp:

(JSC::BytecodeDumper<CodeBlock>::dumpProfilesForBytecodeOffset):

  • bytecode/CallLinkStatus.cpp:

(JSC::CallLinkStatus::computeFromLLInt):
(JSC::CallLinkStatus::computeFor):
(JSC::CallLinkStatus::computeExitSiteData):
(JSC::CallLinkStatus::computeDFGStatuses):

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

(JSC::CodeBlock::addFrequentExitSite): Deleted.
(JSC::CodeBlock::hasExitSite const): Deleted.
(JSC::CodeBlock::exitProfile): Deleted.

  • bytecode/DFGExitProfile.cpp:

(JSC::DFG::ExitProfile::add):
(JSC::DFG::QueryableExitProfile::initialize):

  • bytecode/DFGExitProfile.h:

(JSC::DFG::ExitProfile::hasExitSite const):

  • bytecode/GetByIdStatus.cpp:

(JSC::GetByIdStatus::hasExitSite):
(JSC::GetByIdStatus::computeFor):
(JSC::GetByIdStatus::computeForStubInfo):

  • bytecode/GetByIdStatus.h:
  • bytecode/PutByIdStatus.cpp:

(JSC::PutByIdStatus::hasExitSite):
(JSC::PutByIdStatus::computeFor):
(JSC::PutByIdStatus::computeForStubInfo):

  • bytecode/PutByIdStatus.h:
  • bytecode/UnlinkedCodeBlock.cpp:

(JSC::UnlinkedCodeBlock::livenessAnalysisSlow):

  • bytecode/UnlinkedCodeBlock.h:

(JSC::UnlinkedCodeBlock::hasExitSite const):
(JSC::UnlinkedCodeBlock::hasExitSite):
(JSC::UnlinkedCodeBlock::exitProfile):

  • dfg/DFGByteCodeParser.cpp:

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

  • dfg/DFGGraph.h:

(JSC::DFG::Graph::hasGlobalExitSite):
(JSC::DFG::Graph::hasExitSite):

  • dfg/DFGLICMPhase.cpp:

(JSC::DFG::LICMPhase::attemptHoist):

  • dfg/DFGOSRExitBase.cpp:

(JSC::DFG::OSRExitBase::considerAddingAsFrequentExitSiteSlow):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r226806 r226928  
    4141#include "ConcurrentJSLock.h"
    4242#include "DFGCommon.h"
    43 #include "DFGExitProfile.h"
    4443#include "DirectEvalCodeCache.h"
    4544#include "EvalExecutable.h"
     
    513512    }
    514513
    515     bool addFrequentExitSite(const DFG::FrequentExitSite& site)
    516     {
    517         ASSERT(JITCode::isBaselineCode(jitType()));
    518         ConcurrentJSLocker locker(m_lock);
    519         return m_exitProfile.add(locker, this, site);
    520     }
    521 
    522     bool hasExitSite(const ConcurrentJSLocker& locker, const DFG::FrequentExitSite& site) const
    523     {
    524         return m_exitProfile.hasExitSite(locker, site);
    525     }
    526     bool hasExitSite(const DFG::FrequentExitSite& site) const
    527     {
    528         ConcurrentJSLocker locker(m_lock);
    529         return hasExitSite(locker, site);
    530     }
    531 
    532     DFG::ExitProfile& exitProfile() { return m_exitProfile; }
    533 
    534514    CompressedLazyOperandValueProfileHolder& lazyOperandValueProfiles()
    535515    {
     
    10201000    // This is relevant to non-DFG code blocks that serve as the profiled code block
    10211001    // for DFG code blocks.
    1022     DFG::ExitProfile m_exitProfile;
    10231002    CompressedLazyOperandValueProfileHolder m_lazyOperandValueProfiles;
    10241003#endif
Note: See TracChangeset for help on using the changeset viewer.