Changeset 102917 in webkit for trunk/Source/JavaScriptCore/bytecode
- Timestamp:
- Dec 15, 2011, 4:01:30 AM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore/bytecode
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r102694 r102917 2204 2204 #endif 2205 2205 2206 if (m_optimizationDelayCounter >= Heuristics::maximumOptimizationDelay)2206 if (m_optimizationDelayCounter >= Options::maximumOptimizationDelay) 2207 2207 return true; 2208 2208 … … 2230 2230 #endif 2231 2231 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) 2235 2235 return true; 2236 2236 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r102723 r102917 38 38 #include "DFGOSRExit.h" 39 39 #include "EvalCodeCache.h" 40 #include " Heuristics.h"40 #include "Options.h" 41 41 #include "Instruction.h" 42 42 #include "JITCode.h" … … 684 684 { 685 685 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; 687 687 } 688 688 … … 690 690 { 691 691 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; 693 693 } 694 694 … … 708 708 { 709 709 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; 711 711 } 712 712 … … 716 716 unsigned specialFastCaseCount = specialFastCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter; 717 717 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; 719 719 } 720 720 … … 724 724 unsigned specialFastCaseCount = specialFastCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter; 725 725 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; 727 727 } 728 728 … … 934 934 unsigned reoptimizationRetryCounter() const 935 935 { 936 ASSERT(m_reoptimizationRetryCounter <= Heuristics::reoptimizationRetryCounterMax);936 ASSERT(m_reoptimizationRetryCounter <= Options::reoptimizationRetryCounterMax); 937 937 return m_reoptimizationRetryCounter; 938 938 } … … 941 941 { 942 942 m_reoptimizationRetryCounter++; 943 if (m_reoptimizationRetryCounter > Heuristics::reoptimizationRetryCounterMax)944 m_reoptimizationRetryCounter = Heuristics::reoptimizationRetryCounterMax;943 if (m_reoptimizationRetryCounter > Options::reoptimizationRetryCounterMax) 944 m_reoptimizationRetryCounter = Options::reoptimizationRetryCounterMax; 945 945 } 946 946 947 947 int32_t counterValueForOptimizeAfterWarmUp() 948 948 { 949 return Heuristics::executionCounterValueForOptimizeAfterWarmUp << reoptimizationRetryCounter();949 return Options::executionCounterValueForOptimizeAfterWarmUp << reoptimizationRetryCounter(); 950 950 } 951 951 952 952 int32_t counterValueForOptimizeAfterLongWarmUp() 953 953 { 954 return Heuristics::executionCounterValueForOptimizeAfterLongWarmUp << reoptimizationRetryCounter();954 return Options::executionCounterValueForOptimizeAfterLongWarmUp << reoptimizationRetryCounter(); 955 955 } 956 956 … … 971 971 void optimizeNextInvocation() 972 972 { 973 m_executeCounter = Heuristics::executionCounterValueForOptimizeNextInvocation;973 m_executeCounter = Options::executionCounterValueForOptimizeNextInvocation; 974 974 } 975 975 … … 981 981 void dontOptimizeAnytimeSoon() 982 982 { 983 m_executeCounter = Heuristics::executionCounterValueForDontOptimizeAnytimeSoon;983 m_executeCounter = Options::executionCounterValueForDontOptimizeAnytimeSoon; 984 984 } 985 985 … … 1022 1022 void optimizeSoon() 1023 1023 { 1024 m_executeCounter = Heuristics::executionCounterValueForOptimizeSoon << reoptimizationRetryCounter();1024 m_executeCounter = Options::executionCounterValueForOptimizeSoon << reoptimizationRetryCounter(); 1025 1025 } 1026 1026 … … 1056 1056 #if ENABLE(JIT) 1057 1057 // 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(); } 1060 1060 1061 1061 bool shouldReoptimizeNow() 1062 1062 { 1063 return Heuristics::desiredSpeculativeSuccessFailRatio * speculativeFailCounter() >= speculativeSuccessCounter() && speculativeFailCounter() >= largeFailCountThreshold();1063 return Options::desiredSpeculativeSuccessFailRatio * speculativeFailCounter() >= speculativeSuccessCounter() && speculativeFailCounter() >= largeFailCountThreshold(); 1064 1064 } 1065 1065 1066 1066 bool shouldReoptimizeFromLoopNow() 1067 1067 { 1068 return Heuristics::desiredSpeculativeSuccessFailRatio * speculativeFailCounter() >= speculativeSuccessCounter() && speculativeFailCounter() >= largeFailCountThresholdForLoop();1068 return Options::desiredSpeculativeSuccessFailRatio * speculativeFailCounter() >= speculativeSuccessCounter() && speculativeFailCounter() >= largeFailCountThresholdForLoop(); 1069 1069 } 1070 1070 #endif
Note:
See TracChangeset
for help on using the changeset viewer.