Ignore:
Timestamp:
Dec 15, 2011, 4:01:30 AM (13 years ago)
Author:
[email protected]
Message:

Rename JSC::Heuristics to JSC::Options
https://bugs.webkit.org/show_bug.cgi?id=72889

Patch by Andy Wingo <[email protected]> on 2011-12-15
Reviewed by Filip Pizlo.

  • runtime/Options.cpp: Renamed from Source/JavaScriptCore/runtime/Heuristics.cpp.
  • runtime/Options.h: Renamed from Source/JavaScriptCore/runtime/Heuristics.h.
  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Target.pri:
  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::shouldOptimizeNow):

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::likelyToTakeSlowCase):
(JSC::CodeBlock::couldTakeSlowCase):
(JSC::CodeBlock::likelyToTakeSpecialFastCase):
(JSC::CodeBlock::likelyToTakeDeepestSlowCase):
(JSC::CodeBlock::likelyToTakeAnySlowCase):
(JSC::CodeBlock::reoptimizationRetryCounter):
(JSC::CodeBlock::countReoptimization):
(JSC::CodeBlock::counterValueForOptimizeAfterWarmUp):
(JSC::CodeBlock::counterValueForOptimizeAfterLongWarmUp):
(JSC::CodeBlock::optimizeNextInvocation):
(JSC::CodeBlock::dontOptimizeAnytimeSoon):
(JSC::CodeBlock::optimizeSoon):
(JSC::CodeBlock::largeFailCountThreshold):
(JSC::CodeBlock::largeFailCountThresholdForLoop):
(JSC::CodeBlock::shouldReoptimizeNow):
(JSC::CodeBlock::shouldReoptimizeFromLoopNow):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::handleInlining):

  • dfg/DFGCapabilities.h:

(JSC::DFG::mightCompileEval):
(JSC::DFG::mightCompileProgram):
(JSC::DFG::mightCompileFunctionForCall):
(JSC::DFG::mightCompileFunctionForConstruct):
(JSC::DFG::mightInlineFunctionForCall):
(JSC::DFG::mightInlineFunctionForConstruct):

  • dfg/DFGOSRExit.cpp:

(JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):

  • dfg/DFGOSRExitCompiler32_64.cpp:

(JSC::DFG::OSRExitCompiler::compileExit):

  • dfg/DFGOSRExitCompiler64.cpp:

(JSC::DFG::OSRExitCompiler::compileExit):

  • dfg/DFGVariableAccessData.h:

(JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):

  • heap/MarkStack.cpp:

(JSC::MarkStackSegmentAllocator::allocate):
(JSC::MarkStackSegmentAllocator::shrinkReserve):
(JSC::MarkStackArray::MarkStackArray):
(JSC::MarkStackArray::donateSomeCellsTo):
(JSC::MarkStackArray::stealSomeCellsFrom):
(JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
(JSC::SlotVisitor::donateSlow):
(JSC::SlotVisitor::drain):
(JSC::SlotVisitor::drainFromShared):

  • heap/MarkStack.h:

(JSC::MarkStack::mergeOpaqueRootsIfProfitable):
(JSC::MarkStack::addOpaqueRoot):
(JSC::MarkStackArray::canDonateSomeCells):

  • heap/SlotVisitor.h:

(JSC::SlotVisitor::donate):

  • jit/JIT.cpp:

(JSC::JIT::emitOptimizationCheck):

  • runtime/InitializeThreading.cpp:

(JSC::initializeThreadingOnce): Adapt callers and build systems.

  • testRegExp.cpp:

(CommandLine::CommandLine):

  • jsc.cpp:

(CommandLine::CommandLine):
Rename from Options, to avoid name conflict.

Location:
trunk/Source/JavaScriptCore/bytecode
Files:
2 edited

Legend:

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

    r102694 r102917  
    22042204#endif
    22052205
    2206     if (m_optimizationDelayCounter >= Heuristics::maximumOptimizationDelay)
     2206    if (m_optimizationDelayCounter >= Options::maximumOptimizationDelay)
    22072207        return true;
    22082208   
     
    22302230#endif
    22312231
    2232     if ((!numberOfNonArgumentValueProfiles || (double)numberOfLiveNonArgumentValueProfiles / numberOfNonArgumentValueProfiles >= Heuristics::desiredProfileLivenessRate)
    2233         && (!numberOfValueProfiles() || (double)numberOfSamplesInProfiles / ValueProfile::numberOfBuckets / numberOfValueProfiles() >= Heuristics::desiredProfileFullnessRate)
    2234         && static_cast<unsigned>(m_optimizationDelayCounter) + 1 >= Heuristics::minimumOptimizationDelay)
     2232    if ((!numberOfNonArgumentValueProfiles || (double)numberOfLiveNonArgumentValueProfiles / numberOfNonArgumentValueProfiles >= Options::desiredProfileLivenessRate)
     2233        && (!numberOfValueProfiles() || (double)numberOfSamplesInProfiles / ValueProfile::numberOfBuckets / numberOfValueProfiles() >= Options::desiredProfileFullnessRate)
     2234        && static_cast<unsigned>(m_optimizationDelayCounter) + 1 >= Options::minimumOptimizationDelay)
    22352235        return true;
    22362236   
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r102723 r102917  
    3838#include "DFGOSRExit.h"
    3939#include "EvalCodeCache.h"
    40 #include "Heuristics.h"
     40#include "Options.h"
    4141#include "Instruction.h"
    4242#include "JITCode.h"
     
    684684        {
    685685            unsigned value = rareCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter;
    686             return value >= Heuristics::likelyToTakeSlowCaseMinimumCount && static_cast<double>(value) / m_executionEntryCount >= Heuristics::likelyToTakeSlowCaseThreshold;
     686            return value >= Options::likelyToTakeSlowCaseMinimumCount && static_cast<double>(value) / m_executionEntryCount >= Options::likelyToTakeSlowCaseThreshold;
    687687        }
    688688       
     
    690690        {
    691691            unsigned value = rareCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter;
    692             return value >= Heuristics::couldTakeSlowCaseMinimumCount && static_cast<double>(value) / m_executionEntryCount >= Heuristics::couldTakeSlowCaseThreshold;
     692            return value >= Options::couldTakeSlowCaseMinimumCount && static_cast<double>(value) / m_executionEntryCount >= Options::couldTakeSlowCaseThreshold;
    693693        }
    694694       
     
    708708        {
    709709            unsigned specialFastCaseCount = specialFastCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter;
    710             return specialFastCaseCount >= Heuristics::likelyToTakeSlowCaseMinimumCount && static_cast<double>(specialFastCaseCount) / m_executionEntryCount >= Heuristics::likelyToTakeSlowCaseThreshold;
     710            return specialFastCaseCount >= Options::likelyToTakeSlowCaseMinimumCount && static_cast<double>(specialFastCaseCount) / m_executionEntryCount >= Options::likelyToTakeSlowCaseThreshold;
    711711        }
    712712       
     
    716716            unsigned specialFastCaseCount = specialFastCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter;
    717717            unsigned value = slowCaseCount - specialFastCaseCount;
    718             return value >= Heuristics::likelyToTakeSlowCaseMinimumCount && static_cast<double>(value) / m_executionEntryCount >= Heuristics::likelyToTakeSlowCaseThreshold;
     718            return value >= Options::likelyToTakeSlowCaseMinimumCount && static_cast<double>(value) / m_executionEntryCount >= Options::likelyToTakeSlowCaseThreshold;
    719719        }
    720720       
     
    724724            unsigned specialFastCaseCount = specialFastCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter;
    725725            unsigned value = slowCaseCount + specialFastCaseCount;
    726             return value >= Heuristics::likelyToTakeSlowCaseMinimumCount && static_cast<double>(value) / m_executionEntryCount >= Heuristics::likelyToTakeSlowCaseThreshold;
     726            return value >= Options::likelyToTakeSlowCaseMinimumCount && static_cast<double>(value) / m_executionEntryCount >= Options::likelyToTakeSlowCaseThreshold;
    727727        }
    728728       
     
    934934        unsigned reoptimizationRetryCounter() const
    935935        {
    936             ASSERT(m_reoptimizationRetryCounter <= Heuristics::reoptimizationRetryCounterMax);
     936            ASSERT(m_reoptimizationRetryCounter <= Options::reoptimizationRetryCounterMax);
    937937            return m_reoptimizationRetryCounter;
    938938        }
     
    941941        {
    942942            m_reoptimizationRetryCounter++;
    943             if (m_reoptimizationRetryCounter > Heuristics::reoptimizationRetryCounterMax)
    944                 m_reoptimizationRetryCounter = Heuristics::reoptimizationRetryCounterMax;
     943            if (m_reoptimizationRetryCounter > Options::reoptimizationRetryCounterMax)
     944                m_reoptimizationRetryCounter = Options::reoptimizationRetryCounterMax;
    945945        }
    946946       
    947947        int32_t counterValueForOptimizeAfterWarmUp()
    948948        {
    949             return Heuristics::executionCounterValueForOptimizeAfterWarmUp << reoptimizationRetryCounter();
     949            return Options::executionCounterValueForOptimizeAfterWarmUp << reoptimizationRetryCounter();
    950950        }
    951951       
    952952        int32_t counterValueForOptimizeAfterLongWarmUp()
    953953        {
    954             return Heuristics::executionCounterValueForOptimizeAfterLongWarmUp << reoptimizationRetryCounter();
     954            return Options::executionCounterValueForOptimizeAfterLongWarmUp << reoptimizationRetryCounter();
    955955        }
    956956       
     
    971971        void optimizeNextInvocation()
    972972        {
    973             m_executeCounter = Heuristics::executionCounterValueForOptimizeNextInvocation;
     973            m_executeCounter = Options::executionCounterValueForOptimizeNextInvocation;
    974974        }
    975975       
     
    981981        void dontOptimizeAnytimeSoon()
    982982        {
    983             m_executeCounter = Heuristics::executionCounterValueForDontOptimizeAnytimeSoon;
     983            m_executeCounter = Options::executionCounterValueForDontOptimizeAnytimeSoon;
    984984        }
    985985       
     
    10221022        void optimizeSoon()
    10231023        {
    1024             m_executeCounter = Heuristics::executionCounterValueForOptimizeSoon << reoptimizationRetryCounter();
     1024            m_executeCounter = Options::executionCounterValueForOptimizeSoon << reoptimizationRetryCounter();
    10251025        }
    10261026       
     
    10561056#if ENABLE(JIT)
    10571057        // The number of failures that triggers the use of the ratio.
    1058         unsigned largeFailCountThreshold() { return Heuristics::largeFailCountThresholdBase << baselineVersion()->reoptimizationRetryCounter(); }
    1059         unsigned largeFailCountThresholdForLoop() { return Heuristics::largeFailCountThresholdBaseForLoop << baselineVersion()->reoptimizationRetryCounter(); }
     1058        unsigned largeFailCountThreshold() { return Options::largeFailCountThresholdBase << baselineVersion()->reoptimizationRetryCounter(); }
     1059        unsigned largeFailCountThresholdForLoop() { return Options::largeFailCountThresholdBaseForLoop << baselineVersion()->reoptimizationRetryCounter(); }
    10601060
    10611061        bool shouldReoptimizeNow()
    10621062        {
    1063             return Heuristics::desiredSpeculativeSuccessFailRatio * speculativeFailCounter() >= speculativeSuccessCounter() && speculativeFailCounter() >= largeFailCountThreshold();
     1063            return Options::desiredSpeculativeSuccessFailRatio * speculativeFailCounter() >= speculativeSuccessCounter() && speculativeFailCounter() >= largeFailCountThreshold();
    10641064        }
    10651065
    10661066        bool shouldReoptimizeFromLoopNow()
    10671067        {
    1068             return Heuristics::desiredSpeculativeSuccessFailRatio * speculativeFailCounter() >= speculativeSuccessCounter() && speculativeFailCounter() >= largeFailCountThresholdForLoop();
     1068            return Options::desiredSpeculativeSuccessFailRatio * speculativeFailCounter() >= speculativeSuccessCounter() && speculativeFailCounter() >= largeFailCountThresholdForLoop();
    10691069        }
    10701070#endif
Note: See TracChangeset for help on using the changeset viewer.