Changeset 103286 in webkit for trunk/Source/JavaScriptCore/runtime/Options.cpp
- Timestamp:
- Dec 19, 2011, 5:11:36 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/Options.cpp
r102978 r103286 45 45 namespace JSC { namespace Options { 46 46 47 #define DEFINE(type, cname, default_val) type cname; 48 FOR_EACH_OPTION(DEFINE) 49 #undef DEFINE 47 unsigned maximumOptimizationCandidateInstructionCount; 48 49 unsigned maximumFunctionForCallInlineCandidateInstructionCount; 50 unsigned maximumFunctionForConstructInlineCandidateInstructionCount; 51 52 unsigned maximumInliningDepth; 53 54 int32_t executionCounterValueForOptimizeAfterWarmUp; 55 int32_t executionCounterValueForOptimizeAfterLongWarmUp; 56 int32_t executionCounterValueForDontOptimizeAnytimeSoon; 57 int32_t executionCounterValueForOptimizeSoon; 58 int32_t executionCounterValueForOptimizeNextInvocation; 59 60 int32_t executionCounterIncrementForLoop; 61 int32_t executionCounterIncrementForReturn; 62 63 unsigned desiredSpeculativeSuccessFailRatio; 64 65 double likelyToTakeSlowCaseThreshold; 66 double couldTakeSlowCaseThreshold; 67 unsigned likelyToTakeSlowCaseMinimumCount; 68 unsigned couldTakeSlowCaseMinimumCount; 69 70 double osrExitProminenceForFrequentExitSite; 71 72 unsigned largeFailCountThresholdBase; 73 unsigned largeFailCountThresholdBaseForLoop; 74 75 unsigned reoptimizationRetryCounterMax; 76 unsigned reoptimizationRetryCounterStep; 77 78 unsigned minimumOptimizationDelay; 79 unsigned maximumOptimizationDelay; 80 double desiredProfileLivenessRate; 81 double desiredProfileFullnessRate; 82 83 double doubleVoteRatioForDoubleFormat; 84 85 unsigned minimumNumberOfScansBetweenRebalance; 86 unsigned gcMarkStackSegmentSize; 87 unsigned minimumNumberOfCellsToKeep; 88 unsigned maximumNumberOfSharedSegments; 89 unsigned sharedStackWakeupThreshold; 90 unsigned numberOfGCMarkers; 91 unsigned opaqueRootMergeThreshold; 50 92 51 93 #if ENABLE(RUN_TIME_HEURISTICS) … … 88 130 void initializeOptions() 89 131 { 90 #define INIT(type, cname, default_val) SET(cname, default_val); 91 FOR_EACH_OPTION(INIT) 92 #undef INIT 93 94 // Now we initialize heuristics whose defaults are not known at 95 // compile-time. 96 97 if (!gcMarkStackSegmentSize) 98 gcMarkStackSegmentSize = pageSize(); 99 100 if (!numberOfGCMarkers) { 101 int cpusToUse = 1; 132 SET(maximumOptimizationCandidateInstructionCount, 1000); 133 134 SET(maximumFunctionForCallInlineCandidateInstructionCount, 150); 135 SET(maximumFunctionForConstructInlineCandidateInstructionCount, 80); 136 137 SET(maximumInliningDepth, 5); 138 139 SET(executionCounterValueForOptimizeAfterWarmUp, -1000); 140 SET(executionCounterValueForOptimizeAfterLongWarmUp, -5000); 141 SET(executionCounterValueForDontOptimizeAnytimeSoon, std::numeric_limits<int32_t>::min()); 142 SET(executionCounterValueForOptimizeSoon, -1000); 143 SET(executionCounterValueForOptimizeNextInvocation, 0); 144 145 SET(executionCounterIncrementForLoop, 1); 146 SET(executionCounterIncrementForReturn, 15); 147 148 SET(desiredSpeculativeSuccessFailRatio, 6); 149 150 SET(likelyToTakeSlowCaseThreshold, 0.15); 151 SET(couldTakeSlowCaseThreshold, 0.05); // Shouldn't be zero because some ops will spuriously take slow case, for example for linking or caching. 152 SET(likelyToTakeSlowCaseMinimumCount, 100); 153 SET(couldTakeSlowCaseMinimumCount, 10); 154 155 SET(osrExitProminenceForFrequentExitSite, 0.3); 156 157 SET(largeFailCountThresholdBase, 20); 158 SET(largeFailCountThresholdBaseForLoop, 1); 159 160 SET(reoptimizationRetryCounterStep, 1); 161 162 SET(minimumOptimizationDelay, 1); 163 SET(maximumOptimizationDelay, 5); 164 SET(desiredProfileLivenessRate, 0.75); 165 SET(desiredProfileFullnessRate, 0.35); 166 167 SET(doubleVoteRatioForDoubleFormat, 2); 168 169 SET(minimumNumberOfScansBetweenRebalance, 10000); 170 SET(gcMarkStackSegmentSize, pageSize()); 171 SET(minimumNumberOfCellsToKeep, 10); 172 SET(maximumNumberOfSharedSegments, 3); 173 SET(sharedStackWakeupThreshold, 1); 174 SET(opaqueRootMergeThreshold, 1000); 175 176 int cpusToUse = 1; 102 177 #if OS(DARWIN) && ENABLE(PARALLEL_GC) 103 int name[2]; 104 size_t valueSize = sizeof(cpusToUse); 105 name[0] = CTL_HW; 106 name[1] = HW_AVAILCPU; 107 sysctl(name, 2, &cpusToUse, &valueSize, 0, 0); 108 #endif 109 // We don't scale so well beyond 4. 110 if (cpusToUse > 4) 111 cpusToUse = 4; 112 // Be paranoid, it is the OS we're dealing with, after all. 113 if (cpusToUse < 1) 114 cpusToUse = 1; 115 116 numberOfGCMarkers = cpusToUse; 117 } 118 178 int name[2]; 179 size_t valueSize = sizeof(cpusToUse); 180 name[0] = CTL_HW; 181 name[1] = HW_AVAILCPU; 182 sysctl(name, 2, &cpusToUse, &valueSize, 0, 0); 183 #endif 184 // We don't scale so well beyond 4. 185 if (cpusToUse > 4) 186 cpusToUse = 4; 187 // Be paranoid, it is the OS we're dealing with, after all. 188 if (cpusToUse < 1) 189 cpusToUse = 1; 190 191 SET(numberOfGCMarkers, cpusToUse); 192 119 193 ASSERT(executionCounterValueForDontOptimizeAnytimeSoon <= executionCounterValueForOptimizeAfterLongWarmUp); 120 194 ASSERT(executionCounterValueForOptimizeAfterLongWarmUp <= executionCounterValueForOptimizeAfterWarmUp);
Note:
See TracChangeset
for help on using the changeset viewer.