WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-72889-20111124132034.patch (text/plain), 63.15 KB, created by
Andy Wingo
on 2011-11-24 04:20:36 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Andy Wingo
Created:
2011-11-24 04:20:36 PST
Size:
63.15 KB
patch
obsolete
>Subversion Revision: 101131 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index d4e4e313ca53c8d8cc77216c81ac761f370b431a..4acc61e3a4a29e3e1911a62a6dc72669c64687e3 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,77 @@ >+2011-11-22 Andy Wingo <wingo@igalia.com> >+ >+ Rename JSC::Heuristics to JSC::Options >+ https://bugs.webkit.org/show_bug.cgi?id=72889 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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/DFGOSRExitCompiler32_64.cpp: >+ (JSC::DFG::OSRExitCompiler::compileExit): >+ * dfg/DFGOSRExitCompiler64.cpp: >+ (JSC::DFG::OSRExitCompiler::compileExit): >+ * 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. >+ > 2011-11-24 Patrick Gansterer <paroga@webkit.org> > > [Qt] Use QEvent for dispatchFunctionsFromMainThread() >diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt >index 54719946a2cfcf5fe12c6ededea38038cae4f451..3034346054c035c5c7d60c142daf1e5ea077fa39 100644 >--- a/Source/JavaScriptCore/CMakeLists.txt >+++ b/Source/JavaScriptCore/CMakeLists.txt >@@ -134,7 +134,6 @@ SET(JavaScriptCore_SOURCES > runtime/FunctionPrototype.cpp > runtime/GCActivityCallback.cpp > runtime/GetterSetter.cpp >- runtime/Heuristics.cpp > runtime/Identifier.cpp > runtime/InitializeThreading.cpp > runtime/InternalFunction.cpp >@@ -171,6 +170,7 @@ SET(JavaScriptCore_SOURCES > runtime/ObjectConstructor.cpp > runtime/ObjectPrototype.cpp > runtime/Operations.cpp >+ runtime/Options.cpp > runtime/PropertyDescriptor.cpp > runtime/PropertyNameArray.cpp > runtime/PropertySlot.cpp >diff --git a/Source/JavaScriptCore/GNUmakefile.list.am b/Source/JavaScriptCore/GNUmakefile.list.am >index 7d5fdd5d9dba0071b989146c93e7a0b5fc6bdd30..6c8d2d68cbafbca5716d1cbd3024e73d0f9c3c04 100644 >--- a/Source/JavaScriptCore/GNUmakefile.list.am >+++ b/Source/JavaScriptCore/GNUmakefile.list.am >@@ -357,8 +357,6 @@ javascriptcore_sources += \ > Source/JavaScriptCore/runtime/GCActivityCallback.h \ > Source/JavaScriptCore/runtime/GetterSetter.cpp \ > Source/JavaScriptCore/runtime/GetterSetter.h \ >- Source/JavaScriptCore/runtime/Heuristics.cpp \ >- Source/JavaScriptCore/runtime/Heuristics.h \ > Source/JavaScriptCore/runtime/Identifier.cpp \ > Source/JavaScriptCore/runtime/Identifier.h \ > Source/JavaScriptCore/runtime/InitializeThreading.cpp \ >@@ -437,6 +435,8 @@ javascriptcore_sources += \ > Source/JavaScriptCore/runtime/ObjectPrototype.h \ > Source/JavaScriptCore/runtime/Operations.cpp \ > Source/JavaScriptCore/runtime/Operations.h \ >+ Source/JavaScriptCore/runtime/Options.cpp \ >+ Source/JavaScriptCore/runtime/Options.h \ > Source/JavaScriptCore/runtime/PropertyDescriptor.cpp \ > Source/JavaScriptCore/runtime/PropertyDescriptor.h \ > Source/JavaScriptCore/runtime/PropertyMapHashTable.h \ >diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj >index a793dd7ed5b9c056d32463f0d3a0a1bd3988c2d3..888269623894d84ea224268480ee94e9cc5188c3 100644 >--- a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj >+++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj >@@ -734,14 +734,6 @@ > > > </File> > <File >- RelativePath="..\..\runtime\Heuristics.cpp" >- > >- </File> >- <File >- RelativePath="..\..\runtime\Heuristics.h" >- > >- </File> >- <File > RelativePath="..\..\runtime\Identifier.cpp" > > > </File> >@@ -1038,6 +1030,14 @@ > > > </File> > <File >+ RelativePath="..\..\runtime\Options.cpp" >+ > >+ </File> >+ <File >+ RelativePath="..\..\runtime\Options.h" >+ > >+ </File> >+ <File > RelativePath="..\..\runtime\PropertyDescriptor.cpp" > > > </File> >diff --git a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >index b27e713a793493aa2f561cc4b1e41b2e1778c709..666a6eff7038390555d29f5317b6b112699a608d 100644 >--- a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >+++ b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >@@ -104,8 +104,8 @@ > 0FD82E9014207A5F00179C94 /* ValueProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD82E8E14207A5100179C94 /* ValueProfile.cpp */; }; > 0FD82EF51423075B00179C94 /* DFGIntrinsic.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD82EF31423073900179C94 /* DFGIntrinsic.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0FD82F4B142806A100179C94 /* BitVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD82F491428069200179C94 /* BitVector.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 0FE228ED1436AB2700196C48 /* Heuristics.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE228EB1436AB2300196C48 /* Heuristics.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 0FE228EE1436AB2C00196C48 /* Heuristics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE228EA1436AB2300196C48 /* Heuristics.cpp */; }; >+ 0FE228ED1436AB2700196C48 /* Options.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE228EB1436AB2300196C48 /* Options.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 0FE228EE1436AB2C00196C48 /* Options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE228EA1436AB2300196C48 /* Options.cpp */; }; > 0FFF4BB4143955E900655BC0 /* DFGStructureSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFF4BB2143955E600655BC0 /* DFGStructureSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 1400067712A6F7830064D123 /* OSAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1400067612A6F7830064D123 /* OSAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 1400069312A6F9E10064D123 /* OSAllocatorPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1400069212A6F9E10064D123 /* OSAllocatorPosix.cpp */; }; >@@ -870,8 +870,8 @@ > 0FD82E8E14207A5100179C94 /* ValueProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ValueProfile.cpp; sourceTree = "<group>"; }; > 0FD82EF31423073900179C94 /* DFGIntrinsic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGIntrinsic.h; path = dfg/DFGIntrinsic.h; sourceTree = "<group>"; }; > 0FD82F491428069200179C94 /* BitVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitVector.h; sourceTree = "<group>"; }; >- 0FE228EA1436AB2300196C48 /* Heuristics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Heuristics.cpp; sourceTree = "<group>"; }; >- 0FE228EB1436AB2300196C48 /* Heuristics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Heuristics.h; sourceTree = "<group>"; }; >+ 0FE228EA1436AB2300196C48 /* Options.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Options.cpp; sourceTree = "<group>"; }; >+ 0FE228EB1436AB2300196C48 /* Options.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Options.h; sourceTree = "<group>"; }; > 0FFF4BB2143955E600655BC0 /* DFGStructureSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGStructureSet.h; path = dfg/DFGStructureSet.h; sourceTree = "<group>"; }; > 1400067612A6F7830064D123 /* OSAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSAllocator.h; sourceTree = "<group>"; }; > 1400069212A6F9E10064D123 /* OSAllocatorPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OSAllocatorPosix.cpp; sourceTree = "<group>"; }; >@@ -2059,8 +2059,8 @@ > 7EF6E0BB0EB7A1EC0079AFAF /* runtime */ = { > isa = PBXGroup; > children = ( >- 0FE228EA1436AB2300196C48 /* Heuristics.cpp */, >- 0FE228EB1436AB2300196C48 /* Heuristics.h */, >+ 0FE228EA1436AB2300196C48 /* Options.cpp */, >+ 0FE228EB1436AB2300196C48 /* Options.h */, > 0F7700911402FF280078EB39 /* SamplingCounter.cpp */, > 0F77008E1402FDD60078EB39 /* SamplingCounter.h */, > BCF605110E203EF800B9A64D /* ArgList.cpp */, >@@ -2900,7 +2900,7 @@ > 0F636DA0142D27D700B2E66A /* PackedIntVector.h in Headers */, > A7521E131429169A003C8D0C /* CardSet.h in Headers */, > 0FD52AAE143035A00026DC9F /* UnionFind.h in Headers */, >- 0FE228ED1436AB2700196C48 /* Heuristics.h in Headers */, >+ 0FE228ED1436AB2700196C48 /* Options.h in Headers */, > 0FFF4BB4143955E900655BC0 /* DFGStructureSet.h in Headers */, > 8604F505143CE1C200B295F5 /* JSGlobalThis.h in Headers */, > 0F620174143FCD330068B77C /* DFGVariableAccessData.h in Headers */, >@@ -3446,7 +3446,7 @@ > 86FA9E91142BBB2E001773B7 /* JSBoundFunction.cpp in Sources */, > 86880F1F14328BB900B08D42 /* DFGSpeculativeJIT32_64.cpp in Sources */, > 86880F4D14353B2100B08D42 /* DFGSpeculativeJIT64.cpp in Sources */, >- 0FE228EE1436AB2C00196C48 /* Heuristics.cpp in Sources */, >+ 0FE228EE1436AB2C00196C48 /* Options.cpp in Sources */, > 0F620179143FCD480068B77C /* DFGAbstractState.cpp in Sources */, > BC3C4CA01458F5450025FB62 /* JSGlobalThis.cpp in Sources */, > 0FC0976E1468AB5100CF2442 /* DFGAssemblyHelpers.cpp in Sources */, >diff --git a/Source/JavaScriptCore/Target.pri b/Source/JavaScriptCore/Target.pri >index 38d382dda04083979196ff373ffa5d1930f5f808..be0ec5e04087f5cfa136ad41a7f7548a32e2c76a 100644 >--- a/Source/JavaScriptCore/Target.pri >+++ b/Source/JavaScriptCore/Target.pri >@@ -149,7 +149,7 @@ SOURCES += \ > runtime/FunctionPrototype.cpp \ > runtime/GCActivityCallback.cpp \ > runtime/GetterSetter.cpp \ >- runtime/Heuristics.cpp \ >+ runtime/Options.cpp \ > runtime/Identifier.cpp \ > runtime/InitializeThreading.cpp \ > runtime/InternalFunction.cpp \ >diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp >index e1270ec00e1af649c52b5c852fec9dc32180b78e..3056c8789e219d38ebbb6117d5fbeee3d52ee31e 100644 >--- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp >+++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp >@@ -2203,7 +2203,7 @@ bool CodeBlock::shouldOptimizeNow() > dumpValueProfiles(); > #endif > >- if (m_optimizationDelayCounter >= Heuristics::maximumOptimizationDelay) >+ if (m_optimizationDelayCounter >= Options::maximumOptimizationDelay) > return true; > > unsigned numberOfNonArgumentValueProfiles = 0; >@@ -2229,9 +2229,9 @@ bool CodeBlock::shouldOptimizeNow() > printf("Profile hotness: %lf, %lf\n", (double)numberOfLiveNonArgumentValueProfiles / numberOfNonArgumentValueProfiles, (double)numberOfSamplesInProfiles / ValueProfile::numberOfBuckets / numberOfValueProfiles()); > #endif > >- if ((!numberOfNonArgumentValueProfiles || (double)numberOfLiveNonArgumentValueProfiles / numberOfNonArgumentValueProfiles >= Heuristics::desiredProfileLivenessRate) >- && (!numberOfValueProfiles() || (double)numberOfSamplesInProfiles / ValueProfile::numberOfBuckets / numberOfValueProfiles() >= Heuristics::desiredProfileFullnessRate) >- && static_cast<unsigned>(m_optimizationDelayCounter) + 1 >= Heuristics::minimumOptimizationDelay) >+ if ((!numberOfNonArgumentValueProfiles || (double)numberOfLiveNonArgumentValueProfiles / numberOfNonArgumentValueProfiles >= Options::desiredProfileLivenessRate) >+ && (!numberOfValueProfiles() || (double)numberOfSamplesInProfiles / ValueProfile::numberOfBuckets / numberOfValueProfiles() >= Options::desiredProfileFullnessRate) >+ && static_cast<unsigned>(m_optimizationDelayCounter) + 1 >= Options::minimumOptimizationDelay) > return true; > > ASSERT(m_optimizationDelayCounter < std::numeric_limits<uint8_t>::max()); >diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.h b/Source/JavaScriptCore/bytecode/CodeBlock.h >index c9901efcd58b3a08ae975426581224e1727d90af..d8e8509015532324f6e9a123b3904c8b29f7e8f1 100644 >--- a/Source/JavaScriptCore/bytecode/CodeBlock.h >+++ b/Source/JavaScriptCore/bytecode/CodeBlock.h >@@ -36,7 +36,7 @@ > #include "DFGOSREntry.h" > #include "DFGOSRExit.h" > #include "EvalCodeCache.h" >-#include "Heuristics.h" >+#include "Options.h" > #include "Instruction.h" > #include "JITCode.h" > #include "JITWriteBarrier.h" >@@ -676,12 +676,12 @@ namespace JSC { > > bool likelyToTakeSlowCase(int bytecodeOffset) > { >- return rareCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter >= Heuristics::likelyToTakeSlowCaseThreshold; >+ return rareCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter >= Options::likelyToTakeSlowCaseThreshold; > } > > bool couldTakeSlowCase(int bytecodeOffset) > { >- return rareCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter >= Heuristics::couldTakeSlowCaseThreshold; >+ return rareCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter >= Options::couldTakeSlowCaseThreshold; > } > > RareCaseProfile* addSpecialFastCaseProfile(int bytecodeOffset) >@@ -699,21 +699,21 @@ namespace JSC { > bool likelyToTakeSpecialFastCase(int bytecodeOffset) > { > unsigned specialFastCaseCount = specialFastCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter; >- return specialFastCaseCount >= Heuristics::likelyToTakeSlowCaseThreshold; >+ return specialFastCaseCount >= Options::likelyToTakeSlowCaseThreshold; > } > > bool likelyToTakeDeepestSlowCase(int bytecodeOffset) > { > unsigned slowCaseCount = rareCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter; > unsigned specialFastCaseCount = specialFastCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter; >- return (slowCaseCount - specialFastCaseCount) >= Heuristics::likelyToTakeSlowCaseThreshold; >+ return (slowCaseCount - specialFastCaseCount) >= Options::likelyToTakeSlowCaseThreshold; > } > > bool likelyToTakeAnySlowCase(int bytecodeOffset) > { > unsigned slowCaseCount = rareCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter; > unsigned specialFastCaseCount = specialFastCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter; >- return (slowCaseCount + specialFastCaseCount) >= Heuristics::likelyToTakeSlowCaseThreshold; >+ return (slowCaseCount + specialFastCaseCount) >= Options::likelyToTakeSlowCaseThreshold; > } > > void resetRareCaseProfiles(); >@@ -915,25 +915,25 @@ namespace JSC { > // to avoid thrashing. > unsigned reoptimizationRetryCounter() const > { >- ASSERT(m_reoptimizationRetryCounter <= Heuristics::reoptimizationRetryCounterMax); >+ ASSERT(m_reoptimizationRetryCounter <= Options::reoptimizationRetryCounterMax); > return m_reoptimizationRetryCounter; > } > > void countReoptimization() > { > m_reoptimizationRetryCounter++; >- if (m_reoptimizationRetryCounter > Heuristics::reoptimizationRetryCounterMax) >- m_reoptimizationRetryCounter = Heuristics::reoptimizationRetryCounterMax; >+ if (m_reoptimizationRetryCounter > Options::reoptimizationRetryCounterMax) >+ m_reoptimizationRetryCounter = Options::reoptimizationRetryCounterMax; > } > > int32_t counterValueForOptimizeAfterWarmUp() > { >- return Heuristics::executionCounterValueForOptimizeAfterWarmUp << reoptimizationRetryCounter(); >+ return Options::executionCounterValueForOptimizeAfterWarmUp << reoptimizationRetryCounter(); > } > > int32_t counterValueForOptimizeAfterLongWarmUp() > { >- return Heuristics::executionCounterValueForOptimizeAfterLongWarmUp << reoptimizationRetryCounter(); >+ return Options::executionCounterValueForOptimizeAfterLongWarmUp << reoptimizationRetryCounter(); > } > > int32_t* addressOfExecuteCounter() >@@ -952,7 +952,7 @@ namespace JSC { > // expensive than executing baseline code. > void optimizeNextInvocation() > { >- m_executeCounter = Heuristics::executionCounterValueForOptimizeNextInvocation; >+ m_executeCounter = Options::executionCounterValueForOptimizeNextInvocation; > } > > // Call this to prevent optimization from happening again. Note that >@@ -962,7 +962,7 @@ namespace JSC { > // the future as well. > void dontOptimizeAnytimeSoon() > { >- m_executeCounter = Heuristics::executionCounterValueForDontOptimizeAnytimeSoon; >+ m_executeCounter = Options::executionCounterValueForDontOptimizeAnytimeSoon; > } > > // Call this to reinitialize the counter to its starting state, >@@ -1003,7 +1003,7 @@ namespace JSC { > // in the baseline code. > void optimizeSoon() > { >- m_executeCounter = Heuristics::executionCounterValueForOptimizeSoon << reoptimizationRetryCounter(); >+ m_executeCounter = Options::executionCounterValueForOptimizeSoon << reoptimizationRetryCounter(); > } > > // The speculative JIT tracks its success rate, so that we can >@@ -1037,17 +1037,17 @@ namespace JSC { > > #if ENABLE(JIT) > // The number of failures that triggers the use of the ratio. >- unsigned largeFailCountThreshold() { return Heuristics::largeFailCountThresholdBase << baselineVersion()->reoptimizationRetryCounter(); } >- unsigned largeFailCountThresholdForLoop() { return Heuristics::largeFailCountThresholdBaseForLoop << baselineVersion()->reoptimizationRetryCounter(); } >+ unsigned largeFailCountThreshold() { return Options::largeFailCountThresholdBase << baselineVersion()->reoptimizationRetryCounter(); } >+ unsigned largeFailCountThresholdForLoop() { return Options::largeFailCountThresholdBaseForLoop << baselineVersion()->reoptimizationRetryCounter(); } > > bool shouldReoptimizeNow() > { >- return Heuristics::desiredSpeculativeSuccessFailRatio * speculativeFailCounter() >= speculativeSuccessCounter() && speculativeFailCounter() >= largeFailCountThreshold(); >+ return Options::desiredSpeculativeSuccessFailRatio * speculativeFailCounter() >= speculativeSuccessCounter() && speculativeFailCounter() >= largeFailCountThreshold(); > } > > bool shouldReoptimizeFromLoopNow() > { >- return Heuristics::desiredSpeculativeSuccessFailRatio * speculativeFailCounter() >= speculativeSuccessCounter() && speculativeFailCounter() >= largeFailCountThresholdForLoop(); >+ return Options::desiredSpeculativeSuccessFailRatio * speculativeFailCounter() >= speculativeSuccessCounter() && speculativeFailCounter() >= largeFailCountThresholdForLoop(); > } > #endif > >diff --git a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp >index 3d258cfe4eaf59fadc871b73e1269753ee7f6d86..e7ed6f7f43377e195513466189912b127f9653f5 100644 >--- a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp >+++ b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp >@@ -956,7 +956,7 @@ bool ByteCodeParser::handleInlining(bool usesResult, int callTarget, NodeIndex c > unsigned depth = 0; > for (InlineStackEntry* entry = m_inlineStackTop; entry; entry = entry->m_caller) { > ++depth; >- if (depth >= Heuristics::maximumInliningDepth) >+ if (depth >= Options::maximumInliningDepth) > return false; // Depth exceeded. > > if (entry->executable() == executable) >diff --git a/Source/JavaScriptCore/dfg/DFGCapabilities.h b/Source/JavaScriptCore/dfg/DFGCapabilities.h >index c83abfd3463977aa8143500234e9626c08859824..1c8faa5939f55d92176a26ec7fdaddea6c2ab675 100644 >--- a/Source/JavaScriptCore/dfg/DFGCapabilities.h >+++ b/Source/JavaScriptCore/dfg/DFGCapabilities.h >@@ -29,7 +29,7 @@ > #include "DFGIntrinsic.h" > #include "DFGNode.h" > #include "Executable.h" >-#include "Heuristics.h" >+#include "Options.h" > #include "Interpreter.h" > #include <wtf/Platform.h> > >@@ -40,28 +40,28 @@ namespace JSC { namespace DFG { > // check opcodes. > inline bool mightCompileEval(CodeBlock* codeBlock) > { >- return codeBlock->instructionCount() <= Heuristics::maximumEvalOptimizationCandidateInstructionCount; >+ return codeBlock->instructionCount() <= Options::maximumEvalOptimizationCandidateInstructionCount; > } > inline bool mightCompileProgram(CodeBlock* codeBlock) > { >- return codeBlock->instructionCount() <= Heuristics::maximumProgramOptimizationCandidateInstructionCount; >+ return codeBlock->instructionCount() <= Options::maximumProgramOptimizationCandidateInstructionCount; > } > inline bool mightCompileFunctionForCall(CodeBlock* codeBlock) > { >- return codeBlock->instructionCount() <= Heuristics::maximumFunctionForCallOptimizationCandidateInstructionCount; >+ return codeBlock->instructionCount() <= Options::maximumFunctionForCallOptimizationCandidateInstructionCount; > } > inline bool mightCompileFunctionForConstruct(CodeBlock* codeBlock) > { >- return codeBlock->instructionCount() <= Heuristics::maximumFunctionForConstructOptimizationCandidateInstructionCount; >+ return codeBlock->instructionCount() <= Options::maximumFunctionForConstructOptimizationCandidateInstructionCount; > } > > inline bool mightInlineFunctionForCall(CodeBlock* codeBlock) > { >- return codeBlock->instructionCount() <= Heuristics::maximumFunctionForCallInlineCandidateInstructionCount; >+ return codeBlock->instructionCount() <= Options::maximumFunctionForCallInlineCandidateInstructionCount; > } > inline bool mightInlineFunctionForConstruct(CodeBlock* codeBlock) > { >- return codeBlock->instructionCount() <= Heuristics::maximumFunctionForConstructInlineCandidateInstructionCount; >+ return codeBlock->instructionCount() <= Options::maximumFunctionForConstructInlineCandidateInstructionCount; > } > > // Opcode checking. >diff --git a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp >index 6ffd803aa5755a76c061df8691dff30758abd25d..ee580aced0d240e20a0ae64219c06e4f7653de0c 100644 >--- a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp >+++ b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp >@@ -463,12 +463,12 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, SpeculationRecovery* reco > m_jit.move(AssemblyHelpers::TrustedImmPtr(m_jit.baselineCodeBlock()), GPRInfo::regT0); > > AssemblyHelpers::Jump fewFails = m_jit.branch32(AssemblyHelpers::BelowOrEqual, GPRInfo::regT2, AssemblyHelpers::Imm32(m_jit.codeBlock()->largeFailCountThreshold())); >- m_jit.mul32(AssemblyHelpers::Imm32(Heuristics::desiredSpeculativeSuccessFailRatio), GPRInfo::regT2, GPRInfo::regT2); >+ m_jit.mul32(AssemblyHelpers::Imm32(Options::desiredSpeculativeSuccessFailRatio), GPRInfo::regT2, GPRInfo::regT2); > > AssemblyHelpers::Jump lowFailRate = m_jit.branch32(AssemblyHelpers::BelowOrEqual, GPRInfo::regT2, GPRInfo::regT1); > > // Reoptimize as soon as possible. >- m_jit.store32(AssemblyHelpers::Imm32(Heuristics::executionCounterValueForOptimizeNextInvocation), AssemblyHelpers::Address(GPRInfo::regT0, CodeBlock::offsetOfExecuteCounter())); >+ m_jit.store32(AssemblyHelpers::Imm32(Options::executionCounterValueForOptimizeNextInvocation), AssemblyHelpers::Address(GPRInfo::regT0, CodeBlock::offsetOfExecuteCounter())); > AssemblyHelpers::Jump doneAdjusting = m_jit.jump(); > > fewFails.link(&m_jit); >diff --git a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp >index 56fb1344e298fca67ce163f05b1aee89092d7db7..452ef541a440e178acbd8f350f2e0720bc98aeee 100644 >--- a/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp >+++ b/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp >@@ -473,12 +473,12 @@ void OSRExitCompiler::compileExit(const OSRExit& exit, SpeculationRecovery* reco > m_jit.move(AssemblyHelpers::TrustedImmPtr(m_jit.baselineCodeBlock()), GPRInfo::regT0); > > AssemblyHelpers::Jump fewFails = m_jit.branch32(AssemblyHelpers::BelowOrEqual, GPRInfo::regT2, AssemblyHelpers::Imm32(m_jit.codeBlock()->largeFailCountThreshold())); >- m_jit.mul32(AssemblyHelpers::Imm32(Heuristics::desiredSpeculativeSuccessFailRatio), GPRInfo::regT2, GPRInfo::regT2); >+ m_jit.mul32(AssemblyHelpers::Imm32(Options::desiredSpeculativeSuccessFailRatio), GPRInfo::regT2, GPRInfo::regT2); > > AssemblyHelpers::Jump lowFailRate = m_jit.branch32(AssemblyHelpers::BelowOrEqual, GPRInfo::regT2, GPRInfo::regT1); > > // Reoptimize as soon as possible. >- m_jit.store32(AssemblyHelpers::Imm32(Heuristics::executionCounterValueForOptimizeNextInvocation), AssemblyHelpers::Address(GPRInfo::regT0, CodeBlock::offsetOfExecuteCounter())); >+ m_jit.store32(AssemblyHelpers::Imm32(Options::executionCounterValueForOptimizeNextInvocation), AssemblyHelpers::Address(GPRInfo::regT0, CodeBlock::offsetOfExecuteCounter())); > AssemblyHelpers::Jump doneAdjusting = m_jit.jump(); > > fewFails.link(&m_jit); >diff --git a/Source/JavaScriptCore/heap/MarkStack.cpp b/Source/JavaScriptCore/heap/MarkStack.cpp >index 3f4fda76cc4e371f74d6dcc735c9b938463ef9d5..dd0e6fd57aadd302ed577ba49226b05e6e817c7e 100644 >--- a/Source/JavaScriptCore/heap/MarkStack.cpp >+++ b/Source/JavaScriptCore/heap/MarkStack.cpp >@@ -28,7 +28,7 @@ > > #include "ConservativeRoots.h" > #include "Heap.h" >-#include "Heuristics.h" >+#include "Options.h" > #include "JSArray.h" > #include "JSCell.h" > #include "JSObject.h" >@@ -60,7 +60,7 @@ MarkStackSegment* MarkStackSegmentAllocator::allocate() > } > } > >- return static_cast<MarkStackSegment*>(OSAllocator::reserveAndCommit(Heuristics::gcMarkStackSegmentSize)); >+ return static_cast<MarkStackSegment*>(OSAllocator::reserveAndCommit(Options::gcMarkStackSegmentSize)); > } > > void MarkStackSegmentAllocator::release(MarkStackSegment* segment) >@@ -81,13 +81,13 @@ void MarkStackSegmentAllocator::shrinkReserve() > while (segments) { > MarkStackSegment* toFree = segments; > segments = segments->m_previous; >- OSAllocator::decommitAndRelease(toFree, Heuristics::gcMarkStackSegmentSize); >+ OSAllocator::decommitAndRelease(toFree, Options::gcMarkStackSegmentSize); > } > } > > MarkStackArray::MarkStackArray(MarkStackSegmentAllocator& allocator) > : m_allocator(allocator) >- , m_segmentCapacity(MarkStackSegment::capacityFromSize(Heuristics::gcMarkStackSegmentSize)) >+ , m_segmentCapacity(MarkStackSegment::capacityFromSize(Options::gcMarkStackSegmentSize)) > , m_top(0) > , m_numberOfPreviousSegments(0) > { >@@ -145,10 +145,10 @@ bool MarkStackArray::donateSomeCellsTo(MarkStackArray& other) > other.validatePrevious(); > > // Fast check: see if the other mark stack already has enough segments. >- if (other.m_numberOfPreviousSegments + 1 >= Heuristics::maximumNumberOfSharedSegments) >+ if (other.m_numberOfPreviousSegments + 1 >= Options::maximumNumberOfSharedSegments) > return false; > >- size_t numberOfCellsToKeep = Heuristics::minimumNumberOfCellsToKeep; >+ size_t numberOfCellsToKeep = Options::minimumNumberOfCellsToKeep; > ASSERT(m_top > numberOfCellsToKeep || m_topSegment->m_previous); > > // Looks like we should donate! Give the other mark stack all of our >@@ -209,8 +209,8 @@ void MarkStackArray::stealSomeCellsFrom(MarkStackArray& other) > } > > // Otherwise drain 1/Nth of the shared array where N is the number of >- // workers, or Heuristics::minimumNumberOfCellsToKeep, whichever is bigger. >- size_t numberOfCellsToSteal = std::max((size_t)Heuristics::minimumNumberOfCellsToKeep, other.size() / Heuristics::numberOfGCMarkers); >+ // workers, or Options::minimumNumberOfCellsToKeep, whichever is bigger. >+ size_t numberOfCellsToSteal = std::max((size_t)Options::minimumNumberOfCellsToKeep, other.size() / Options::numberOfGCMarkers); > while (numberOfCellsToSteal-- > 0 && other.canRemoveLast()) > append(other.removeLast()); > } >@@ -238,7 +238,7 @@ MarkStackThreadSharedData::MarkStackThreadSharedData(JSGlobalData* globalData) > , m_parallelMarkersShouldExit(false) > { > #if ENABLE(PARALLEL_GC) >- for (unsigned i = 1; i < Heuristics::numberOfGCMarkers; ++i) { >+ for (unsigned i = 1; i < Options::numberOfGCMarkers; ++i) { > m_markingThreads.append(createThread(markingThreadStartFunc, this, "JavaScriptCore::Marking")); > ASSERT(m_markingThreads.last()); > } >@@ -329,7 +329,7 @@ void SlotVisitor::donateSlow() > if (m_stack.donateSomeCellsTo(m_shared.m_sharedMarkStack)) { > // Only wake up threads if the shared stack is big enough; otherwise assume that > // it's more profitable for us to just scan this ourselves later. >- if (m_shared.m_sharedMarkStack.size() >= Heuristics::sharedStackWakeupThreshold) >+ if (m_shared.m_sharedMarkStack.size() >= Options::sharedStackWakeupThreshold) > m_shared.m_markingCondition.broadcast(); > } > } >@@ -343,10 +343,10 @@ void SlotVisitor::drain() > void* jsStringVPtr = m_jsStringVPtr; > > #if ENABLE(PARALLEL_GC) >- if (Heuristics::numberOfGCMarkers > 1) { >+ if (Options::numberOfGCMarkers > 1) { > while (!m_stack.isEmpty()) { > m_stack.refill(); >- for (unsigned countdown = Heuristics::minimumNumberOfScansBetweenRebalance; m_stack.canRemoveLast() && countdown--;) >+ for (unsigned countdown = Options::minimumNumberOfScansBetweenRebalance; m_stack.canRemoveLast() && countdown--;) > visitChildren(*this, m_stack.removeLast(), jsFinalObjectVPtr, jsArrayVPtr, jsStringVPtr); > donateKnownParallel(); > } >@@ -367,14 +367,14 @@ void SlotVisitor::drainFromShared(SharedDrainMode sharedDrainMode) > { > ASSERT(m_isInParallelMode); > >- ASSERT(Heuristics::numberOfGCMarkers); >+ ASSERT(Options::numberOfGCMarkers); > > bool shouldBeParallel; > > #if ENABLE(PARALLEL_GC) >- shouldBeParallel = Heuristics::numberOfGCMarkers > 1; >+ shouldBeParallel = Options::numberOfGCMarkers > 1; > #else >- ASSERT(Heuristics::numberOfGCMarkers == 1); >+ ASSERT(Options::numberOfGCMarkers == 1); > shouldBeParallel = false; > #endif > >diff --git a/Source/JavaScriptCore/heap/MarkStack.h b/Source/JavaScriptCore/heap/MarkStack.h >index c5080194887019c9a8cd48b373776d8a8f978da7..8cbdc628e3da134a54dd5ca1537b6a140c16303d 100644 >--- a/Source/JavaScriptCore/heap/MarkStack.h >+++ b/Source/JavaScriptCore/heap/MarkStack.h >@@ -27,7 +27,7 @@ > #define MarkStack_h > > #include "HandleTypes.h" >-#include "Heuristics.h" >+#include "Options.h" > #include "JSValue.h" > #include "Register.h" > #include "UnconditionalFinalizer.h" >@@ -261,7 +261,7 @@ namespace JSC { > > void mergeOpaqueRootsIfProfitable() > { >- if (static_cast<unsigned>(m_opaqueRoots.size()) < Heuristics::opaqueRootMergeThreshold) >+ if (static_cast<unsigned>(m_opaqueRoots.size()) < Options::opaqueRootMergeThreshold) > return; > mergeOpaqueRoots(); > } >@@ -309,7 +309,7 @@ namespace JSC { > inline void MarkStack::addOpaqueRoot(void* root) > { > #if ENABLE(PARALLEL_GC) >- if (Heuristics::numberOfGCMarkers == 1) { >+ if (Options::numberOfGCMarkers == 1) { > // Put directly into the shared HashSet. > m_shared.m_opaqueRoots.add(root); > return; >@@ -375,7 +375,7 @@ namespace JSC { > > inline bool MarkStackArray::canDonateSomeCells() > { >- size_t numberOfCellsToKeep = Heuristics::minimumNumberOfCellsToKeep; >+ size_t numberOfCellsToKeep = Options::minimumNumberOfCellsToKeep; > // Another check: see if we have enough cells to warrant donation. > if (m_top <= numberOfCellsToKeep) { > // This indicates that we might not want to donate anything; check if we have >diff --git a/Source/JavaScriptCore/heap/SlotVisitor.h b/Source/JavaScriptCore/heap/SlotVisitor.h >index a4617814ae7e2f68ab32489ee9ecea5aeb8c6612..647b2cbdc15a7b445b699a49608516adc12af443 100644 >--- a/Source/JavaScriptCore/heap/SlotVisitor.h >+++ b/Source/JavaScriptCore/heap/SlotVisitor.h >@@ -40,7 +40,7 @@ public: > void donate() > { > ASSERT(m_isInParallelMode); >- if (Heuristics::numberOfGCMarkers == 1) >+ if (Options::numberOfGCMarkers == 1) > return; > > donateKnownParallel(); >diff --git a/Source/JavaScriptCore/jit/JIT.cpp b/Source/JavaScriptCore/jit/JIT.cpp >index 801d8df72d67cc88f924494e0cabdd342ba2592b..1e1a1524708086628285cdfec891ff5a9883fd3d 100644 >--- a/Source/JavaScriptCore/jit/JIT.cpp >+++ b/Source/JavaScriptCore/jit/JIT.cpp >@@ -99,7 +99,7 @@ void JIT::emitOptimizationCheck(OptimizationCheckKind kind) > if (!shouldEmitProfiling()) > return; > >- Jump skipOptimize = branchAdd32(Signed, TrustedImm32(kind == LoopOptimizationCheck ? Heuristics::executionCounterIncrementForLoop : Heuristics::executionCounterIncrementForReturn), AbsoluteAddress(m_codeBlock->addressOfExecuteCounter())); >+ Jump skipOptimize = branchAdd32(Signed, TrustedImm32(kind == LoopOptimizationCheck ? Options::executionCounterIncrementForLoop : Options::executionCounterIncrementForReturn), AbsoluteAddress(m_codeBlock->addressOfExecuteCounter())); > JITStubCall stubCall(this, kind == LoopOptimizationCheck ? cti_optimize_from_loop : cti_optimize_from_ret); > if (kind == LoopOptimizationCheck) > stubCall.addArgument(Imm32(m_bytecodeOffset)); >diff --git a/Source/JavaScriptCore/jsc.cpp b/Source/JavaScriptCore/jsc.cpp >index fc0c560902b36e8f8b9ff5909040f3bc197732c1..36d3f7a05a5fe1368b29fd5f8f1d5f9cb259e8d2 100644 >--- a/Source/JavaScriptCore/jsc.cpp >+++ b/Source/JavaScriptCore/jsc.cpp >@@ -102,8 +102,8 @@ struct Script { > } > }; > >-struct Options { >- Options() >+struct CommandLine { >+ CommandLine() > : interactive(false) > , dump(false) > { >@@ -548,7 +548,7 @@ static NO_RETURN void printUsageStatement(JSGlobalData* globalData, bool help = > exit(help ? EXIT_SUCCESS : EXIT_FAILURE); > } > >-static void parseArguments(int argc, char** argv, Options& options, JSGlobalData* globalData) >+static void parseArguments(int argc, char** argv, CommandLine& options, JSGlobalData* globalData) > { > int i = 1; > for (; i < argc; ++i) { >@@ -602,7 +602,7 @@ int jscmain(int argc, char** argv, JSGlobalData* globalData) > { > JSLock lock(SilenceAssertionsOnly); > >- Options options; >+ CommandLine options; > parseArguments(argc, argv, options, globalData); > > GlobalObject* globalObject = GlobalObject::create(*globalData, GlobalObject::createStructure(*globalData, jsNull()), options.arguments); >diff --git a/Source/JavaScriptCore/runtime/Heuristics.cpp b/Source/JavaScriptCore/runtime/Heuristics.cpp >deleted file mode 100644 >index b5fdd8a47367070033c54301af3485a5efed27c8..0000000000000000000000000000000000000000 >--- a/Source/JavaScriptCore/runtime/Heuristics.cpp >+++ /dev/null >@@ -1,211 +0,0 @@ >-/* >- * Copyright (C) 2011 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#include "config.h" >-#include "Heuristics.h" >-#include <wtf/PageBlock.h> >- >-#include <limits> >- >-#if OS(DARWIN) && ENABLE(PARALLEL_GC) >-#include <sys/sysctl.h> >-#endif >- >-// Set to 1 to control the heuristics using environment variables. >-#define ENABLE_RUN_TIME_HEURISTICS 0 >- >-#if ENABLE(RUN_TIME_HEURISTICS) >-#include <stdio.h> >-#include <stdlib.h> >-#include <wtf/StdLibExtras.h> >-#endif >- >-namespace JSC { namespace Heuristics { >- >-unsigned maximumEvalOptimizationCandidateInstructionCount; >-unsigned maximumProgramOptimizationCandidateInstructionCount; >-unsigned maximumFunctionForCallOptimizationCandidateInstructionCount; >-unsigned maximumFunctionForConstructOptimizationCandidateInstructionCount; >- >-unsigned maximumFunctionForCallInlineCandidateInstructionCount; >-unsigned maximumFunctionForConstructInlineCandidateInstructionCount; >- >-unsigned maximumInliningDepth; >- >-int32_t executionCounterValueForOptimizeAfterWarmUp; >-int32_t executionCounterValueForOptimizeAfterLongWarmUp; >-int32_t executionCounterValueForDontOptimizeAnytimeSoon; >-int32_t executionCounterValueForOptimizeSoon; >-int32_t executionCounterValueForOptimizeNextInvocation; >- >-int32_t executionCounterIncrementForLoop; >-int32_t executionCounterIncrementForReturn; >- >-unsigned desiredSpeculativeSuccessFailRatio; >- >-unsigned likelyToTakeSlowCaseThreshold; >-unsigned couldTakeSlowCaseThreshold; >- >-unsigned largeFailCountThresholdBase; >-unsigned largeFailCountThresholdBaseForLoop; >- >-unsigned reoptimizationRetryCounterMax; >-unsigned reoptimizationRetryCounterStep; >- >-unsigned minimumOptimizationDelay; >-unsigned maximumOptimizationDelay; >-double desiredProfileLivenessRate; >-double desiredProfileFullnessRate; >- >-unsigned minimumNumberOfScansBetweenRebalance; >-unsigned gcMarkStackSegmentSize; >-unsigned minimumNumberOfCellsToKeep; >-unsigned maximumNumberOfSharedSegments; >-unsigned sharedStackWakeupThreshold; >-unsigned numberOfGCMarkers; >-unsigned opaqueRootMergeThreshold; >- >-#if ENABLE(RUN_TIME_HEURISTICS) >-static bool parse(const char* string, int32_t& value) >-{ >- return sscanf(string, "%d", &value) == 1; >-} >- >-static bool parse(const char* string, unsigned& value) >-{ >- return sscanf(string, "%u", &value) == 1; >-} >- >-static bool parse(const char* string, double& value) >-{ >- return sscanf(string, "%lf", &value) == 1; >-} >- >-template<typename T, typename U> >-void setHeuristic(T& variable, const char* name, U value) >-{ >- const char* stringValue = getenv(name); >- if (!stringValue) { >- variable = safeCast<T>(value); >- return; >- } >- >- if (parse(stringValue, variable)) >- return; >- >- fprintf(stderr, "WARNING: failed to parse %s=%s\n", name, stringValue); >- variable = safeCast<T>(value); >-} >- >-#define SET(variable, value) setHeuristic(variable, "JSC_" #variable, value) >-#else >-#define SET(variable, value) variable = value >-#endif >- >-void initializeHeuristics() >-{ >- // FIXME: Must revisit these heuristics! The DFG, being an optimizing compiler, may >- // take a long time for pathologically huge code blocks. The best way to cope with >- // this is to refuse to optimize them. >- SET(maximumEvalOptimizationCandidateInstructionCount, std::numeric_limits<unsigned>::max()); >- SET(maximumProgramOptimizationCandidateInstructionCount, std::numeric_limits<unsigned>::max()); >- SET(maximumFunctionForCallOptimizationCandidateInstructionCount, std::numeric_limits<unsigned>::max()); >- SET(maximumFunctionForConstructOptimizationCandidateInstructionCount, std::numeric_limits<unsigned>::max()); >- >- SET(maximumFunctionForCallInlineCandidateInstructionCount, 150); >- SET(maximumFunctionForConstructInlineCandidateInstructionCount, 80); >- >- SET(maximumInliningDepth, 5); >- >- SET(executionCounterValueForOptimizeAfterWarmUp, -1000); >- SET(executionCounterValueForOptimizeAfterLongWarmUp, -5000); >- SET(executionCounterValueForDontOptimizeAnytimeSoon, std::numeric_limits<int32_t>::min()); >- SET(executionCounterValueForOptimizeSoon, -1000); >- SET(executionCounterValueForOptimizeNextInvocation, 0); >- >- SET(executionCounterIncrementForLoop, 1); >- SET(executionCounterIncrementForReturn, 15); >- >- SET(desiredSpeculativeSuccessFailRatio, 6); >- >- SET(likelyToTakeSlowCaseThreshold, 100); >- SET(couldTakeSlowCaseThreshold, 10); // Shouldn't be zero because some ops will spuriously take slow case, for example for linking or caching. >- >- SET(largeFailCountThresholdBase, 20); >- SET(largeFailCountThresholdBaseForLoop, 1); >- >- SET(reoptimizationRetryCounterStep, 1); >- >- SET(minimumOptimizationDelay, 1); >- SET(maximumOptimizationDelay, 5); >- SET(desiredProfileLivenessRate, 0.75); >- SET(desiredProfileFullnessRate, 0.35); >- >- SET(minimumNumberOfScansBetweenRebalance, 10000); >- SET(gcMarkStackSegmentSize, pageSize()); >- SET(minimumNumberOfCellsToKeep, 10); >- SET(maximumNumberOfSharedSegments, 3); >- SET(sharedStackWakeupThreshold, 1); >- SET(opaqueRootMergeThreshold, 1000); >- >- int cpusToUse = 1; >-#if OS(DARWIN) && ENABLE(PARALLEL_GC) >- int name[2]; >- size_t valueSize = sizeof(cpusToUse); >- name[0] = CTL_HW; >- name[1] = HW_AVAILCPU; >- sysctl(name, 2, &cpusToUse, &valueSize, 0, 0); >-#endif >- // We don't scale so well beyond 4. >- if (cpusToUse > 4) >- cpusToUse = 4; >- // Be paranoid, it is the OS we're dealing with, after all. >- if (cpusToUse < 1) >- cpusToUse = 1; >- >- SET(numberOfGCMarkers, cpusToUse); >- >- ASSERT(executionCounterValueForDontOptimizeAnytimeSoon <= executionCounterValueForOptimizeAfterLongWarmUp); >- ASSERT(executionCounterValueForOptimizeAfterLongWarmUp <= executionCounterValueForOptimizeAfterWarmUp); >- ASSERT(executionCounterValueForOptimizeAfterWarmUp <= executionCounterValueForOptimizeSoon); >- ASSERT(executionCounterValueForOptimizeAfterWarmUp < 0); >- ASSERT(executionCounterValueForOptimizeSoon <= executionCounterValueForOptimizeNextInvocation); >- >- // Compute the maximum value of the reoptimization retry counter. This is simply >- // the largest value at which we don't overflow the execute counter, when using it >- // to left-shift the execution counter by this amount. Currently the value ends >- // up being 18, so this loop is not so terrible; it probably takes up ~100 cycles >- // total on a 32-bit processor. >- reoptimizationRetryCounterMax = 0; >- while ((static_cast<int64_t>(executionCounterValueForOptimizeAfterLongWarmUp) << (reoptimizationRetryCounterMax + 1)) >= static_cast<int64_t>(std::numeric_limits<int32_t>::min())) >- reoptimizationRetryCounterMax++; >- >- ASSERT((static_cast<int64_t>(executionCounterValueForOptimizeAfterLongWarmUp) << reoptimizationRetryCounterMax) < 0); >- ASSERT((static_cast<int64_t>(executionCounterValueForOptimizeAfterLongWarmUp) << reoptimizationRetryCounterMax) >= static_cast<int64_t>(std::numeric_limits<int32_t>::min())); >-} >- >-} } // namespace JSC::Heuristics >- >- >diff --git a/Source/JavaScriptCore/runtime/Heuristics.h b/Source/JavaScriptCore/runtime/Heuristics.h >deleted file mode 100644 >index a14859fa8dca12acc1dd3005bca79ba2838b70e1..0000000000000000000000000000000000000000 >--- a/Source/JavaScriptCore/runtime/Heuristics.h >+++ /dev/null >@@ -1,81 +0,0 @@ >-/* >- * Copyright (C) 2011 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#ifndef Heuristics_h >-#define Heuristics_h >- >-#include <stdint.h> >- >-namespace JSC { namespace Heuristics { >- >-extern unsigned maximumEvalOptimizationCandidateInstructionCount; >-extern unsigned maximumProgramOptimizationCandidateInstructionCount; >-extern unsigned maximumFunctionForCallOptimizationCandidateInstructionCount; >-extern unsigned maximumFunctionForConstructOptimizationCandidateInstructionCount; >- >-extern unsigned maximumFunctionForCallInlineCandidateInstructionCount; >-extern unsigned maximumFunctionForConstructInlineCandidateInstructionCount; >- >-extern unsigned maximumInliningDepth; // Depth of inline stack, so 1 = no inlining, 2 = one level, etc. >- >-extern int32_t executionCounterValueForOptimizeAfterWarmUp; >-extern int32_t executionCounterValueForOptimizeAfterLongWarmUp; >-extern int32_t executionCounterValueForDontOptimizeAnytimeSoon; >-extern int32_t executionCounterValueForOptimizeSoon; >-extern int32_t executionCounterValueForOptimizeNextInvocation; >- >-extern int32_t executionCounterIncrementForLoop; >-extern int32_t executionCounterIncrementForReturn; >- >-extern unsigned desiredSpeculativeSuccessFailRatio; >- >-extern unsigned likelyToTakeSlowCaseThreshold; >-extern unsigned couldTakeSlowCaseThreshold; >- >-extern unsigned largeFailCountThresholdBase; >-extern unsigned largeFailCountThresholdBaseForLoop; >- >-extern unsigned reoptimizationRetryCounterMax; >-extern unsigned reoptimizationRetryCounterStep; >- >-extern unsigned minimumOptimizationDelay; >-extern unsigned maximumOptimizationDelay; >-extern double desiredProfileLivenessRate; >-extern double desiredProfileFullnessRate; >- >-extern unsigned minimumNumberOfScansBetweenRebalance; >-extern unsigned gcMarkStackSegmentSize; >-extern unsigned minimumNumberOfCellsToKeep; >-extern unsigned maximumNumberOfSharedSegments; >-extern unsigned sharedStackWakeupThreshold; >-extern unsigned numberOfGCMarkers; >-extern unsigned opaqueRootMergeThreshold; >- >-void initializeHeuristics(); >- >-} } // namespace JSC::Heuristics >- >-#endif // Heuristics_h >- >diff --git a/Source/JavaScriptCore/runtime/InitializeThreading.cpp b/Source/JavaScriptCore/runtime/InitializeThreading.cpp >index 3a371f950d3ce3a0753d80df8b2b94356c3f5dd8..6989572be8b9ba49c100564de1f86822612f53a5 100644 >--- a/Source/JavaScriptCore/runtime/InitializeThreading.cpp >+++ b/Source/JavaScriptCore/runtime/InitializeThreading.cpp >@@ -31,7 +31,7 @@ > > #include "ExecutableAllocator.h" > #include "Heap.h" >-#include "Heuristics.h" >+#include "Options.h" > #include "Identifier.h" > #include "JSDateMath.h" > #include "JSGlobalObject.h" >@@ -53,7 +53,7 @@ static void initializeThreadingOnce() > { > WTF::double_conversion::initialize(); > WTF::initializeThreading(); >- Heuristics::initializeHeuristics(); >+ Options::initializeOptions(); > #if ENABLE(WRITE_BARRIER_PROFILING) > WriteBarrierCounters::initialize(); > #endif >diff --git a/Source/JavaScriptCore/runtime/Options.cpp b/Source/JavaScriptCore/runtime/Options.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..a00db9c7f6b2b5f14d05a7f8b4cfe08f0912a2ba >--- /dev/null >+++ b/Source/JavaScriptCore/runtime/Options.cpp >@@ -0,0 +1,211 @@ >+/* >+ * Copyright (C) 2011 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "Options.h" >+ >+#include <limits> >+#include <wtf/PageBlock.h> >+ >+#if OS(DARWIN) && ENABLE(PARALLEL_GC) >+#include <sys/sysctl.h> >+#endif >+ >+// Set to 1 to control the heuristics using environment variables. >+#define ENABLE_RUN_TIME_HEURISTICS 0 >+ >+#if ENABLE(RUN_TIME_HEURISTICS) >+#include <stdio.h> >+#include <stdlib.h> >+#include <wtf/StdLibExtras.h> >+#endif >+ >+namespace JSC { namespace Options { >+ >+unsigned maximumEvalOptimizationCandidateInstructionCount; >+unsigned maximumProgramOptimizationCandidateInstructionCount; >+unsigned maximumFunctionForCallOptimizationCandidateInstructionCount; >+unsigned maximumFunctionForConstructOptimizationCandidateInstructionCount; >+ >+unsigned maximumFunctionForCallInlineCandidateInstructionCount; >+unsigned maximumFunctionForConstructInlineCandidateInstructionCount; >+ >+unsigned maximumInliningDepth; >+ >+int32_t executionCounterValueForOptimizeAfterWarmUp; >+int32_t executionCounterValueForOptimizeAfterLongWarmUp; >+int32_t executionCounterValueForDontOptimizeAnytimeSoon; >+int32_t executionCounterValueForOptimizeSoon; >+int32_t executionCounterValueForOptimizeNextInvocation; >+ >+int32_t executionCounterIncrementForLoop; >+int32_t executionCounterIncrementForReturn; >+ >+unsigned desiredSpeculativeSuccessFailRatio; >+ >+unsigned likelyToTakeSlowCaseThreshold; >+unsigned couldTakeSlowCaseThreshold; >+ >+unsigned largeFailCountThresholdBase; >+unsigned largeFailCountThresholdBaseForLoop; >+ >+unsigned reoptimizationRetryCounterMax; >+unsigned reoptimizationRetryCounterStep; >+ >+unsigned minimumOptimizationDelay; >+unsigned maximumOptimizationDelay; >+double desiredProfileLivenessRate; >+double desiredProfileFullnessRate; >+ >+unsigned minimumNumberOfScansBetweenRebalance; >+unsigned gcMarkStackSegmentSize; >+unsigned minimumNumberOfCellsToKeep; >+unsigned maximumNumberOfSharedSegments; >+unsigned sharedStackWakeupThreshold; >+unsigned numberOfGCMarkers; >+unsigned opaqueRootMergeThreshold; >+ >+#if ENABLE(RUN_TIME_HEURISTICS) >+static bool parse(const char* string, int32_t& value) >+{ >+ return sscanf(string, "%d", &value) == 1; >+} >+ >+static bool parse(const char* string, unsigned& value) >+{ >+ return sscanf(string, "%u", &value) == 1; >+} >+ >+static bool parse(const char* string, double& value) >+{ >+ return sscanf(string, "%lf", &value) == 1; >+} >+ >+template<typename T, typename U> >+void setHeuristic(T& variable, const char* name, U value) >+{ >+ const char* stringValue = getenv(name); >+ if (!stringValue) { >+ variable = safeCast<T>(value); >+ return; >+ } >+ >+ if (parse(stringValue, variable)) >+ return; >+ >+ fprintf(stderr, "WARNING: failed to parse %s=%s\n", name, stringValue); >+ variable = safeCast<T>(value); >+} >+ >+#define SET(variable, value) setHeuristic(variable, "JSC_" #variable, value) >+#else >+#define SET(variable, value) variable = value >+#endif >+ >+void initializeOptions() >+{ >+ // FIXME: Must revisit these heuristics! The DFG, being an optimizing compiler, may >+ // take a long time for pathologically huge code blocks. The best way to cope with >+ // this is to refuse to optimize them. >+ SET(maximumEvalOptimizationCandidateInstructionCount, std::numeric_limits<unsigned>::max()); >+ SET(maximumProgramOptimizationCandidateInstructionCount, std::numeric_limits<unsigned>::max()); >+ SET(maximumFunctionForCallOptimizationCandidateInstructionCount, std::numeric_limits<unsigned>::max()); >+ SET(maximumFunctionForConstructOptimizationCandidateInstructionCount, std::numeric_limits<unsigned>::max()); >+ >+ SET(maximumFunctionForCallInlineCandidateInstructionCount, 150); >+ SET(maximumFunctionForConstructInlineCandidateInstructionCount, 80); >+ >+ SET(maximumInliningDepth, 5); >+ >+ SET(executionCounterValueForOptimizeAfterWarmUp, -1000); >+ SET(executionCounterValueForOptimizeAfterLongWarmUp, -5000); >+ SET(executionCounterValueForDontOptimizeAnytimeSoon, std::numeric_limits<int32_t>::min()); >+ SET(executionCounterValueForOptimizeSoon, -1000); >+ SET(executionCounterValueForOptimizeNextInvocation, 0); >+ >+ SET(executionCounterIncrementForLoop, 1); >+ SET(executionCounterIncrementForReturn, 15); >+ >+ SET(desiredSpeculativeSuccessFailRatio, 6); >+ >+ SET(likelyToTakeSlowCaseThreshold, 100); >+ SET(couldTakeSlowCaseThreshold, 10); // Shouldn't be zero because some ops will spuriously take slow case, for example for linking or caching. >+ >+ SET(largeFailCountThresholdBase, 20); >+ SET(largeFailCountThresholdBaseForLoop, 1); >+ >+ SET(reoptimizationRetryCounterStep, 1); >+ >+ SET(minimumOptimizationDelay, 1); >+ SET(maximumOptimizationDelay, 5); >+ SET(desiredProfileLivenessRate, 0.75); >+ SET(desiredProfileFullnessRate, 0.35); >+ >+ SET(minimumNumberOfScansBetweenRebalance, 10000); >+ SET(gcMarkStackSegmentSize, pageSize()); >+ SET(minimumNumberOfCellsToKeep, 10); >+ SET(maximumNumberOfSharedSegments, 3); >+ SET(sharedStackWakeupThreshold, 1); >+ SET(opaqueRootMergeThreshold, 1000); >+ >+ int cpusToUse = 1; >+#if OS(DARWIN) && ENABLE(PARALLEL_GC) >+ int name[2]; >+ size_t valueSize = sizeof(cpusToUse); >+ name[0] = CTL_HW; >+ name[1] = HW_AVAILCPU; >+ sysctl(name, 2, &cpusToUse, &valueSize, 0, 0); >+#endif >+ // We don't scale so well beyond 4. >+ if (cpusToUse > 4) >+ cpusToUse = 4; >+ // Be paranoid, it is the OS we're dealing with, after all. >+ if (cpusToUse < 1) >+ cpusToUse = 1; >+ >+ SET(numberOfGCMarkers, cpusToUse); >+ >+ ASSERT(executionCounterValueForDontOptimizeAnytimeSoon <= executionCounterValueForOptimizeAfterLongWarmUp); >+ ASSERT(executionCounterValueForOptimizeAfterLongWarmUp <= executionCounterValueForOptimizeAfterWarmUp); >+ ASSERT(executionCounterValueForOptimizeAfterWarmUp <= executionCounterValueForOptimizeSoon); >+ ASSERT(executionCounterValueForOptimizeAfterWarmUp < 0); >+ ASSERT(executionCounterValueForOptimizeSoon <= executionCounterValueForOptimizeNextInvocation); >+ >+ // Compute the maximum value of the reoptimization retry counter. This is simply >+ // the largest value at which we don't overflow the execute counter, when using it >+ // to left-shift the execution counter by this amount. Currently the value ends >+ // up being 18, so this loop is not so terrible; it probably takes up ~100 cycles >+ // total on a 32-bit processor. >+ reoptimizationRetryCounterMax = 0; >+ while ((static_cast<int64_t>(executionCounterValueForOptimizeAfterLongWarmUp) << (reoptimizationRetryCounterMax + 1)) >= static_cast<int64_t>(std::numeric_limits<int32_t>::min())) >+ reoptimizationRetryCounterMax++; >+ >+ ASSERT((static_cast<int64_t>(executionCounterValueForOptimizeAfterLongWarmUp) << reoptimizationRetryCounterMax) < 0); >+ ASSERT((static_cast<int64_t>(executionCounterValueForOptimizeAfterLongWarmUp) << reoptimizationRetryCounterMax) >= static_cast<int64_t>(std::numeric_limits<int32_t>::min())); >+} >+ >+} } // namespace JSC::Options >+ >+ >diff --git a/Source/JavaScriptCore/runtime/Options.h b/Source/JavaScriptCore/runtime/Options.h >new file mode 100644 >index 0000000000000000000000000000000000000000..109b3921293282c125b957f12bb4eb5ba5cfe1ac >--- /dev/null >+++ b/Source/JavaScriptCore/runtime/Options.h >@@ -0,0 +1,81 @@ >+/* >+ * Copyright (C) 2011 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef Options_h >+#define Options_h >+ >+#include <stdint.h> >+ >+namespace JSC { namespace Options { >+ >+extern unsigned maximumEvalOptimizationCandidateInstructionCount; >+extern unsigned maximumProgramOptimizationCandidateInstructionCount; >+extern unsigned maximumFunctionForCallOptimizationCandidateInstructionCount; >+extern unsigned maximumFunctionForConstructOptimizationCandidateInstructionCount; >+ >+extern unsigned maximumFunctionForCallInlineCandidateInstructionCount; >+extern unsigned maximumFunctionForConstructInlineCandidateInstructionCount; >+ >+extern unsigned maximumInliningDepth; // Depth of inline stack, so 1 = no inlining, 2 = one level, etc. >+ >+extern int32_t executionCounterValueForOptimizeAfterWarmUp; >+extern int32_t executionCounterValueForOptimizeAfterLongWarmUp; >+extern int32_t executionCounterValueForDontOptimizeAnytimeSoon; >+extern int32_t executionCounterValueForOptimizeSoon; >+extern int32_t executionCounterValueForOptimizeNextInvocation; >+ >+extern int32_t executionCounterIncrementForLoop; >+extern int32_t executionCounterIncrementForReturn; >+ >+extern unsigned desiredSpeculativeSuccessFailRatio; >+ >+extern unsigned likelyToTakeSlowCaseThreshold; >+extern unsigned couldTakeSlowCaseThreshold; >+ >+extern unsigned largeFailCountThresholdBase; >+extern unsigned largeFailCountThresholdBaseForLoop; >+ >+extern unsigned reoptimizationRetryCounterMax; >+extern unsigned reoptimizationRetryCounterStep; >+ >+extern unsigned minimumOptimizationDelay; >+extern unsigned maximumOptimizationDelay; >+extern double desiredProfileLivenessRate; >+extern double desiredProfileFullnessRate; >+ >+extern unsigned minimumNumberOfScansBetweenRebalance; >+extern unsigned gcMarkStackSegmentSize; >+extern unsigned minimumNumberOfCellsToKeep; >+extern unsigned maximumNumberOfSharedSegments; >+extern unsigned sharedStackWakeupThreshold; >+extern unsigned numberOfGCMarkers; >+extern unsigned opaqueRootMergeThreshold; >+ >+void initializeOptions(); >+ >+} } // namespace JSC::Options >+ >+#endif // Options_h >+ >diff --git a/Source/JavaScriptCore/testRegExp.cpp b/Source/JavaScriptCore/testRegExp.cpp >index 7f9fa7aac2a95d9f3ae8322e364cad2cd3c35239..cfdd9a1f5ef12b16423b7f45726fcd149430a446 100644 >--- a/Source/JavaScriptCore/testRegExp.cpp >+++ b/Source/JavaScriptCore/testRegExp.cpp >@@ -56,8 +56,8 @@ using namespace WTF; > > static void cleanupGlobalData(JSGlobalData*); > >-struct Options { >- Options() >+struct CommandLine { >+ CommandLine() > : interactive(false) > , verbose(false) > { >@@ -490,7 +490,7 @@ static NO_RETURN void printUsageStatement(JSGlobalData* globalData, bool help = > exit(help ? EXIT_SUCCESS : EXIT_FAILURE); > } > >-static void parseArguments(int argc, char** argv, Options& options, JSGlobalData* globalData) >+static void parseArguments(int argc, char** argv, CommandLine& options, JSGlobalData* globalData) > { > int i = 1; > for (; i < argc; ++i) { >@@ -511,7 +511,7 @@ int realMain(int argc, char** argv, JSGlobalData* globalData) > { > JSLock lock(SilenceAssertionsOnly); > >- Options options; >+ CommandLine options; > parseArguments(argc, argv, options, globalData); > > GlobalObject* globalObject = GlobalObject::create(*globalData, GlobalObject::createStructure(*globalData, jsNull()), options.arguments);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 72889
:
116096
|
116104
|
116193
|
116194
|
116196
|
116496
|
116979
|
118760
|
119194
|
119198
|
119205
|
119211