Ignore:
Timestamp:
Dec 19, 2011, 5:11:36 PM (13 years ago)
Author:
[email protected]
Message:

It should be possible to change the value of an Options variable without recompiling the world
https://bugs.webkit.org/show_bug.cgi?id=74807

Reviewed by Gavin Barraclough.

  • runtime/Options.cpp:

(JSC::Options::initializeOptions):

  • runtime/Options.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/Options.cpp

    r102978 r103286  
    4545namespace JSC { namespace Options {
    4646
    47 #define DEFINE(type, cname, default_val) type cname;
    48 FOR_EACH_OPTION(DEFINE)
    49 #undef DEFINE
     47unsigned maximumOptimizationCandidateInstructionCount;
     48
     49unsigned maximumFunctionForCallInlineCandidateInstructionCount;
     50unsigned maximumFunctionForConstructInlineCandidateInstructionCount;
     51
     52unsigned maximumInliningDepth;
     53
     54int32_t executionCounterValueForOptimizeAfterWarmUp;
     55int32_t executionCounterValueForOptimizeAfterLongWarmUp;
     56int32_t executionCounterValueForDontOptimizeAnytimeSoon;
     57int32_t executionCounterValueForOptimizeSoon;
     58int32_t executionCounterValueForOptimizeNextInvocation;
     59
     60int32_t executionCounterIncrementForLoop;
     61int32_t executionCounterIncrementForReturn;
     62
     63unsigned desiredSpeculativeSuccessFailRatio;
     64
     65double likelyToTakeSlowCaseThreshold;
     66double couldTakeSlowCaseThreshold;
     67unsigned likelyToTakeSlowCaseMinimumCount;
     68unsigned couldTakeSlowCaseMinimumCount;
     69
     70double osrExitProminenceForFrequentExitSite;
     71
     72unsigned largeFailCountThresholdBase;
     73unsigned largeFailCountThresholdBaseForLoop;
     74
     75unsigned reoptimizationRetryCounterMax;
     76unsigned reoptimizationRetryCounterStep;
     77
     78unsigned minimumOptimizationDelay;
     79unsigned maximumOptimizationDelay;
     80double desiredProfileLivenessRate;
     81double desiredProfileFullnessRate;
     82
     83double doubleVoteRatioForDoubleFormat;
     84
     85unsigned minimumNumberOfScansBetweenRebalance;
     86unsigned gcMarkStackSegmentSize;
     87unsigned minimumNumberOfCellsToKeep;
     88unsigned maximumNumberOfSharedSegments;
     89unsigned sharedStackWakeupThreshold;
     90unsigned numberOfGCMarkers;
     91unsigned opaqueRootMergeThreshold;
    5092
    5193#if ENABLE(RUN_TIME_HEURISTICS)
     
    88130void initializeOptions()
    89131{
    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;
    102177#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
    119193    ASSERT(executionCounterValueForDontOptimizeAnytimeSoon <= executionCounterValueForOptimizeAfterLongWarmUp);
    120194    ASSERT(executionCounterValueForOptimizeAfterLongWarmUp <= executionCounterValueForOptimizeAfterWarmUp);
Note: See TracChangeset for help on using the changeset viewer.