Changeset 102917 in webkit
- Timestamp:
- Dec 15, 2011 4:01:30 AM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 22 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r102694 r102917 136 136 runtime/GCActivityCallback.cpp 137 137 runtime/GetterSetter.cpp 138 runtime/Heuristics.cpp139 138 runtime/Identifier.cpp 140 139 runtime/InitializeThreading.cpp … … 173 172 runtime/ObjectPrototype.cpp 174 173 runtime/Operations.cpp 174 runtime/Options.cpp 175 175 runtime/PropertyDescriptor.cpp 176 176 runtime/PropertyNameArray.cpp -
trunk/Source/JavaScriptCore/ChangeLog
r102885 r102917 1 2011-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 1 79 2011-12-14 Sam Weinig <sam@webkit.org> 2 80 -
trunk/Source/JavaScriptCore/GNUmakefile.list.am
r102730 r102917 359 359 Source/JavaScriptCore/runtime/GetterSetter.cpp \ 360 360 Source/JavaScriptCore/runtime/GetterSetter.h \ 361 Source/JavaScriptCore/runtime/Heuristics.cpp \362 Source/JavaScriptCore/runtime/Heuristics.h \363 361 Source/JavaScriptCore/runtime/Identifier.cpp \ 364 362 Source/JavaScriptCore/runtime/Identifier.h \ … … 440 438 Source/JavaScriptCore/runtime/Operations.cpp \ 441 439 Source/JavaScriptCore/runtime/Operations.h \ 440 Source/JavaScriptCore/runtime/Options.cpp \ 441 Source/JavaScriptCore/runtime/Options.h \ 442 442 Source/JavaScriptCore/runtime/PropertyDescriptor.cpp \ 443 443 Source/JavaScriptCore/runtime/PropertyDescriptor.h \ -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r102578 r102917 101 101 _WTFReportFatalError 102 102 __ZN14OpaqueJSString6createERKN3JSC7UStringE 103 __ZN3JSC7Options17numberOfGCMarkersE 104 __ZN3JSC7Options24opaqueRootMergeThresholdE 103 105 __ZN3JSC10HandleHeap12writeBarrierEPNS_7JSValueERKS1_ 104 106 __ZN3JSC10HandleHeap4growEv 105 __ZN3JSC10Heuristics17numberOfGCMarkersE106 __ZN3JSC10Heuristics24opaqueRootMergeThresholdE107 107 __ZN3JSC10Identifier11addSlowCaseEPNS_12JSGlobalDataEPN3WTF10StringImplE 108 108 __ZN3JSC10Identifier11addSlowCaseEPNS_9ExecStateEPN3WTF10StringImplE -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
r100556 r102917 735 735 </File> 736 736 <File 737 RelativePath="..\..\runtime\Heuristics.cpp"738 >739 </File>740 <File741 RelativePath="..\..\runtime\Heuristics.h"742 >743 </File>744 <File745 737 RelativePath="..\..\runtime\Identifier.cpp" 746 738 > … … 1036 1028 <File 1037 1029 RelativePath="..\..\runtime\Operations.h" 1030 > 1031 </File> 1032 <File 1033 RelativePath="..\..\runtime\Options.cpp" 1034 > 1035 </File> 1036 <File 1037 RelativePath="..\..\runtime\Options.h" 1038 1038 > 1039 1039 </File> -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r102849 r102917 107 107 0FD82E9014207A5F00179C94 /* ValueProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD82E8E14207A5100179C94 /* ValueProfile.cpp */; }; 108 108 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 */; }; 111 111 0FFF4BB4143955E900655BC0 /* DFGStructureSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFF4BB2143955E600655BC0 /* DFGStructureSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; 112 112 1400067712A6F7830064D123 /* OSAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1400067612A6F7830064D123 /* OSAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 893 893 0FD82E8E14207A5100179C94 /* ValueProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ValueProfile.cpp; sourceTree = "<group>"; }; 894 894 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>"; }; 897 897 0FFF4BB2143955E600655BC0 /* DFGStructureSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGStructureSet.h; path = dfg/DFGStructureSet.h; sourceTree = "<group>"; }; 898 898 1400067612A6F7830064D123 /* OSAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSAllocator.h; sourceTree = "<group>"; }; … … 2117 2117 isa = PBXGroup; 2118 2118 children = ( 2119 0F7700911402FF280078EB39 /* SamplingCounter.cpp */, 2120 0F77008E1402FDD60078EB39 /* SamplingCounter.h */, 2119 2121 BCF605110E203EF800B9A64D /* ArgList.cpp */, 2120 2122 BCF605120E203EF800B9A64D /* ArgList.h */, … … 2172 2174 BC02E9B80E184545000F9297 /* GetterSetter.cpp */, 2173 2175 BC337BDE0E1AF0B80076918A /* GetterSetter.h */, 2174 0FE228EA1436AB2300196C48 /* Heuristics.cpp */,2175 0FE228EB1436AB2300196C48 /* Heuristics.h */,2176 2176 933A349D038AE80F008635CE /* Identifier.cpp */, 2177 2177 933A349A038AE7C6008635CE /* Identifier.h */, … … 2253 2253 F692A8770255597D01FF60F7 /* Operations.cpp */, 2254 2254 F692A8780255597D01FF60F7 /* Operations.h */, 2255 0FE228EA1436AB2300196C48 /* Options.cpp */, 2256 0FE228EB1436AB2300196C48 /* Options.h */, 2255 2257 A7FB60A3103F7DC20017A286 /* PropertyDescriptor.cpp */, 2256 2258 A7FB604B103F5EAB0017A286 /* PropertyDescriptor.h */, … … 2963 2965 A7521E131429169A003C8D0C /* CardSet.h in Headers */, 2964 2966 0FD52AAE143035A00026DC9F /* UnionFind.h in Headers */, 2965 0FE228ED1436AB2700196C48 /* Heuristics.h in Headers */,2967 0FE228ED1436AB2700196C48 /* Options.h in Headers */, 2966 2968 0FFF4BB4143955E900655BC0 /* DFGStructureSet.h in Headers */, 2967 2969 8604F505143CE1C200B295F5 /* JSGlobalThis.h in Headers */, … … 3524 3526 86880F1F14328BB900B08D42 /* DFGSpeculativeJIT32_64.cpp in Sources */, 3525 3527 86880F4D14353B2100B08D42 /* DFGSpeculativeJIT64.cpp in Sources */, 3526 0FE228EE1436AB2C00196C48 /* Heuristics.cpp in Sources */,3528 0FE228EE1436AB2C00196C48 /* Options.cpp in Sources */, 3527 3529 0F620179143FCD480068B77C /* DFGAbstractState.cpp in Sources */, 3528 3530 BC3C4CA01458F5450025FB62 /* JSGlobalThis.cpp in Sources */, -
trunk/Source/JavaScriptCore/Target.pri
r102694 r102917 150 150 runtime/GCActivityCallback.cpp \ 151 151 runtime/GetterSetter.cpp \ 152 runtime/ Heuristics.cpp \152 runtime/Options.cpp \ 153 153 runtime/Identifier.cpp \ 154 154 runtime/InitializeThreading.cpp \ -
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 -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r102694 r102917 980 980 for (InlineStackEntry* entry = m_inlineStackTop; entry; entry = entry->m_caller) { 981 981 ++depth; 982 if (depth >= Heuristics::maximumInliningDepth)982 if (depth >= Options::maximumInliningDepth) 983 983 return false; // Depth exceeded. 984 984 -
trunk/Source/JavaScriptCore/dfg/DFGCapabilities.h
r102167 r102917 30 30 #include "DFGNode.h" 31 31 #include "Executable.h" 32 #include " Heuristics.h"32 #include "Options.h" 33 33 #include "Interpreter.h" 34 34 #include <wtf/Platform.h> … … 41 41 inline bool mightCompileEval(CodeBlock* codeBlock) 42 42 { 43 return codeBlock->instructionCount() <= Heuristics::maximumOptimizationCandidateInstructionCount;43 return codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount; 44 44 } 45 45 inline bool mightCompileProgram(CodeBlock* codeBlock) 46 46 { 47 return codeBlock->instructionCount() <= Heuristics::maximumOptimizationCandidateInstructionCount;47 return codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount; 48 48 } 49 49 inline bool mightCompileFunctionForCall(CodeBlock* codeBlock) 50 50 { 51 return codeBlock->instructionCount() <= Heuristics::maximumOptimizationCandidateInstructionCount;51 return codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount; 52 52 } 53 53 inline bool mightCompileFunctionForConstruct(CodeBlock* codeBlock) 54 54 { 55 return codeBlock->instructionCount() <= Heuristics::maximumOptimizationCandidateInstructionCount;55 return codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount; 56 56 } 57 57 58 58 inline bool mightInlineFunctionForCall(CodeBlock* codeBlock) 59 59 { 60 return codeBlock->instructionCount() <= Heuristics::maximumFunctionForCallInlineCandidateInstructionCount;60 return codeBlock->instructionCount() <= Options::maximumFunctionForCallInlineCandidateInstructionCount; 61 61 } 62 62 inline bool mightInlineFunctionForConstruct(CodeBlock* codeBlock) 63 63 { 64 return codeBlock->instructionCount() <= Heuristics::maximumFunctionForConstructInlineCandidateInstructionCount;64 return codeBlock->instructionCount() <= Options::maximumFunctionForConstructInlineCandidateInstructionCount; 65 65 } 66 66 -
trunk/Source/JavaScriptCore/dfg/DFGOSRExit.cpp
r102694 r102917 67 67 bool OSRExit::considerAddingAsFrequentExitSiteSlow(CodeBlock* dfgCodeBlock, CodeBlock* profiledCodeBlock) 68 68 { 69 if (static_cast<double>(m_count) / dfgCodeBlock->speculativeFailCounter() <= Heuristics::osrExitProminenceForFrequentExitSite)69 if (static_cast<double>(m_count) / dfgCodeBlock->speculativeFailCounter() <= Options::osrExitProminenceForFrequentExitSite) 70 70 return false; 71 71 -
trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp
r102723 r102917 517 517 518 518 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); 520 520 521 521 AssemblyHelpers::Jump lowFailRate = m_jit.branch32(AssemblyHelpers::BelowOrEqual, GPRInfo::regT2, GPRInfo::regT1); 522 522 523 523 // 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())); 525 525 AssemblyHelpers::Jump doneAdjusting = m_jit.jump(); 526 526 -
trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp
r102743 r102917 545 545 546 546 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); 548 548 549 549 AssemblyHelpers::Jump lowFailRate = m_jit.branch32(AssemblyHelpers::BelowOrEqual, GPRInfo::regT2, GPRInfo::regT1); 550 550 551 551 // 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())); 553 553 AssemblyHelpers::Jump doneAdjusting = m_jit.jump(); 554 554 -
trunk/Source/JavaScriptCore/dfg/DFGVariableAccessData.h
r102743 r102917 98 98 { 99 99 // 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())); 101 101 } 102 102 -
trunk/Source/JavaScriptCore/heap/MarkStack.cpp
r100242 r102917 29 29 #include "ConservativeRoots.h" 30 30 #include "Heap.h" 31 #include " Heuristics.h"31 #include "Options.h" 32 32 #include "JSArray.h" 33 33 #include "JSCell.h" … … 61 61 } 62 62 63 return static_cast<MarkStackSegment*>(OSAllocator::reserveAndCommit( Heuristics::gcMarkStackSegmentSize));63 return static_cast<MarkStackSegment*>(OSAllocator::reserveAndCommit(Options::gcMarkStackSegmentSize)); 64 64 } 65 65 … … 82 82 MarkStackSegment* toFree = segments; 83 83 segments = segments->m_previous; 84 OSAllocator::decommitAndRelease(toFree, Heuristics::gcMarkStackSegmentSize);84 OSAllocator::decommitAndRelease(toFree, Options::gcMarkStackSegmentSize); 85 85 } 86 86 } … … 88 88 MarkStackArray::MarkStackArray(MarkStackSegmentAllocator& allocator) 89 89 : m_allocator(allocator) 90 , m_segmentCapacity(MarkStackSegment::capacityFromSize( Heuristics::gcMarkStackSegmentSize))90 , m_segmentCapacity(MarkStackSegment::capacityFromSize(Options::gcMarkStackSegmentSize)) 91 91 , m_top(0) 92 92 , m_numberOfPreviousSegments(0) … … 146 146 147 147 // 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) 149 149 return false; 150 150 151 size_t numberOfCellsToKeep = Heuristics::minimumNumberOfCellsToKeep;151 size_t numberOfCellsToKeep = Options::minimumNumberOfCellsToKeep; 152 152 ASSERT(m_top > numberOfCellsToKeep || m_topSegment->m_previous); 153 153 … … 210 210 211 211 // 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); 214 214 while (numberOfCellsToSteal-- > 0 && other.canRemoveLast()) 215 215 append(other.removeLast()); … … 239 239 { 240 240 #if ENABLE(PARALLEL_GC) 241 for (unsigned i = 1; i < Heuristics::numberOfGCMarkers; ++i) {241 for (unsigned i = 1; i < Options::numberOfGCMarkers; ++i) { 242 242 m_markingThreads.append(createThread(markingThreadStartFunc, this, "JavaScriptCore::Marking")); 243 243 ASSERT(m_markingThreads.last()); … … 330 330 // Only wake up threads if the shared stack is big enough; otherwise assume that 331 331 // 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) 333 333 m_shared.m_markingCondition.broadcast(); 334 334 } … … 344 344 345 345 #if ENABLE(PARALLEL_GC) 346 if ( Heuristics::numberOfGCMarkers > 1) {346 if (Options::numberOfGCMarkers > 1) { 347 347 while (!m_stack.isEmpty()) { 348 348 m_stack.refill(); 349 for (unsigned countdown = Heuristics::minimumNumberOfScansBetweenRebalance; m_stack.canRemoveLast() && countdown--;)349 for (unsigned countdown = Options::minimumNumberOfScansBetweenRebalance; m_stack.canRemoveLast() && countdown--;) 350 350 visitChildren(*this, m_stack.removeLast(), jsFinalObjectVPtr, jsArrayVPtr, jsStringVPtr); 351 351 donateKnownParallel(); … … 368 368 ASSERT(m_isInParallelMode); 369 369 370 ASSERT( Heuristics::numberOfGCMarkers);370 ASSERT(Options::numberOfGCMarkers); 371 371 372 372 bool shouldBeParallel; 373 373 374 374 #if ENABLE(PARALLEL_GC) 375 shouldBeParallel = Heuristics::numberOfGCMarkers > 1;375 shouldBeParallel = Options::numberOfGCMarkers > 1; 376 376 #else 377 ASSERT( Heuristics::numberOfGCMarkers == 1);377 ASSERT(Options::numberOfGCMarkers == 1); 378 378 shouldBeParallel = false; 379 379 #endif -
trunk/Source/JavaScriptCore/heap/MarkStack.h
r100242 r102917 28 28 29 29 #include "HandleTypes.h" 30 #include " Heuristics.h"30 #include "Options.h" 31 31 #include "JSValue.h" 32 32 #include "Register.h" … … 262 262 void mergeOpaqueRootsIfProfitable() 263 263 { 264 if (static_cast<unsigned>(m_opaqueRoots.size()) < Heuristics::opaqueRootMergeThreshold)264 if (static_cast<unsigned>(m_opaqueRoots.size()) < Options::opaqueRootMergeThreshold) 265 265 return; 266 266 mergeOpaqueRoots(); … … 310 310 { 311 311 #if ENABLE(PARALLEL_GC) 312 if ( Heuristics::numberOfGCMarkers == 1) {312 if (Options::numberOfGCMarkers == 1) { 313 313 // Put directly into the shared HashSet. 314 314 m_shared.m_opaqueRoots.add(root); … … 376 376 inline bool MarkStackArray::canDonateSomeCells() 377 377 { 378 size_t numberOfCellsToKeep = Heuristics::minimumNumberOfCellsToKeep;378 size_t numberOfCellsToKeep = Options::minimumNumberOfCellsToKeep; 379 379 // Another check: see if we have enough cells to warrant donation. 380 380 if (m_top <= numberOfCellsToKeep) { -
trunk/Source/JavaScriptCore/heap/SlotVisitor.h
r99898 r102917 41 41 { 42 42 ASSERT(m_isInParallelMode); 43 if ( Heuristics::numberOfGCMarkers == 1)43 if (Options::numberOfGCMarkers == 1) 44 44 return; 45 45 -
trunk/Source/JavaScriptCore/jit/JIT.cpp
r102545 r102917 100 100 return; 101 101 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())); 103 103 JITStubCall stubCall(this, kind == LoopOptimizationCheck ? cti_optimize_from_loop : cti_optimize_from_ret); 104 104 if (kind == LoopOptimizationCheck) -
trunk/Source/JavaScriptCore/jsc.cpp
r99392 r102917 103 103 }; 104 104 105 struct Options{106 Options()105 struct CommandLine { 106 CommandLine() 107 107 : interactive(false) 108 108 , dump(false) … … 549 549 } 550 550 551 static void parseArguments(int argc, char** argv, Options& options, JSGlobalData* globalData)551 static void parseArguments(int argc, char** argv, CommandLine& options, JSGlobalData* globalData) 552 552 { 553 553 int i = 1; … … 603 603 JSLock lock(SilenceAssertionsOnly); 604 604 605 Optionsoptions;605 CommandLine options; 606 606 parseArguments(argc, argv, options, globalData); 607 607 -
trunk/Source/JavaScriptCore/runtime/InitializeThreading.cpp
r100205 r102917 32 32 #include "ExecutableAllocator.h" 33 33 #include "Heap.h" 34 #include " Heuristics.h"34 #include "Options.h" 35 35 #include "Identifier.h" 36 36 #include "JSDateMath.h" … … 54 54 WTF::double_conversion::initialize(); 55 55 WTF::initializeThreading(); 56 Heuristics::initializeHeuristics();56 Options::initializeOptions(); 57 57 #if ENABLE(WRITE_BARRIER_PROFILING) 58 58 WriteBarrierCounters::initialize(); -
trunk/Source/JavaScriptCore/runtime/Options.cpp
r102916 r102917 25 25 26 26 #include "config.h" 27 #include "Heuristics.h" 27 #include "Options.h" 28 29 #include <limits> 28 30 #include <wtf/PageBlock.h> 29 30 #include <limits>31 31 32 32 #if OS(DARWIN) && ENABLE(PARALLEL_GC) … … 43 43 #endif 44 44 45 namespace JSC { namespace Heuristics {45 namespace JSC { namespace Options { 46 46 47 47 unsigned maximumOptimizationCandidateInstructionCount; … … 128 128 #endif 129 129 130 void initialize Heuristics()130 void initializeOptions() 131 131 { 132 132 SET(maximumOptimizationCandidateInstructionCount, 1000); … … 210 210 } 211 211 212 } } // namespace JSC:: Heuristics213 214 212 } } // namespace JSC::Options 213 214 -
trunk/Source/JavaScriptCore/runtime/Options.h
r102916 r102917 24 24 */ 25 25 26 #ifndef Heuristics_h27 #define Heuristics_h26 #ifndef Options_h 27 #define Options_h 28 28 29 29 #include <stdint.h> 30 30 31 namespace JSC { namespace Heuristics {31 namespace JSC { namespace Options { 32 32 33 33 extern unsigned maximumOptimizationCandidateInstructionCount; … … 77 77 extern unsigned opaqueRootMergeThreshold; 78 78 79 void initialize Heuristics();79 void initializeOptions(); 80 80 81 } } // namespace JSC:: Heuristics81 } } // namespace JSC::Options 82 82 83 #endif // Heuristics_h83 #endif // Options_h 84 84 -
trunk/Source/JavaScriptCore/testRegExp.cpp
r99223 r102917 57 57 static void cleanupGlobalData(JSGlobalData*); 58 58 59 struct Options{60 Options()59 struct CommandLine { 60 CommandLine() 61 61 : interactive(false) 62 62 , verbose(false) … … 491 491 } 492 492 493 static void parseArguments(int argc, char** argv, Options& options, JSGlobalData* globalData)493 static void parseArguments(int argc, char** argv, CommandLine& options, JSGlobalData* globalData) 494 494 { 495 495 int i = 1; … … 512 512 JSLock lock(SilenceAssertionsOnly); 513 513 514 Optionsoptions;514 CommandLine options; 515 515 parseArguments(argc, argv, options, globalData); 516 516
Note: See TracChangeset
for help on using the changeset viewer.