Ignore:
Timestamp:
Jul 3, 2012, 12:19:22 PM (13 years ago)
Author:
[email protected]
Message:

Add ability to symbolically set and dump JSC VM options.
See comments in runtime/Options.h for details on how the options work.
https://bugs.webkit.org/show_bug.cgi?id=90420

Patch by Mark Lam <[email protected]> on 2012-07-03
Reviewed by Filip Pizlo.

  • assembler/LinkBuffer.cpp:

(JSC::LinkBuffer::finalizeCodeWithDisassembly):

  • assembler/LinkBuffer.h:

(JSC):

  • 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::jitAfterWarmUp):
(JSC::CodeBlock::jitSoon):
(JSC::CodeBlock::reoptimizationRetryCounter):
(JSC::CodeBlock::countReoptimization):
(JSC::CodeBlock::counterValueForOptimizeAfterWarmUp):
(JSC::CodeBlock::counterValueForOptimizeAfterLongWarmUp):
(JSC::CodeBlock::optimizeSoon):
(JSC::CodeBlock::exitCountThresholdForReoptimization):
(JSC::CodeBlock::exitCountThresholdForReoptimizationFromLoop):

  • bytecode/ExecutionCounter.h:

(JSC::ExecutionCounter::clippedThreshold):

  • 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/DFGCommon.h:

(JSC::DFG::shouldShowDisassembly):

  • dfg/DFGDriver.cpp:

(JSC::DFG::compile):

  • dfg/DFGOSRExit.cpp:

(JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):

  • dfg/DFGVariableAccessData.h:

(JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):

  • heap/MarkStack.cpp:

(JSC::MarkStackSegmentAllocator::allocate):
(JSC::MarkStackSegmentAllocator::shrinkReserve):
(JSC::MarkStackArray::MarkStackArray):
(JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
(JSC::SlotVisitor::donateKnownParallel):
(JSC::SlotVisitor::drain):
(JSC::SlotVisitor::drainFromShared):

  • heap/MarkStack.h:

(JSC::MarkStack::mergeOpaqueRootsIfProfitable):
(JSC::MarkStack::addOpaqueRoot):

  • heap/SlotVisitor.h:

(JSC::SlotVisitor::donate):

  • jit/JIT.cpp:

(JSC::JIT::emitOptimizationCheck):

  • jsc.cpp:

(printUsageStatement):
(parseArguments):

  • runtime/InitializeThreading.cpp:

(JSC::initializeThreadingOnce):

  • runtime/JSGlobalData.cpp:

(JSC::enableAssembler):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::JSGlobalObject):

  • runtime/Options.cpp:

(JSC):
(JSC::overrideOptionWithHeuristic):
(JSC::Options::initialize):
(JSC::Options::setOption):
(JSC::Options::dumpAllOptions):
(JSC::Options::dumpOption):

  • runtime/Options.h:

(JSC):
(Options):
(EntryInfo):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r121717 r121798  
    686686                return false;
    687687            unsigned value = rareCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter;
    688             return value >= Options::likelyToTakeSlowCaseMinimumCount && static_cast<double>(value) / m_executionEntryCount >= Options::likelyToTakeSlowCaseThreshold;
     688            return value >= Options::likelyToTakeSlowCaseMinimumCount() && static_cast<double>(value) / m_executionEntryCount >= Options::likelyToTakeSlowCaseThreshold();
    689689        }
    690690       
     
    694694                return false;
    695695            unsigned value = rareCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter;
    696             return value >= Options::couldTakeSlowCaseMinimumCount && static_cast<double>(value) / m_executionEntryCount >= Options::couldTakeSlowCaseThreshold;
     696            return value >= Options::couldTakeSlowCaseMinimumCount() && static_cast<double>(value) / m_executionEntryCount >= Options::couldTakeSlowCaseThreshold();
    697697        }
    698698       
     
    714714                return false;
    715715            unsigned specialFastCaseCount = specialFastCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter;
    716             return specialFastCaseCount >= Options::likelyToTakeSlowCaseMinimumCount && static_cast<double>(specialFastCaseCount) / m_executionEntryCount >= Options::likelyToTakeSlowCaseThreshold;
     716            return specialFastCaseCount >= Options::likelyToTakeSlowCaseMinimumCount() && static_cast<double>(specialFastCaseCount) / m_executionEntryCount >= Options::likelyToTakeSlowCaseThreshold();
    717717        }
    718718       
     
    724724            unsigned specialFastCaseCount = specialFastCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter;
    725725            unsigned value = slowCaseCount - specialFastCaseCount;
    726             return value >= Options::likelyToTakeSlowCaseMinimumCount && static_cast<double>(value) / m_executionEntryCount >= Options::likelyToTakeSlowCaseThreshold;
     726            return value >= Options::likelyToTakeSlowCaseMinimumCount() && static_cast<double>(value) / m_executionEntryCount >= Options::likelyToTakeSlowCaseThreshold();
    727727        }
    728728       
     
    734734            unsigned specialFastCaseCount = specialFastCaseProfileForBytecodeOffset(bytecodeOffset)->m_counter;
    735735            unsigned value = slowCaseCount + specialFastCaseCount;
    736             return value >= Options::likelyToTakeSlowCaseMinimumCount && static_cast<double>(value) / m_executionEntryCount >= Options::likelyToTakeSlowCaseThreshold;
     736            return value >= Options::likelyToTakeSlowCaseMinimumCount() && static_cast<double>(value) / m_executionEntryCount >= Options::likelyToTakeSlowCaseThreshold();
    737737        }
    738738       
     
    956956        void jitAfterWarmUp()
    957957        {
    958             m_llintExecuteCounter.setNewThreshold(Options::thresholdForJITAfterWarmUp, this);
     958            m_llintExecuteCounter.setNewThreshold(Options::thresholdForJITAfterWarmUp(), this);
    959959        }
    960960       
    961961        void jitSoon()
    962962        {
    963             m_llintExecuteCounter.setNewThreshold(Options::thresholdForJITSoon, this);
     963            m_llintExecuteCounter.setNewThreshold(Options::thresholdForJITSoon(), this);
    964964        }
    965965       
     
    992992        unsigned reoptimizationRetryCounter() const
    993993        {
    994             ASSERT(m_reoptimizationRetryCounter <= Options::reoptimizationRetryCounterMax);
     994            ASSERT(m_reoptimizationRetryCounter <= Options::reoptimizationRetryCounterMax());
    995995            return m_reoptimizationRetryCounter;
    996996        }
     
    999999        {
    10001000            m_reoptimizationRetryCounter++;
    1001             if (m_reoptimizationRetryCounter > Options::reoptimizationRetryCounterMax)
    1002                 m_reoptimizationRetryCounter = Options::reoptimizationRetryCounterMax;
     1001            if (m_reoptimizationRetryCounter > Options::reoptimizationRetryCounterMax())
     1002                m_reoptimizationRetryCounter = Options::reoptimizationRetryCounterMax();
    10031003        }
    10041004       
    10051005        int32_t counterValueForOptimizeAfterWarmUp()
    10061006        {
    1007             return Options::thresholdForOptimizeAfterWarmUp << reoptimizationRetryCounter();
     1007            return Options::thresholdForOptimizeAfterWarmUp() << reoptimizationRetryCounter();
    10081008        }
    10091009       
    10101010        int32_t counterValueForOptimizeAfterLongWarmUp()
    10111011        {
    1012             return Options::thresholdForOptimizeAfterLongWarmUp << reoptimizationRetryCounter();
     1012            return Options::thresholdForOptimizeAfterLongWarmUp() << reoptimizationRetryCounter();
    10131013        }
    10141014       
     
    10901090        void optimizeSoon()
    10911091        {
    1092             m_jitExecuteCounter.setNewThreshold(Options::thresholdForOptimizeSoon << reoptimizationRetryCounter(), this);
     1092            m_jitExecuteCounter.setNewThreshold(Options::thresholdForOptimizeSoon() << reoptimizationRetryCounter(), this);
    10931093        }
    10941094       
     
    11191119        uint32_t exitCountThresholdForReoptimization()
    11201120        {
    1121             return adjustedExitCountThreshold(Options::osrExitCountForReoptimization);
     1121            return adjustedExitCountThreshold(Options::osrExitCountForReoptimization());
    11221122        }
    11231123       
    11241124        uint32_t exitCountThresholdForReoptimizationFromLoop()
    11251125        {
    1126             return adjustedExitCountThreshold(Options::osrExitCountForReoptimizationFromLoop);
     1126            return adjustedExitCountThreshold(Options::osrExitCountForReoptimizationFromLoop());
    11271127        }
    11281128
Note: See TracChangeset for help on using the changeset viewer.