Changeset 102917 in webkit


Ignore:
Timestamp:
Dec 15, 2011 4:01:30 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Andy Wingo <wingo@igalia.com> 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
Files:
22 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r102694 r102917  
    136136    runtime/GCActivityCallback.cpp
    137137    runtime/GetterSetter.cpp
    138     runtime/Heuristics.cpp
    139138    runtime/Identifier.cpp
    140139    runtime/InitializeThreading.cpp
     
    173172    runtime/ObjectPrototype.cpp
    174173    runtime/Operations.cpp
     174    runtime/Options.cpp
    175175    runtime/PropertyDescriptor.cpp
    176176    runtime/PropertyNameArray.cpp
  • trunk/Source/JavaScriptCore/ChangeLog

    r102885 r102917  
     12011-12-15  Andy Wingo  <wingo@igalia.com>
     2
     3        Rename JSC::Heuristics to JSC::Options
     4        https://bugs.webkit.org/show_bug.cgi?id=72889
     5
     6        Reviewed by Filip Pizlo.
     7
     8        * runtime/Options.cpp: Renamed from Source/JavaScriptCore/runtime/Heuristics.cpp.
     9        * runtime/Options.h: Renamed from Source/JavaScriptCore/runtime/Heuristics.h.
     10
     11        * CMakeLists.txt:
     12        * GNUmakefile.list.am:
     13        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
     14        * JavaScriptCore.xcodeproj/project.pbxproj:
     15        * Target.pri:
     16        * bytecode/CodeBlock.cpp:
     17        (JSC::CodeBlock::shouldOptimizeNow):
     18        * bytecode/CodeBlock.h:
     19        (JSC::CodeBlock::likelyToTakeSlowCase):
     20        (JSC::CodeBlock::couldTakeSlowCase):
     21        (JSC::CodeBlock::likelyToTakeSpecialFastCase):
     22        (JSC::CodeBlock::likelyToTakeDeepestSlowCase):
     23        (JSC::CodeBlock::likelyToTakeAnySlowCase):
     24        (JSC::CodeBlock::reoptimizationRetryCounter):
     25        (JSC::CodeBlock::countReoptimization):
     26        (JSC::CodeBlock::counterValueForOptimizeAfterWarmUp):
     27        (JSC::CodeBlock::counterValueForOptimizeAfterLongWarmUp):
     28        (JSC::CodeBlock::optimizeNextInvocation):
     29        (JSC::CodeBlock::dontOptimizeAnytimeSoon):
     30        (JSC::CodeBlock::optimizeSoon):
     31        (JSC::CodeBlock::largeFailCountThreshold):
     32        (JSC::CodeBlock::largeFailCountThresholdForLoop):
     33        (JSC::CodeBlock::shouldReoptimizeNow):
     34        (JSC::CodeBlock::shouldReoptimizeFromLoopNow):
     35        * dfg/DFGByteCodeParser.cpp:
     36        (JSC::DFG::ByteCodeParser::handleInlining):
     37        * dfg/DFGCapabilities.h:
     38        (JSC::DFG::mightCompileEval):
     39        (JSC::DFG::mightCompileProgram):
     40        (JSC::DFG::mightCompileFunctionForCall):
     41        (JSC::DFG::mightCompileFunctionForConstruct):
     42        (JSC::DFG::mightInlineFunctionForCall):
     43        (JSC::DFG::mightInlineFunctionForConstruct):
     44        * dfg/DFGOSRExit.cpp:
     45        (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
     46        * dfg/DFGOSRExitCompiler32_64.cpp:
     47        (JSC::DFG::OSRExitCompiler::compileExit):
     48        * dfg/DFGOSRExitCompiler64.cpp:
     49        (JSC::DFG::OSRExitCompiler::compileExit):
     50        * dfg/DFGVariableAccessData.h:
     51        (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
     52        * heap/MarkStack.cpp:
     53        (JSC::MarkStackSegmentAllocator::allocate):
     54        (JSC::MarkStackSegmentAllocator::shrinkReserve):
     55        (JSC::MarkStackArray::MarkStackArray):
     56        (JSC::MarkStackArray::donateSomeCellsTo):
     57        (JSC::MarkStackArray::stealSomeCellsFrom):
     58        (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
     59        (JSC::SlotVisitor::donateSlow):
     60        (JSC::SlotVisitor::drain):
     61        (JSC::SlotVisitor::drainFromShared):
     62        * heap/MarkStack.h:
     63        (JSC::MarkStack::mergeOpaqueRootsIfProfitable):
     64        (JSC::MarkStack::addOpaqueRoot):
     65        (JSC::MarkStackArray::canDonateSomeCells):
     66        * heap/SlotVisitor.h:
     67        (JSC::SlotVisitor::donate):
     68        * jit/JIT.cpp:
     69        (JSC::JIT::emitOptimizationCheck):
     70        * runtime/InitializeThreading.cpp:
     71        (JSC::initializeThreadingOnce): Adapt callers and build systems.
     72
     73        * testRegExp.cpp:
     74        (CommandLine::CommandLine):
     75        * jsc.cpp:
     76        (CommandLine::CommandLine):
     77        Rename from Options, to avoid name conflict.
     78
    1792011-12-14  Sam Weinig  <sam@webkit.org>
    280
  • trunk/Source/JavaScriptCore/GNUmakefile.list.am

    r102730 r102917  
    359359        Source/JavaScriptCore/runtime/GetterSetter.cpp \
    360360        Source/JavaScriptCore/runtime/GetterSetter.h \
    361         Source/JavaScriptCore/runtime/Heuristics.cpp \
    362         Source/JavaScriptCore/runtime/Heuristics.h \
    363361        Source/JavaScriptCore/runtime/Identifier.cpp \
    364362        Source/JavaScriptCore/runtime/Identifier.h \
     
    440438        Source/JavaScriptCore/runtime/Operations.cpp \
    441439        Source/JavaScriptCore/runtime/Operations.h \
     440        Source/JavaScriptCore/runtime/Options.cpp \
     441        Source/JavaScriptCore/runtime/Options.h \
    442442        Source/JavaScriptCore/runtime/PropertyDescriptor.cpp \
    443443        Source/JavaScriptCore/runtime/PropertyDescriptor.h \
  • trunk/Source/JavaScriptCore/JavaScriptCore.exp

    r102578 r102917  
    101101_WTFReportFatalError
    102102__ZN14OpaqueJSString6createERKN3JSC7UStringE
     103__ZN3JSC7Options17numberOfGCMarkersE
     104__ZN3JSC7Options24opaqueRootMergeThresholdE
    103105__ZN3JSC10HandleHeap12writeBarrierEPNS_7JSValueERKS1_
    104106__ZN3JSC10HandleHeap4growEv
    105 __ZN3JSC10Heuristics17numberOfGCMarkersE
    106 __ZN3JSC10Heuristics24opaqueRootMergeThresholdE
    107107__ZN3JSC10Identifier11addSlowCaseEPNS_12JSGlobalDataEPN3WTF10StringImplE
    108108__ZN3JSC10Identifier11addSlowCaseEPNS_9ExecStateEPN3WTF10StringImplE
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj

    r100556 r102917  
    735735                        </File>
    736736                        <File
    737                                 RelativePath="..\..\runtime\Heuristics.cpp"
    738                                 >
    739                         </File>
    740                         <File
    741                                 RelativePath="..\..\runtime\Heuristics.h"
    742                                 >
    743                         </File>
    744                         <File
    745737                                RelativePath="..\..\runtime\Identifier.cpp"
    746738                                >
     
    10361028                        <File
    10371029                                RelativePath="..\..\runtime\Operations.h"
     1030                                >
     1031                        </File>
     1032                        <File
     1033                                RelativePath="..\..\runtime\Options.cpp"
     1034                                >
     1035                        </File>
     1036                        <File
     1037                                RelativePath="..\..\runtime\Options.h"
    10381038                                >
    10391039                        </File>
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r102849 r102917  
    107107                0FD82E9014207A5F00179C94 /* ValueProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD82E8E14207A5100179C94 /* ValueProfile.cpp */; };
    108108                0FD82F4B142806A100179C94 /* BitVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD82F491428069200179C94 /* BitVector.h */; settings = {ATTRIBUTES = (Private, ); }; };
    109                 0FE228ED1436AB2700196C48 /* Heuristics.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE228EB1436AB2300196C48 /* Heuristics.h */; settings = {ATTRIBUTES = (Private, ); }; };
    110                 0FE228EE1436AB2C00196C48 /* Heuristics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE228EA1436AB2300196C48 /* Heuristics.cpp */; };
     109                0FE228ED1436AB2700196C48 /* Options.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE228EB1436AB2300196C48 /* Options.h */; settings = {ATTRIBUTES = (Private, ); }; };
     110                0FE228EE1436AB2C00196C48 /* Options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE228EA1436AB2300196C48 /* Options.cpp */; };
    111111                0FFF4BB4143955E900655BC0 /* DFGStructureSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFF4BB2143955E600655BC0 /* DFGStructureSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
    112112                1400067712A6F7830064D123 /* OSAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1400067612A6F7830064D123 /* OSAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    893893                0FD82E8E14207A5100179C94 /* ValueProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ValueProfile.cpp; sourceTree = "<group>"; };
    894894                0FD82F491428069200179C94 /* BitVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitVector.h; sourceTree = "<group>"; };
    895                 0FE228EA1436AB2300196C48 /* Heuristics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Heuristics.cpp; sourceTree = "<group>"; };
    896                 0FE228EB1436AB2300196C48 /* Heuristics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Heuristics.h; sourceTree = "<group>"; };
     895                0FE228EA1436AB2300196C48 /* Options.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Options.cpp; sourceTree = "<group>"; };
     896                0FE228EB1436AB2300196C48 /* Options.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Options.h; sourceTree = "<group>"; };
    897897                0FFF4BB2143955E600655BC0 /* DFGStructureSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGStructureSet.h; path = dfg/DFGStructureSet.h; sourceTree = "<group>"; };
    898898                1400067612A6F7830064D123 /* OSAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSAllocator.h; sourceTree = "<group>"; };
     
    21172117                        isa = PBXGroup;
    21182118                        children = (
     2119                                0F7700911402FF280078EB39 /* SamplingCounter.cpp */,
     2120                                0F77008E1402FDD60078EB39 /* SamplingCounter.h */,
    21192121                                BCF605110E203EF800B9A64D /* ArgList.cpp */,
    21202122                                BCF605120E203EF800B9A64D /* ArgList.h */,
     
    21722174                                BC02E9B80E184545000F9297 /* GetterSetter.cpp */,
    21732175                                BC337BDE0E1AF0B80076918A /* GetterSetter.h */,
    2174                                 0FE228EA1436AB2300196C48 /* Heuristics.cpp */,
    2175                                 0FE228EB1436AB2300196C48 /* Heuristics.h */,
    21762176                                933A349D038AE80F008635CE /* Identifier.cpp */,
    21772177                                933A349A038AE7C6008635CE /* Identifier.h */,
     
    22532253                                F692A8770255597D01FF60F7 /* Operations.cpp */,
    22542254                                F692A8780255597D01FF60F7 /* Operations.h */,
     2255                                0FE228EA1436AB2300196C48 /* Options.cpp */,
     2256                                0FE228EB1436AB2300196C48 /* Options.h */,
    22552257                                A7FB60A3103F7DC20017A286 /* PropertyDescriptor.cpp */,
    22562258                                A7FB604B103F5EAB0017A286 /* PropertyDescriptor.h */,
     
    29632965                                A7521E131429169A003C8D0C /* CardSet.h in Headers */,
    29642966                                0FD52AAE143035A00026DC9F /* UnionFind.h in Headers */,
    2965                                 0FE228ED1436AB2700196C48 /* Heuristics.h in Headers */,
     2967                                0FE228ED1436AB2700196C48 /* Options.h in Headers */,
    29662968                                0FFF4BB4143955E900655BC0 /* DFGStructureSet.h in Headers */,
    29672969                                8604F505143CE1C200B295F5 /* JSGlobalThis.h in Headers */,
     
    35243526                                86880F1F14328BB900B08D42 /* DFGSpeculativeJIT32_64.cpp in Sources */,
    35253527                                86880F4D14353B2100B08D42 /* DFGSpeculativeJIT64.cpp in Sources */,
    3526                                 0FE228EE1436AB2C00196C48 /* Heuristics.cpp in Sources */,
     3528                                0FE228EE1436AB2C00196C48 /* Options.cpp in Sources */,
    35273529                                0F620179143FCD480068B77C /* DFGAbstractState.cpp in Sources */,
    35283530                                BC3C4CA01458F5450025FB62 /* JSGlobalThis.cpp in Sources */,
  • trunk/Source/JavaScriptCore/Target.pri

    r102694 r102917  
    150150    runtime/GCActivityCallback.cpp \
    151151    runtime/GetterSetter.cpp \
    152     runtime/Heuristics.cpp \
     152    runtime/Options.cpp \
    153153    runtime/Identifier.cpp \
    154154    runtime/InitializeThreading.cpp \
  • 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
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r102694 r102917  
    980980    for (InlineStackEntry* entry = m_inlineStackTop; entry; entry = entry->m_caller) {
    981981        ++depth;
    982         if (depth >= Heuristics::maximumInliningDepth)
     982        if (depth >= Options::maximumInliningDepth)
    983983            return false; // Depth exceeded.
    984984       
  • trunk/Source/JavaScriptCore/dfg/DFGCapabilities.h

    r102167 r102917  
    3030#include "DFGNode.h"
    3131#include "Executable.h"
    32 #include "Heuristics.h"
     32#include "Options.h"
    3333#include "Interpreter.h"
    3434#include <wtf/Platform.h>
     
    4141inline bool mightCompileEval(CodeBlock* codeBlock)
    4242{
    43     return codeBlock->instructionCount() <= Heuristics::maximumOptimizationCandidateInstructionCount;
     43    return codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount;
    4444}
    4545inline bool mightCompileProgram(CodeBlock* codeBlock)
    4646{
    47     return codeBlock->instructionCount() <= Heuristics::maximumOptimizationCandidateInstructionCount;
     47    return codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount;
    4848}
    4949inline bool mightCompileFunctionForCall(CodeBlock* codeBlock)
    5050{
    51     return codeBlock->instructionCount() <= Heuristics::maximumOptimizationCandidateInstructionCount;
     51    return codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount;
    5252}
    5353inline bool mightCompileFunctionForConstruct(CodeBlock* codeBlock)
    5454{
    55     return codeBlock->instructionCount() <= Heuristics::maximumOptimizationCandidateInstructionCount;
     55    return codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount;
    5656}
    5757
    5858inline bool mightInlineFunctionForCall(CodeBlock* codeBlock)
    5959{
    60     return codeBlock->instructionCount() <= Heuristics::maximumFunctionForCallInlineCandidateInstructionCount;
     60    return codeBlock->instructionCount() <= Options::maximumFunctionForCallInlineCandidateInstructionCount;
    6161}
    6262inline bool mightInlineFunctionForConstruct(CodeBlock* codeBlock)
    6363{
    64     return codeBlock->instructionCount() <= Heuristics::maximumFunctionForConstructInlineCandidateInstructionCount;
     64    return codeBlock->instructionCount() <= Options::maximumFunctionForConstructInlineCandidateInstructionCount;
    6565}
    6666
  • trunk/Source/JavaScriptCore/dfg/DFGOSRExit.cpp

    r102694 r102917  
    6767bool OSRExit::considerAddingAsFrequentExitSiteSlow(CodeBlock* dfgCodeBlock, CodeBlock* profiledCodeBlock)
    6868{
    69     if (static_cast<double>(m_count) / dfgCodeBlock->speculativeFailCounter() <= Heuristics::osrExitProminenceForFrequentExitSite)
     69    if (static_cast<double>(m_count) / dfgCodeBlock->speculativeFailCounter() <= Options::osrExitProminenceForFrequentExitSite)
    7070        return false;
    7171   
  • trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp

    r102723 r102917  
    517517   
    518518    AssemblyHelpers::Jump fewFails = m_jit.branch32(AssemblyHelpers::BelowOrEqual, GPRInfo::regT2, AssemblyHelpers::Imm32(m_jit.codeBlock()->largeFailCountThreshold()));
    519     m_jit.mul32(AssemblyHelpers::Imm32(Heuristics::desiredSpeculativeSuccessFailRatio), GPRInfo::regT2, GPRInfo::regT2);
     519    m_jit.mul32(AssemblyHelpers::Imm32(Options::desiredSpeculativeSuccessFailRatio), GPRInfo::regT2, GPRInfo::regT2);
    520520   
    521521    AssemblyHelpers::Jump lowFailRate = m_jit.branch32(AssemblyHelpers::BelowOrEqual, GPRInfo::regT2, GPRInfo::regT1);
    522522   
    523523    // Reoptimize as soon as possible.
    524     m_jit.store32(AssemblyHelpers::Imm32(Heuristics::executionCounterValueForOptimizeNextInvocation), AssemblyHelpers::Address(GPRInfo::regT0, CodeBlock::offsetOfExecuteCounter()));
     524    m_jit.store32(AssemblyHelpers::Imm32(Options::executionCounterValueForOptimizeNextInvocation), AssemblyHelpers::Address(GPRInfo::regT0, CodeBlock::offsetOfExecuteCounter()));
    525525    AssemblyHelpers::Jump doneAdjusting = m_jit.jump();
    526526   
  • trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp

    r102743 r102917  
    545545   
    546546    AssemblyHelpers::Jump fewFails = m_jit.branch32(AssemblyHelpers::BelowOrEqual, GPRInfo::regT2, AssemblyHelpers::Imm32(m_jit.codeBlock()->largeFailCountThreshold()));
    547     m_jit.mul32(AssemblyHelpers::Imm32(Heuristics::desiredSpeculativeSuccessFailRatio), GPRInfo::regT2, GPRInfo::regT2);
     547    m_jit.mul32(AssemblyHelpers::Imm32(Options::desiredSpeculativeSuccessFailRatio), GPRInfo::regT2, GPRInfo::regT2);
    548548   
    549549    AssemblyHelpers::Jump lowFailRate = m_jit.branch32(AssemblyHelpers::BelowOrEqual, GPRInfo::regT2, GPRInfo::regT1);
    550550   
    551551    // Reoptimize as soon as possible.
    552     m_jit.store32(AssemblyHelpers::Imm32(Heuristics::executionCounterValueForOptimizeNextInvocation), AssemblyHelpers::Address(GPRInfo::regT0, CodeBlock::offsetOfExecuteCounter()));
     552    m_jit.store32(AssemblyHelpers::Imm32(Options::executionCounterValueForOptimizeNextInvocation), AssemblyHelpers::Address(GPRInfo::regT0, CodeBlock::offsetOfExecuteCounter()));
    553553    AssemblyHelpers::Jump doneAdjusting = m_jit.jump();
    554554   
  • trunk/Source/JavaScriptCore/dfg/DFGVariableAccessData.h

    r102743 r102917  
    9898    {
    9999        // FIXME: make this work for arguments.
    100         return !operandIsArgument(operand()) && ((isNumberPrediction(prediction()) && doubleVoteRatio() >= Heuristics::doubleVoteRatioForDoubleFormat) || isDoublePrediction(prediction()));
     100        return !operandIsArgument(operand()) && ((isNumberPrediction(prediction()) && doubleVoteRatio() >= Options::doubleVoteRatioForDoubleFormat) || isDoublePrediction(prediction()));
    101101    }
    102102   
  • trunk/Source/JavaScriptCore/heap/MarkStack.cpp

    r100242 r102917  
    2929#include "ConservativeRoots.h"
    3030#include "Heap.h"
    31 #include "Heuristics.h"
     31#include "Options.h"
    3232#include "JSArray.h"
    3333#include "JSCell.h"
     
    6161    }
    6262
    63     return static_cast<MarkStackSegment*>(OSAllocator::reserveAndCommit(Heuristics::gcMarkStackSegmentSize));
     63    return static_cast<MarkStackSegment*>(OSAllocator::reserveAndCommit(Options::gcMarkStackSegmentSize));
    6464}
    6565
     
    8282        MarkStackSegment* toFree = segments;
    8383        segments = segments->m_previous;
    84         OSAllocator::decommitAndRelease(toFree, Heuristics::gcMarkStackSegmentSize);
     84        OSAllocator::decommitAndRelease(toFree, Options::gcMarkStackSegmentSize);
    8585    }
    8686}
     
    8888MarkStackArray::MarkStackArray(MarkStackSegmentAllocator& allocator)
    8989    : m_allocator(allocator)
    90     , m_segmentCapacity(MarkStackSegment::capacityFromSize(Heuristics::gcMarkStackSegmentSize))
     90    , m_segmentCapacity(MarkStackSegment::capacityFromSize(Options::gcMarkStackSegmentSize))
    9191    , m_top(0)
    9292    , m_numberOfPreviousSegments(0)
     
    146146       
    147147    // Fast check: see if the other mark stack already has enough segments.
    148     if (other.m_numberOfPreviousSegments + 1 >= Heuristics::maximumNumberOfSharedSegments)
     148    if (other.m_numberOfPreviousSegments + 1 >= Options::maximumNumberOfSharedSegments)
    149149        return false;
    150150       
    151     size_t numberOfCellsToKeep = Heuristics::minimumNumberOfCellsToKeep;
     151    size_t numberOfCellsToKeep = Options::minimumNumberOfCellsToKeep;
    152152    ASSERT(m_top > numberOfCellsToKeep || m_topSegment->m_previous);
    153153       
     
    210210       
    211211    // Otherwise drain 1/Nth of the shared array where N is the number of
    212     // workers, or Heuristics::minimumNumberOfCellsToKeep, whichever is bigger.
    213     size_t numberOfCellsToSteal = std::max((size_t)Heuristics::minimumNumberOfCellsToKeep, other.size() / Heuristics::numberOfGCMarkers);
     212    // workers, or Options::minimumNumberOfCellsToKeep, whichever is bigger.
     213    size_t numberOfCellsToSteal = std::max((size_t)Options::minimumNumberOfCellsToKeep, other.size() / Options::numberOfGCMarkers);
    214214    while (numberOfCellsToSteal-- > 0 && other.canRemoveLast())
    215215        append(other.removeLast());
     
    239239{
    240240#if ENABLE(PARALLEL_GC)
    241     for (unsigned i = 1; i < Heuristics::numberOfGCMarkers; ++i) {
     241    for (unsigned i = 1; i < Options::numberOfGCMarkers; ++i) {
    242242        m_markingThreads.append(createThread(markingThreadStartFunc, this, "JavaScriptCore::Marking"));
    243243        ASSERT(m_markingThreads.last());
     
    330330        // Only wake up threads if the shared stack is big enough; otherwise assume that
    331331        // it's more profitable for us to just scan this ourselves later.
    332         if (m_shared.m_sharedMarkStack.size() >= Heuristics::sharedStackWakeupThreshold)
     332        if (m_shared.m_sharedMarkStack.size() >= Options::sharedStackWakeupThreshold)
    333333            m_shared.m_markingCondition.broadcast();
    334334    }
     
    344344
    345345#if ENABLE(PARALLEL_GC)
    346     if (Heuristics::numberOfGCMarkers > 1) {
     346    if (Options::numberOfGCMarkers > 1) {
    347347        while (!m_stack.isEmpty()) {
    348348            m_stack.refill();
    349             for (unsigned countdown = Heuristics::minimumNumberOfScansBetweenRebalance; m_stack.canRemoveLast() && countdown--;)
     349            for (unsigned countdown = Options::minimumNumberOfScansBetweenRebalance; m_stack.canRemoveLast() && countdown--;)
    350350                visitChildren(*this, m_stack.removeLast(), jsFinalObjectVPtr, jsArrayVPtr, jsStringVPtr);
    351351            donateKnownParallel();
     
    368368    ASSERT(m_isInParallelMode);
    369369   
    370     ASSERT(Heuristics::numberOfGCMarkers);
     370    ASSERT(Options::numberOfGCMarkers);
    371371   
    372372    bool shouldBeParallel;
    373373
    374374#if ENABLE(PARALLEL_GC)
    375     shouldBeParallel = Heuristics::numberOfGCMarkers > 1;
     375    shouldBeParallel = Options::numberOfGCMarkers > 1;
    376376#else
    377     ASSERT(Heuristics::numberOfGCMarkers == 1);
     377    ASSERT(Options::numberOfGCMarkers == 1);
    378378    shouldBeParallel = false;
    379379#endif
  • trunk/Source/JavaScriptCore/heap/MarkStack.h

    r100242 r102917  
    2828
    2929#include "HandleTypes.h"
    30 #include "Heuristics.h"
     30#include "Options.h"
    3131#include "JSValue.h"
    3232#include "Register.h"
     
    262262        void mergeOpaqueRootsIfProfitable()
    263263        {
    264             if (static_cast<unsigned>(m_opaqueRoots.size()) < Heuristics::opaqueRootMergeThreshold)
     264            if (static_cast<unsigned>(m_opaqueRoots.size()) < Options::opaqueRootMergeThreshold)
    265265                return;
    266266            mergeOpaqueRoots();
     
    310310    {
    311311#if ENABLE(PARALLEL_GC)
    312         if (Heuristics::numberOfGCMarkers == 1) {
     312        if (Options::numberOfGCMarkers == 1) {
    313313            // Put directly into the shared HashSet.
    314314            m_shared.m_opaqueRoots.add(root);
     
    376376    inline bool MarkStackArray::canDonateSomeCells()
    377377    {
    378         size_t numberOfCellsToKeep = Heuristics::minimumNumberOfCellsToKeep;
     378        size_t numberOfCellsToKeep = Options::minimumNumberOfCellsToKeep;
    379379        // Another check: see if we have enough cells to warrant donation.
    380380        if (m_top <= numberOfCellsToKeep) {
  • trunk/Source/JavaScriptCore/heap/SlotVisitor.h

    r99898 r102917  
    4141    {
    4242        ASSERT(m_isInParallelMode);
    43         if (Heuristics::numberOfGCMarkers == 1)
     43        if (Options::numberOfGCMarkers == 1)
    4444            return;
    4545       
  • trunk/Source/JavaScriptCore/jit/JIT.cpp

    r102545 r102917  
    100100        return;
    101101   
    102     Jump skipOptimize = branchAdd32(Signed, TrustedImm32(kind == LoopOptimizationCheck ? Heuristics::executionCounterIncrementForLoop : Heuristics::executionCounterIncrementForReturn), AbsoluteAddress(m_codeBlock->addressOfExecuteCounter()));
     102    Jump skipOptimize = branchAdd32(Signed, TrustedImm32(kind == LoopOptimizationCheck ? Options::executionCounterIncrementForLoop : Options::executionCounterIncrementForReturn), AbsoluteAddress(m_codeBlock->addressOfExecuteCounter()));
    103103    JITStubCall stubCall(this, kind == LoopOptimizationCheck ? cti_optimize_from_loop : cti_optimize_from_ret);
    104104    if (kind == LoopOptimizationCheck)
  • trunk/Source/JavaScriptCore/jsc.cpp

    r99392 r102917  
    103103};
    104104
    105 struct Options {
    106     Options()
     105struct CommandLine {
     106    CommandLine()
    107107        : interactive(false)
    108108        , dump(false)
     
    549549}
    550550
    551 static void parseArguments(int argc, char** argv, Options& options, JSGlobalData* globalData)
     551static void parseArguments(int argc, char** argv, CommandLine& options, JSGlobalData* globalData)
    552552{
    553553    int i = 1;
     
    603603    JSLock lock(SilenceAssertionsOnly);
    604604
    605     Options options;
     605    CommandLine options;
    606606    parseArguments(argc, argv, options, globalData);
    607607
  • trunk/Source/JavaScriptCore/runtime/InitializeThreading.cpp

    r100205 r102917  
    3232#include "ExecutableAllocator.h"
    3333#include "Heap.h"
    34 #include "Heuristics.h"
     34#include "Options.h"
    3535#include "Identifier.h"
    3636#include "JSDateMath.h"
     
    5454    WTF::double_conversion::initialize();
    5555    WTF::initializeThreading();
    56     Heuristics::initializeHeuristics();
     56    Options::initializeOptions();
    5757#if ENABLE(WRITE_BARRIER_PROFILING)
    5858    WriteBarrierCounters::initialize();
  • trunk/Source/JavaScriptCore/runtime/Options.cpp

    r102916 r102917  
    2525
    2626#include "config.h"
    27 #include "Heuristics.h"
     27#include "Options.h"
     28
     29#include <limits>
    2830#include <wtf/PageBlock.h>
    29 
    30 #include <limits>
    3131
    3232#if OS(DARWIN) && ENABLE(PARALLEL_GC)
     
    4343#endif
    4444
    45 namespace JSC { namespace Heuristics {
     45namespace JSC { namespace Options {
    4646
    4747unsigned maximumOptimizationCandidateInstructionCount;
     
    128128#endif
    129129
    130 void initializeHeuristics()
     130void initializeOptions()
    131131{
    132132    SET(maximumOptimizationCandidateInstructionCount, 1000);
     
    210210}
    211211
    212 } } // namespace JSC::Heuristics
    213 
    214 
     212} } // namespace JSC::Options
     213
     214
  • trunk/Source/JavaScriptCore/runtime/Options.h

    r102916 r102917  
    2424 */
    2525
    26 #ifndef Heuristics_h
    27 #define Heuristics_h
     26#ifndef Options_h
     27#define Options_h
    2828
    2929#include <stdint.h>
    3030
    31 namespace JSC { namespace Heuristics {
     31namespace JSC { namespace Options {
    3232
    3333extern unsigned maximumOptimizationCandidateInstructionCount;
     
    7777extern unsigned opaqueRootMergeThreshold;
    7878
    79 void initializeHeuristics();
     79void initializeOptions();
    8080
    81 } } // namespace JSC::Heuristics
     81} } // namespace JSC::Options
    8282
    83 #endif // Heuristics_h
     83#endif // Options_h
    8484
  • trunk/Source/JavaScriptCore/testRegExp.cpp

    r99223 r102917  
    5757static void cleanupGlobalData(JSGlobalData*);
    5858
    59 struct Options {
    60     Options()
     59struct CommandLine {
     60    CommandLine()
    6161        : interactive(false)
    6262        , verbose(false)
     
    491491}
    492492
    493 static void parseArguments(int argc, char** argv, Options& options, JSGlobalData* globalData)
     493static void parseArguments(int argc, char** argv, CommandLine& options, JSGlobalData* globalData)
    494494{
    495495    int i = 1;
     
    512512    JSLock lock(SilenceAssertionsOnly);
    513513
    514     Options options;
     514    CommandLine options;
    515515    parseArguments(argc, argv, options, globalData);
    516516
Note: See TracChangeset for help on using the changeset viewer.