Ignore:
Timestamp:
Jun 25, 2012, 7:14:07 PM (13 years ago)
Author:
[email protected]
Message:

Value profiling should use tier-up threshold randomization to get more coverage
https://bugs.webkit.org/show_bug.cgi?id=89802

Source/JavaScriptCore:

Reviewed by Gavin Barraclough.

This patch causes both LLInt and Baseline JIT code to take the OSR slow path several
times before actually doing OSR. If we take the OSR slow path before the execution
count threshold is reached, then we just call CodeBlock::updateAllPredictions() to
compute the current latest least-upper-bound SpecType of all values seen in each
ValueProfile.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::stronglyVisitStrongReferences):
(JSC::CodeBlock::updateAllPredictionsAndCountLiveness):
(JSC):
(JSC::CodeBlock::updateAllPredictions):
(JSC::CodeBlock::shouldOptimizeNow):

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::llintExecuteCounter):
(JSC::CodeBlock::jitExecuteCounter):
(CodeBlock):
(JSC::CodeBlock::updateAllPredictions):

  • bytecode/ExecutionCounter.cpp:

(JSC::ExecutionCounter::setThreshold):
(JSC::ExecutionCounter::status):
(JSC):

  • bytecode/ExecutionCounter.h:

(JSC::ExecutionCounter::count):
(ExecutionCounter):

  • dfg/DFGAbstractState.cpp:

(JSC::DFG::AbstractState::execute):

  • dfg/DFGOperations.cpp:
  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::jitCompileAndSetHeuristics):
(JSC::LLInt::entryOSR):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::JSGlobalObject):
(JSC):

  • runtime/JSGlobalObject.h:

(JSGlobalObject):
(JSC::JSGlobalObject::weakRandomInteger):

  • runtime/Options.cpp:

(Options):
(JSC::Options::initializeOptions):

  • runtime/Options.h:

(Options):

  • runtime/WeakRandom.h:

(WeakRandom):
(JSC::WeakRandom::seedUnsafe):

LayoutTests:

Reviewed by Gavin Barraclough.

  • fast/js/dfg-store-unexpected-value-into-argument-and-osr-exit-expected.txt: Added.
  • fast/js/dfg-store-unexpected-value-into-argument-and-osr-exit.html: Added.
  • fast/js/script-tests/dfg-store-unexpected-value-into-argument-and-osr-exit.js: Added.

(foo):

File:
1 edited

Legend:

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

    r121073 r121215  
    914914        }
    915915       
    916         int32_t llintExecuteCounter() const
    917         {
    918             return m_llintExecuteCounter.m_counter;
     916        const ExecutionCounter& llintExecuteCounter() const
     917        {
     918            return m_llintExecuteCounter;
    919919        }
    920920       
     
    972972        static ptrdiff_t offsetOfJITExecutionTotalCount() { return OBJECT_OFFSETOF(CodeBlock, m_jitExecuteCounter) + OBJECT_OFFSETOF(ExecutionCounter, m_totalCount); }
    973973
    974         int32_t jitExecuteCounter() const { return m_jitExecuteCounter.m_counter; }
     974        const ExecutionCounter& jitExecuteCounter() const { return m_jitExecuteCounter; }
    975975       
    976976        unsigned optimizationDelayCounter() const { return m_optimizationDelayCounter; }
     
    11011101#if ENABLE(VALUE_PROFILER)
    11021102        bool shouldOptimizeNow();
     1103        void updateAllPredictions(OperationInProgress = NoOperation);
    11031104#else
    11041105        bool shouldOptimizeNow() { return false; }
     1106        void updateAllPredictions(OperationInProgress = NoOperation) { }
    11051107#endif
    11061108       
     
    11341136#else
    11351137        void tallyFrequentExitSites() { }
     1138#endif
     1139#if ENABLE(VALUE_PROFILER)
     1140        void updateAllPredictionsAndCountLiveness(OperationInProgress, unsigned& numberOfLiveNonArgumentValueProfiles, unsigned& numberOfSamplesInProfiles);
    11361141#endif
    11371142       
Note: See TracChangeset for help on using the changeset viewer.