Ignore:
Timestamp:
Dec 9, 2011, 4:09:55 PM (13 years ago)
Author:
[email protected]
Message:

DFG's interpretation of rare case profiles should be frequency-based not count-based
https://bugs.webkit.org/show_bug.cgi?id=74170

Reviewed by Geoff Garen.

DFG optimizes for rare cases only when the rare case counter is above some threshold
and it also constitutes a large enough fraction of total function executions. Also
added some minor debug logic.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::CodeBlock):

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::likelyToTakeSlowCase):
(JSC::CodeBlock::couldTakeSlowCase):
(JSC::CodeBlock::likelyToTakeSpecialFastCase):
(JSC::CodeBlock::likelyToTakeDeepestSlowCase):
(JSC::CodeBlock::likelyToTakeAnySlowCase):
(JSC::CodeBlock::executionEntryCount):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::makeSafe):
(JSC::DFG::ByteCodeParser::makeDivSafe):
(JSC::DFG::ByteCodeParser::handleCall):
(JSC::DFG::ByteCodeParser::parseBlock):

  • dfg/DFGDriver.cpp:

(JSC::DFG::compile):

  • jit/JIT.cpp:

(JSC::JIT::privateCompile):

  • runtime/Heuristics.cpp:

(JSC::Heuristics::initializeHeuristics):

  • runtime/Heuristics.h:
File:
1 edited

Legend:

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

    r101457 r102489  
    14341434    , m_globalResolveInfos(other.m_globalResolveInfos)
    14351435#endif
     1436#if ENABLE(VALUE_PROFILER)
     1437    , m_executionEntryCount(0)
     1438#endif
    14361439    , m_jumpTargets(other.m_jumpTargets)
    14371440    , m_loopTargets(other.m_loopTargets)
     
    14821485    , m_source(sourceProvider)
    14831486    , m_sourceOffset(sourceOffset)
     1487#if ENABLE(VALUE_PROFILER)
     1488    , m_executionEntryCount(0)
     1489#endif
    14841490    , m_symbolTable(symTab)
    14851491    , m_alternative(alternative)
     
    22362242#endif
    22372243
    2238 #if ENABLE(VALUE_PROFILER)
    2239 void CodeBlock::resetRareCaseProfiles()
    2240 {
    2241     for (unsigned i = 0; i < numberOfRareCaseProfiles(); ++i)
    2242         rareCaseProfile(i)->m_counter = 0;
    2243     for (unsigned i = 0; i < numberOfSpecialFastCaseProfiles(); ++i)
    2244         specialFastCaseProfile(i)->m_counter = 0;
    2245 }
    2246 #endif
    2247 
    22482244#if ENABLE(VERBOSE_VALUE_PROFILE)
    22492245void CodeBlock::dumpValueProfiles()
Note: See TracChangeset for help on using the changeset viewer.