Ignore:
Timestamp:
Feb 1, 2014, 6:25:13 PM (11 years ago)
Author:
[email protected]
Message:

JSC profiler should show reasons for jettison
https://bugs.webkit.org/show_bug.cgi?id=128047

Source/JavaScriptCore:

Reviewed by Geoffrey Garen.

Henceforth if you want to jettison a CodeBlock, you gotta tell the Profiler why you did
it. This makes figuring out convergence issues - where some code seems to take a long
time to get into the top tier compiler - a lot easier.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::finalizeUnconditionally):
(JSC::CodeBlock::jettison):
(JSC::CodeBlock::addBreakpoint):
(JSC::CodeBlock::setSteppingMode):

  • bytecode/CodeBlock.h:
  • bytecode/CodeBlockJettisoningWatchpoint.cpp:

(JSC::CodeBlockJettisoningWatchpoint::fireInternal):

  • bytecode/ProfiledCodeBlockJettisoningWatchpoint.cpp:

(JSC::ProfiledCodeBlockJettisoningWatchpoint::fireInternal):

  • dfg/DFGOperations.cpp:
  • jit/JITOperations.cpp:
  • profiler/ProfilerCompilation.cpp:

(JSC::Profiler::Compilation::Compilation):
(JSC::Profiler::Compilation::toJS):

  • profiler/ProfilerCompilation.h:

(JSC::Profiler::Compilation::setJettisonReason):

  • profiler/ProfilerJettisonReason.cpp: Added.

(WTF::printInternal):

  • profiler/ProfilerJettisonReason.h: Added.
  • runtime/CommonIdentifiers.h:
  • runtime/VM.cpp:

(JSC::SetEnabledProfilerFunctor::operator()):

Tools:

Reviewed by Geoffrey Garen.

Gave the tool a "log" command, that tells you all of the interesting things
that happened to a piece of bytecode, from the standpoint of optimization.
It's a great summary view for seeing how our tier-up machinery works.

This uses a lot of information that was already available, plus the newly
added jettisonReason field.

  • Scripts/display-profiler-output:
Location:
trunk/Source/JavaScriptCore/profiler
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.cpp

    r163027 r163254  
    3838    : m_bytecodes(bytecodes)
    3939    , m_kind(kind)
     40    , m_jettisonReason(NotJettisoned)
    4041    , m_numInlinedGetByIds(0)
    4142    , m_numInlinedPutByIds(0)
     
    132133    result->putDirect(exec->vm(), exec->propertyNames().numInlinedPutByIds, jsNumber(m_numInlinedPutByIds));
    133134    result->putDirect(exec->vm(), exec->propertyNames().numInlinedCalls, jsNumber(m_numInlinedCalls));
     135    result->putDirect(exec->vm(), exec->propertyNames().jettisonReason, jsString(exec, String::fromUTF8(toCString(m_jettisonReason))));
    134136   
    135137    return result;
  • trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.h

    r163027 r163254  
    3232#include "ProfilerCompiledBytecode.h"
    3333#include "ProfilerExecutionCounter.h"
     34#include "ProfilerJettisonReason.h"
    3435#include "ProfilerOSRExit.h"
    3536#include "ProfilerOSRExitSite.h"
     
    6970    OSRExit* addOSRExit(unsigned id, const OriginStack&, ExitKind, bool isWatchpoint);
    7071   
     72    void setJettisonReason(JettisonReason jettisonReason)
     73    {
     74        m_jettisonReason = jettisonReason;
     75    }
     76   
    7177    JSValue toJS(ExecState*) const;
    7278   
     
    7480    Bytecodes* m_bytecodes;
    7581    CompilationKind m_kind;
     82    JettisonReason m_jettisonReason;
    7683    Vector<ProfiledBytecodes> m_profiledBytecodes;
    7784    Vector<CompiledBytecode> m_descriptions;
Note: See TracChangeset for help on using the changeset viewer.