Changeset 207491 in webkit


Ignore:
Timestamp:
Oct 18, 2016 2:28:58 PM (7 years ago)
Author:
msaboff@apple.com
Message:

Add JSC option to show time spent in each optimization phase
https://bugs.webkit.org/show_bug.cgi?id=163617

Reviewed by Saam Barati.

Added reportDFGPhaseTimes option. This outputs one line per phase similar to

Phase CPS rethreading took 0.2661 ms

One line is output for each phase run.

  • dfg/DFGPhase.h:

(JSC::DFG::runAndLog):

  • dfg/DFGPlan.cpp:

(JSC::DFG::Plan::compileInThread):

  • runtime/Options.cpp:

(JSC::recomputeDependentOptions):

  • runtime/Options.h:
Location:
trunk/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r207480 r207491  
     12016-10-18  Michael Saboff  <msaboff@apple.com>
     2
     3        Add JSC option to show time spent in each optimization phase
     4        https://bugs.webkit.org/show_bug.cgi?id=163617
     5
     6        Reviewed by Saam Barati.
     7
     8        Added reportDFGPhaseTimes option.  This outputs one line per phase similar to
     9            Phase CPS rethreading took 0.2661 ms
     10
     11        One line is output for each phase run.
     12
     13        * dfg/DFGPhase.h:
     14        (JSC::DFG::runAndLog):
     15        * dfg/DFGPlan.cpp:
     16        (JSC::DFG::Plan::compileInThread):
     17        * runtime/Options.cpp:
     18        (JSC::recomputeDependentOptions):
     19        * runtime/Options.h:
     20
    1212016-10-18  Filip Pizlo  <fpizlo@apple.com>
    222
  • trunk/Source/JavaScriptCore/dfg/DFGPhase.h

    r206525 r207491  
    7777bool runAndLog(PhaseType& phase)
    7878{
     79    double before = 0;
     80
     81    if (UNLIKELY(Options::reportDFGPhaseTimes()))
     82        before = monotonicallyIncreasingTimeMS();
     83
    7984    bool result = phase.run();
     85
     86    if (UNLIKELY(Options::reportDFGPhaseTimes())) {
     87        double after = monotonicallyIncreasingTimeMS();
     88        dataLogF("Phase %s took %.4f ms\n", phase.name(), after - before);
     89    }
    8090    if (result && logCompilationChanges(phase.graph().m_plan.mode))
    8191        dataLogF("Phase %s changed the IR.\n", phase.name());
  • trunk/Source/JavaScriptCore/dfg/DFGPlan.cpp

    r206555 r207491  
    184184    CompilationScope compilationScope;
    185185
    186     if (logCompilationChanges(mode))
     186    if (logCompilationChanges(mode) || Options::reportDFGPhaseTimes())
    187187        dataLog("DFG(Plan) compiling ", *codeBlock, " with ", mode, ", number of instructions = ", codeBlock->instructionCount(), "\n");
    188188
  • trunk/Source/JavaScriptCore/runtime/Options.cpp

    r207437 r207491  
    350350        || Options::reportDFGCompileTimes()
    351351        || Options::reportFTLCompileTimes()
     352        || Options::reportDFGPhaseTimes()
    352353        || Options::verboseCFA()
    353354        || Options::verboseFTLFailure())
  • trunk/Source/JavaScriptCore/runtime/Options.h

    r207475 r207491  
    174174    v(bool, reportDFGCompileTimes, false, Normal, "dumps JS function signature and the time it took to DFG and FTL compile") \
    175175    v(bool, reportFTLCompileTimes, false, Normal, "dumps JS function signature and the time it took to FTL compile") \
     176    v(bool, reportDFGPhaseTimes, false, Normal, "dumps JS function name and the time is took for each DFG phase") \
    176177    v(bool, reportTotalCompileTimes, false, Normal, nullptr) \
    177178    v(bool, verboseExitProfile, false, Normal, nullptr) \
Note: See TracChangeset for help on using the changeset viewer.