Ignore:
Timestamp:
Aug 29, 2013, 1:27:15 PM (12 years ago)
Author:
[email protected]
Message:

CodeBlock's magic for scaling tier-up thresholds should be more reusable
https://bugs.webkit.org/show_bug.cgi?id=120486

Reviewed by Oliver Hunt.

Removed the counterValueForBlah() methods and exposed the reusable scaling logic
as a adjustedCounterValue() method.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::adjustedCounterValue):
(JSC::CodeBlock::optimizeAfterWarmUp):
(JSC::CodeBlock::optimizeAfterLongWarmUp):
(JSC::CodeBlock::optimizeSoon):

  • bytecode/CodeBlock.h:
  • dfg/DFGOSRExitCompilerCommon.cpp:

(JSC::DFG::handleExitCounts):

File:
1 edited

Legend:

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

    r154833 r154837  
    29632963}
    29642964
    2965 int32_t CodeBlock::counterValueForOptimizeAfterWarmUp()
     2965int32_t CodeBlock::adjustedCounterValue(int32_t desiredThreshold)
    29662966{
    29672967    return clipThreshold(
    2968         Options::thresholdForOptimizeAfterWarmUp() *
    2969         optimizationThresholdScalingFactor() *
    2970         (1 << reoptimizationRetryCounter()));
    2971 }
    2972 
    2973 int32_t CodeBlock::counterValueForOptimizeAfterLongWarmUp()
    2974 {
    2975     return clipThreshold(
    2976         Options::thresholdForOptimizeAfterLongWarmUp() *
    2977         optimizationThresholdScalingFactor() *
    2978         (1 << reoptimizationRetryCounter()));
    2979 }
    2980 
    2981 int32_t CodeBlock::counterValueForOptimizeSoon()
    2982 {
    2983     return clipThreshold(
    2984         Options::thresholdForOptimizeSoon() *
     2968        static_cast<double>(desiredThreshold) *
    29852969        optimizationThresholdScalingFactor() *
    29862970        (1 << reoptimizationRetryCounter()));
     
    30193003        dataLog(*this, ": Optimizing after warm-up.\n");
    30203004#if ENABLE(DFG_JIT)
    3021     m_jitExecuteCounter.setNewThreshold(counterValueForOptimizeAfterWarmUp(), this);
     3005    m_jitExecuteCounter.setNewThreshold(
     3006        adjustedCounterValue(Options::thresholdForOptimizeAfterWarmUp()), this);
    30223007#endif
    30233008}
     
    30283013        dataLog(*this, ": Optimizing after long warm-up.\n");
    30293014#if ENABLE(DFG_JIT)
    3030     m_jitExecuteCounter.setNewThreshold(counterValueForOptimizeAfterLongWarmUp(), this);
     3015    m_jitExecuteCounter.setNewThreshold(
     3016        adjustedCounterValue(Options::thresholdForOptimizeAfterLongWarmUp()), this);
    30313017#endif
    30323018}
     
    30373023        dataLog(*this, ": Optimizing soon.\n");
    30383024#if ENABLE(DFG_JIT)
    3039     m_jitExecuteCounter.setNewThreshold(counterValueForOptimizeSoon(), this);
     3025    m_jitExecuteCounter.setNewThreshold(
     3026        adjustedCounterValue(Options::thresholdForOptimizeSoon()), this);
    30403027#endif
    30413028}
Note: See TracChangeset for help on using the changeset viewer.