JSC profiler should show reasons for jettison
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Feb 2014 02:25:13 +0000 (02:25 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Feb 2014 02:25:13 +0000 (02:25 +0000)
commit8d5fb86007ff7662a6d4dbd24225b480630c4f21
tree2a59199649eaee3d69afb6e10c33fbebbc025639
parent7d516c5ac49b84c6312b6159f7be0279afd7a915
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163254 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/GNUmakefile.list.am
Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/bytecode/CodeBlock.cpp
Source/JavaScriptCore/bytecode/CodeBlock.h
Source/JavaScriptCore/bytecode/CodeBlockJettisoningWatchpoint.cpp
Source/JavaScriptCore/bytecode/ProfiledCodeBlockJettisoningWatchpoint.cpp
Source/JavaScriptCore/dfg/DFGOperations.cpp
Source/JavaScriptCore/jit/JITOperations.cpp
Source/JavaScriptCore/profiler/ProfilerCompilation.cpp
Source/JavaScriptCore/profiler/ProfilerCompilation.h
Source/JavaScriptCore/profiler/ProfilerJettisonReason.cpp [new file with mode: 0644]
Source/JavaScriptCore/profiler/ProfilerJettisonReason.h [new file with mode: 0644]
Source/JavaScriptCore/runtime/CommonIdentifiers.h
Source/JavaScriptCore/runtime/VM.cpp
Tools/ChangeLog
Tools/Scripts/display-profiler-output