<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[163254] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/163254">163254</a></dd>
<dt>Author</dt> <dd>fpizlo@apple.com</dd>
<dt>Date</dt> <dd>2014-02-01 18:25:13 -0800 (Sat, 01 Feb 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>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:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreGNUmakefilelistam">trunk/Source/JavaScriptCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeCodeBlockcpp">trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeCodeBlockh">trunk/Source/JavaScriptCore/bytecode/CodeBlock.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeCodeBlockJettisoningWatchpointcpp">trunk/Source/JavaScriptCore/bytecode/CodeBlockJettisoningWatchpoint.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeProfiledCodeBlockJettisoningWatchpointcpp">trunk/Source/JavaScriptCore/bytecode/ProfiledCodeBlockJettisoningWatchpoint.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGOperationscpp">trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationscpp">trunk/Source/JavaScriptCore/jit/JITOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfilerCompilationcpp">trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfilerCompilationh">trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCommonIdentifiersh">trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMcpp">trunk/Source/JavaScriptCore/runtime/VM.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsScriptsdisplayprofileroutput">trunk/Tools/Scripts/display-profiler-output</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfilerJettisonReasoncpp">trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfilerJettisonReasonh">trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (163253 => 163254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2014-02-02 02:18:09 UTC (rev 163253)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2014-02-02 02:25:13 UTC (rev 163254)
</span><span class="lines">@@ -304,6 +304,7 @@
</span><span class="cx"> profiler/ProfilerCompilationKind.cpp
</span><span class="cx"> profiler/ProfilerCompiledBytecode.cpp
</span><span class="cx"> profiler/ProfilerDatabase.cpp
</span><ins>+ profiler/ProfilerJettisonReason.cpp
</ins><span class="cx"> profiler/ProfilerOSRExit.cpp
</span><span class="cx"> profiler/ProfilerOSRExitSite.cpp
</span><span class="cx"> profiler/ProfilerOrigin.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (163253 => 163254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-02-02 02:18:09 UTC (rev 163253)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-02-02 02:25:13 UTC (rev 163254)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2014-02-01 Filip Pizlo <fpizlo@apple.com>
+
+ JSC profiler should show reasons for jettison
+ https://bugs.webkit.org/show_bug.cgi?id=128047
+
+ 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()):
+
</ins><span class="cx"> 2014-02-01 Mark Lam <mark.lam@apple.com>
</span><span class="cx">
</span><span class="cx"> Saying "jitType() == JITCode::DFGJIT" is almost never correct.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/GNUmakefile.list.am (163253 => 163254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/GNUmakefile.list.am        2014-02-02 02:18:09 UTC (rev 163253)
+++ trunk/Source/JavaScriptCore/GNUmakefile.list.am        2014-02-02 02:25:13 UTC (rev 163254)
</span><span class="lines">@@ -819,6 +819,8 @@
</span><span class="cx">         Source/JavaScriptCore/profiler/ProfilerDatabase.cpp \
</span><span class="cx">         Source/JavaScriptCore/profiler/ProfilerDatabase.h \
</span><span class="cx">         Source/JavaScriptCore/profiler/ProfilerExecutionCounter.h \
</span><ins>+        Source/JavaScriptCore/profiler/ProfilerJettisonReason.cpp \
+        Source/JavaScriptCore/profiler/ProfilerJettisonReason.h \
</ins><span class="cx">         Source/JavaScriptCore/profiler/ProfilerOrigin.cpp \
</span><span class="cx">         Source/JavaScriptCore/profiler/ProfilerOrigin.h \
</span><span class="cx">         Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj (163253 => 163254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2014-02-02 02:18:09 UTC (rev 163253)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2014-02-02 02:25:13 UTC (rev 163254)
</span><span class="lines">@@ -553,6 +553,7 @@
</span><span class="cx"> <ClCompile Include="..\profiler\ProfilerCompilationKind.cpp" />
</span><span class="cx"> <ClCompile Include="..\profiler\ProfilerCompiledBytecode.cpp" />
</span><span class="cx"> <ClCompile Include="..\profiler\ProfilerDatabase.cpp" />
</span><ins>+ <ClCompile Include="..\profiler\ProfilerJettisonReason.cpp" />
</ins><span class="cx"> <ClCompile Include="..\profiler\ProfilerOrigin.cpp" />
</span><span class="cx"> <ClCompile Include="..\profiler\ProfilerOriginStack.cpp" />
</span><span class="cx"> <ClCompile Include="..\profiler\ProfilerOSRExit.cpp" />
</span><span class="lines">@@ -1163,6 +1164,7 @@
</span><span class="cx"> <ClInclude Include="..\profiler\ProfilerCompiledBytecode.h" />
</span><span class="cx"> <ClInclude Include="..\profiler\ProfilerDatabase.h" />
</span><span class="cx"> <ClInclude Include="..\profiler\ProfilerExecutionCounter.h" />
</span><ins>+ <ClInclude Include="..\profiler\ProfilerJettisonReason.h" />
</ins><span class="cx"> <ClInclude Include="..\profiler\ProfilerOrigin.h" />
</span><span class="cx"> <ClInclude Include="..\profiler\ProfilerOriginStack.h" />
</span><span class="cx"> <ClInclude Include="..\profiler\ProfilerOSRExit.h" />
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (163253 => 163254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-02-02 02:18:09 UTC (rev 163253)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-02-02 02:25:13 UTC (rev 163254)
</span><span class="lines">@@ -81,6 +81,8 @@
</span><span class="cx">                 0F15F15F14B7A73E005DE37D /* CommonSlowPaths.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F15F15D14B7A73A005DE37D /* CommonSlowPaths.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0F16015D156198C900C2587C /* DFGArgumentsSimplificationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F16015A156198BF00C2587C /* DFGArgumentsSimplificationPhase.cpp */; };
</span><span class="cx">                 0F16015E156198C900C2587C /* DFGArgumentsSimplificationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F16015B156198BF00C2587C /* DFGArgumentsSimplificationPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                0F190CAC189D82F6000AE5F0 /* ProfilerJettisonReason.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F190CAA189D82F6000AE5F0 /* ProfilerJettisonReason.cpp */; };
+                0F190CAD189D82F6000AE5F0 /* ProfilerJettisonReason.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F190CAB189D82F6000AE5F0 /* ProfilerJettisonReason.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 0F1E3A461534CBAF000F9456 /* DFGArgumentPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F1E3A431534CBAD000F9456 /* DFGArgumentPosition.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0F1E3A471534CBB9000F9456 /* DFGDoubleFormatState.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F1E3A441534CBAD000F9456 /* DFGDoubleFormatState.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0F1E3A67153A21E2000F9456 /* DFGSilentRegisterSavePlan.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F1E3A65153A21DF000F9456 /* DFGSilentRegisterSavePlan.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -922,7 +924,6 @@
</span><span class="cx">                 A503FA19188E0FB000110F14 /* JavaScriptCallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A503FA13188E0FAF00110F14 /* JavaScriptCallFrame.cpp */; };
</span><span class="cx">                 A503FA1A188E0FB000110F14 /* JavaScriptCallFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = A503FA14188E0FAF00110F14 /* JavaScriptCallFrame.h */; };
</span><span class="cx">                 A503FA1B188E0FB000110F14 /* JSJavaScriptCallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A503FA15188E0FB000110F14 /* JSJavaScriptCallFrame.cpp */; };
</span><del>-                A503FA1C188E0FB000110F14 /* JSJavaScriptCallFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = A503FA16188E0FB000110F14 /* JSJavaScriptCallFrame.h */; };
</del><span class="cx">                 A503FA1D188E0FB000110F14 /* JSJavaScriptCallFramePrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A503FA17188E0FB000110F14 /* JSJavaScriptCallFramePrototype.cpp */; };
</span><span class="cx">                 A503FA1E188E0FB000110F14 /* JSJavaScriptCallFramePrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A503FA18188E0FB000110F14 /* JSJavaScriptCallFramePrototype.h */; };
</span><span class="cx">                 A503FA21188EFF6800110F14 /* ScriptBreakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = A503FA1F188EFF6800110F14 /* ScriptBreakpoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -1498,6 +1499,8 @@
</span><span class="cx">                 0F15F15D14B7A73A005DE37D /* CommonSlowPaths.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonSlowPaths.h; sourceTree = "<group>"; };
</span><span class="cx">                 0F16015A156198BF00C2587C /* DFGArgumentsSimplificationPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGArgumentsSimplificationPhase.cpp; path = dfg/DFGArgumentsSimplificationPhase.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 0F16015B156198BF00C2587C /* DFGArgumentsSimplificationPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGArgumentsSimplificationPhase.h; path = dfg/DFGArgumentsSimplificationPhase.h; sourceTree = "<group>"; };
</span><ins>+                0F190CAA189D82F6000AE5F0 /* ProfilerJettisonReason.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ProfilerJettisonReason.cpp; path = profiler/ProfilerJettisonReason.cpp; sourceTree = "<group>"; };
+                0F190CAB189D82F6000AE5F0 /* ProfilerJettisonReason.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProfilerJettisonReason.h; path = profiler/ProfilerJettisonReason.h; sourceTree = "<group>"; };
</ins><span class="cx">                 0F1E3A431534CBAD000F9456 /* DFGArgumentPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGArgumentPosition.h; path = dfg/DFGArgumentPosition.h; sourceTree = "<group>"; };
</span><span class="cx">                 0F1E3A441534CBAD000F9456 /* DFGDoubleFormatState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGDoubleFormatState.h; path = dfg/DFGDoubleFormatState.h; sourceTree = "<group>"; };
</span><span class="cx">                 0F1E3A501537C2CB000F9456 /* DFGSlowPathGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGSlowPathGenerator.h; path = dfg/DFGSlowPathGenerator.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -4295,6 +4298,8 @@
</span><span class="cx">                                 0FF7299C166AD347000F5BA3 /* ProfilerDatabase.cpp */,
</span><span class="cx">                                 0FF7299D166AD347000F5BA3 /* ProfilerDatabase.h */,
</span><span class="cx">                                 0FF7299E166AD347000F5BA3 /* ProfilerExecutionCounter.h */,
</span><ins>+                                0F190CAA189D82F6000AE5F0 /* ProfilerJettisonReason.cpp */,
+                                0F190CAB189D82F6000AE5F0 /* ProfilerJettisonReason.h */,
</ins><span class="cx">                                 0FF7299F166AD347000F5BA3 /* ProfilerOrigin.cpp */,
</span><span class="cx">                                 0FF729A0166AD347000F5BA3 /* ProfilerOrigin.h */,
</span><span class="cx">                                 0FF729A1166AD347000F5BA3 /* ProfilerOriginStack.cpp */,
</span><span class="lines">@@ -4606,11 +4611,11 @@
</span><span class="cx">                                 86ADD1450FDDEA980006EEC2 /* ARMv7Assembler.h in Headers */,
</span><span class="cx">                                 A5CEEE15187F3BAD00E55C99 /* InspectorAgent.h in Headers */,
</span><span class="cx">                                 65C0285D1717966800351E35 /* ARMv7DOpcode.h in Headers */,
</span><del>-                                 2A68295B1875F80500B6C3E2 /* CopyWriteBarrier.h in Headers */,
- 2A4EC90C1860D6C20094F782 /* WriteBarrierBuffer.h in Headers */,
</del><ins>+                                2A68295B1875F80500B6C3E2 /* CopyWriteBarrier.h in Headers */,
+                                2A4EC90C1860D6C20094F782 /* WriteBarrierBuffer.h in Headers */,
</ins><span class="cx">                                 FE5932A8183C5A2600A1ECCC /* VMEntryScope.h in Headers */,
</span><span class="cx">                                 A532439318569709002ED692 /* CodeGeneratorInspectorStrings.py in Headers */,
</span><del>-                                 A532439218569709002ED692 /* CodeGeneratorInspector.py in Headers */,
</del><ins>+                                A532439218569709002ED692 /* CodeGeneratorInspector.py in Headers */,
</ins><span class="cx">                                 0F24E54F17EE274900ABB217 /* TempRegisterSet.h in Headers */,
</span><span class="cx">                                 A50E4B6418809DD50068A46D /* JSGlobalObjectRuntimeAgent.h in Headers */,
</span><span class="cx">                                 FEB58C15187B8B160098EF0B /* ErrorHandlingScope.h in Headers */,
</span><span class="lines">@@ -4622,7 +4627,7 @@
</span><span class="cx">                                 0F8335B81639C1EA001443B5 /* ArrayAllocationProfile.h in Headers */,
</span><span class="cx">                                 A5840E29187CA5E600843B10 /* inline-and-minify-stylesheets-and-scripts.py in Headers */,
</span><span class="cx">                                 A5840E2B187CA75B00843B10 /* jsmin.py in Headers */,
</span><del>-                                 A53243981856A489002ED692 /* InspectorJS.json in Headers */,
</del><ins>+                                A53243981856A489002ED692 /* InspectorJS.json in Headers */,
</ins><span class="cx">                                 A5840E2A187CA75900843B10 /* xxd.pl in Headers */,
</span><span class="cx">                                 FEA08620182B7A0400F6D851 /* Breakpoint.h in Headers */,
</span><span class="cx">                                 A7A8AF3517ADB5F3005AB174 /* ArrayBuffer.h in Headers */,
</span><span class="lines">@@ -4733,7 +4738,7 @@
</span><span class="cx">                                 A1A009C01831A22D00CF8711 /* MacroAssemblerARM64.h in Headers */,
</span><span class="cx">                                 86EC9DC51328DF82002B2AD7 /* DFGByteCodeParser.h in Headers */,
</span><span class="cx">                                 0F485328187DFDEC0083B687 /* FTLAvailableRecovery.h in Headers */,
</span><del>- A593CF87184038CA00BFCE27 /* InspectorAgentRegistry.h in Headers */,
</del><ins>+                                A593CF87184038CA00BFCE27 /* InspectorAgentRegistry.h in Headers */,
</ins><span class="cx">                                 0F256C361627B0AD007F2783 /* DFGCallArrayAllocatorSlowPathGenerator.h in Headers */,
</span><span class="cx">                                 0F7B294B14C3CD2F007C3DB1 /* DFGCapabilities.h in Headers */,
</span><span class="cx">                                 0FFFC95814EF90A200C72532 /* DFGCFAPhase.h in Headers */,
</span><span class="lines">@@ -5142,6 +5147,7 @@
</span><span class="cx">                                 A700873E17CBE8D300C3E643 /* MapPrototype.h in Headers */,
</span><span class="cx">                                 C2B916C214DA014E00CBAC86 /* MarkedAllocator.h in Headers */,
</span><span class="cx">                                 A51007C1187CC3C600B38879 /* JSGlobalObjectInspectorController.h in Headers */,
</span><ins>+                                0F190CAD189D82F6000AE5F0 /* ProfilerJettisonReason.h in Headers */,
</ins><span class="cx">                                 142D6F0913539A2800B02E86 /* MarkedBlock.h in Headers */,
</span><span class="cx">                                 141448CB13A176EC00F5BA1A /* MarkedBlockSet.h in Headers */,
</span><span class="cx">                                 14D2F3DB139F4BE200491031 /* MarkedSpace.h in Headers */,
</span><span class="lines">@@ -5976,7 +5982,7 @@
</span><span class="cx">                                 0F6B1CC51862C47800845D97 /* FTLUnwindInfo.cpp in Sources */,
</span><span class="cx">                                 0F9D339A1803ADB70073C2BC /* FTLStackMaps.cpp in Sources */,
</span><span class="cx">                                 0FEA0A161706BB9000BB722C /* FTLState.cpp in Sources */,
</span><del>-                                 7C008CD2186F8A9300955C24 /* JSPromiseFunctions.cpp in Sources */,
</del><ins>+                                7C008CD2186F8A9300955C24 /* JSPromiseFunctions.cpp in Sources */,
</ins><span class="cx">                                 0F6B1CB5185FC9E900845D97 /* FTLJSCall.cpp in Sources */,
</span><span class="cx">                                 0F235BE117178E1C00690C7F /* FTLThunks.cpp in Sources */,
</span><span class="cx">                                 A593CF7C1840360300BFCE27 /* InspectorBackendDispatcher.cpp in Sources */,
</span><span class="lines">@@ -6151,6 +6157,7 @@
</span><span class="cx">                                 14469DE3107EC7E700650446 /* NumberObject.cpp in Sources */,
</span><span class="cx">                                 14469DE4107EC7E700650446 /* NumberPrototype.cpp in Sources */,
</span><span class="cx">                                 86F3EEBE168CDE930077B92A /* ObjCCallbackFunction.mm in Sources */,
</span><ins>+                                0F190CAC189D82F6000AE5F0 /* ProfilerJettisonReason.cpp in Sources */,
</ins><span class="cx">                                 14469DE5107EC7E700650446 /* ObjectConstructor.cpp in Sources */,
</span><span class="cx">                                 14469DE6107EC7E700650446 /* ObjectPrototype.cpp in Sources */,
</span><span class="cx">                                 E124A8F80E555775003091F1 /* OpaqueJSString.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCodeBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp (163253 => 163254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2014-02-02 02:18:09 UTC (rev 163253)
+++ trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2014-02-02 02:25:13 UTC (rev 163254)
</span><span class="lines">@@ -2287,7 +2287,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- jettison();
</del><ins>+ jettison(Profiler::JettisonDueToWeakReference);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> #endif // ENABLE(DFG_JIT)
</span><span class="lines">@@ -2766,19 +2766,24 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-void CodeBlock::jettison(ReoptimizationMode mode)
</del><ins>+void CodeBlock::jettison(Profiler::JettisonReason reason, ReoptimizationMode mode)
</ins><span class="cx"> {
</span><ins>+ RELEASE_ASSERT(reason != Profiler::NotJettisoned);
+
</ins><span class="cx"> #if ENABLE(DFG_JIT)
</span><span class="cx"> if (DFG::shouldShowDisassembly()) {
</span><span class="cx"> dataLog("Jettisoning ", *this);
</span><span class="cx"> if (mode == CountReoptimization)
</span><span class="cx"> dataLog(" and counting reoptimization");
</span><del>- dataLog(".\n");
</del><ins>+ dataLog(" due to ", reason, ".\n");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> DeferGCForAWhile deferGC(*m_heap);
</span><span class="cx"> RELEASE_ASSERT(JITCode::isOptimizingJIT(jitType()));
</span><span class="cx">
</span><ins>+ if (Profiler::Compilation* compilation = jitCode()->dfgCommon()->compilation.get())
+ compilation->setJettisonReason(reason);
+
</ins><span class="cx"> // We want to accomplish two things here:
</span><span class="cx"> // 1) Make sure that if this CodeBlock is on the stack right now, then if we return to it
</span><span class="cx"> // we should OSR exit at the top of the next bytecode instruction after the return.
</span><span class="lines">@@ -3559,14 +3564,14 @@
</span><span class="cx"> m_numBreakpoints += numBreakpoints;
</span><span class="cx"> ASSERT(m_numBreakpoints);
</span><span class="cx"> if (JITCode::isOptimizingJIT(jitType()))
</span><del>- jettison();
</del><ins>+ jettison(Profiler::JettisonDueToDebuggerBreakpoint);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void CodeBlock::setSteppingMode(CodeBlock::SteppingMode mode)
</span><span class="cx"> {
</span><span class="cx"> m_steppingMode = mode;
</span><span class="cx"> if (mode == SteppingModeEnabled && JITCode::isOptimizingJIT(jitType()))
</span><del>- jettison();
</del><ins>+ jettison(Profiler::JettisonDueToDebuggerStepping);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCodeBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CodeBlock.h (163253 => 163254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CodeBlock.h        2014-02-02 02:18:09 UTC (rev 163253)
+++ trunk/Source/JavaScriptCore/bytecode/CodeBlock.h        2014-02-02 02:25:13 UTC (rev 163254)
</span><span class="lines">@@ -66,6 +66,7 @@
</span><span class="cx"> #include "LLIntCallLinkInfo.h"
</span><span class="cx"> #include "LazyOperandValueProfile.h"
</span><span class="cx"> #include "ProfilerCompilation.h"
</span><ins>+#include "ProfilerJettisonReason.h"
</ins><span class="cx"> #include "RegExpObject.h"
</span><span class="cx"> #include "StructureStubInfo.h"
</span><span class="cx"> #include "UnconditionalFinalizer.h"
</span><span class="lines">@@ -296,7 +297,7 @@
</span><span class="cx"> bool hasOptimizedReplacement(); // the typeToReplace is my JITType
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- void jettison(ReoptimizationMode = DontCountReoptimization);
</del><ins>+ void jettison(Profiler::JettisonReason, ReoptimizationMode = DontCountReoptimization);
</ins><span class="cx">
</span><span class="cx"> ScriptExecutable* ownerExecutable() const { return m_ownerExecutable.get(); }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCodeBlockJettisoningWatchpointcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CodeBlockJettisoningWatchpoint.cpp (163253 => 163254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CodeBlockJettisoningWatchpoint.cpp        2014-02-02 02:18:09 UTC (rev 163253)
+++ trunk/Source/JavaScriptCore/bytecode/CodeBlockJettisoningWatchpoint.cpp        2014-02-02 02:25:13 UTC (rev 163254)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> if (DFG::shouldShowDisassembly())
</span><span class="cx"> dataLog("Firing watchpoint ", RawPointer(this), " on ", *m_codeBlock, "\n");
</span><span class="cx">
</span><del>- m_codeBlock->jettison(CountReoptimization);
</del><ins>+ m_codeBlock->jettison(Profiler::JettisonDueToUnprofiledWatchpoint, CountReoptimization);
</ins><span class="cx">
</span><span class="cx"> if (isOnList())
</span><span class="cx"> remove();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeProfiledCodeBlockJettisoningWatchpointcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/ProfiledCodeBlockJettisoningWatchpoint.cpp (163253 => 163254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/ProfiledCodeBlockJettisoningWatchpoint.cpp        2014-02-02 02:18:09 UTC (rev 163253)
+++ trunk/Source/JavaScriptCore/bytecode/ProfiledCodeBlockJettisoningWatchpoint.cpp        2014-02-02 02:25:13 UTC (rev 163254)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx"> exitingJITTypeFor(m_codeBlock->jitType())));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- m_codeBlock->jettison(CountReoptimization);
</del><ins>+ m_codeBlock->jettison(Profiler::JettisonDueToProfiledWatchpoint, CountReoptimization);
</ins><span class="cx">
</span><span class="cx"> if (isOnList())
</span><span class="cx"> remove();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp (163253 => 163254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp        2014-02-02 02:18:09 UTC (rev 163253)
+++ trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp        2014-02-02 02:25:13 UTC (rev 163254)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2011, 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -1107,7 +1107,7 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- optimizedCodeBlock->jettison(CountReoptimization);
</del><ins>+ optimizedCodeBlock->jettison(Profiler::JettisonDueToOSRExit, CountReoptimization);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(FTL_JIT)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.cpp (163253 => 163254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2014-02-02 02:18:09 UTC (rev 163253)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2014-02-02 02:25:13 UTC (rev 163254)
</span><span class="lines">@@ -1148,7 +1148,7 @@
</span><span class="cx"> "Triggering reoptimization of ", *codeBlock,
</span><span class="cx"> "(", *codeBlock->replacement(), ") (in loop).\n");
</span><span class="cx"> }
</span><del>- codeBlock->replacement()->jettison(CountReoptimization);
</del><ins>+ codeBlock->replacement()->jettison(Profiler::JettisonDueToBaselineLoopReoptimizationTrigger, CountReoptimization);
</ins><span class="cx"> return encodeResult(0, 0);
</span><span class="cx"> }
</span><span class="cx"> } else {
</span><span class="lines">@@ -1233,7 +1233,7 @@
</span><span class="cx"> "Triggering reoptimization of ", *codeBlock, " -> ",
</span><span class="cx"> *codeBlock->replacement(), " (after OSR fail).\n");
</span><span class="cx"> }
</span><del>- optimizedCodeBlock->jettison(CountReoptimization);
</del><ins>+ optimizedCodeBlock->jettison(Profiler::JettisonDueToBaselineLoopReoptimizationTriggerOnOSREntryFail, CountReoptimization);
</ins><span class="cx"> return encodeResult(0, 0);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilerCompilationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.cpp (163253 => 163254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.cpp        2014-02-02 02:18:09 UTC (rev 163253)
+++ trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.cpp        2014-02-02 02:25:13 UTC (rev 163254)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> Compilation::Compilation(Bytecodes* bytecodes, CompilationKind kind)
</span><span class="cx"> : m_bytecodes(bytecodes)
</span><span class="cx"> , m_kind(kind)
</span><ins>+ , m_jettisonReason(NotJettisoned)
</ins><span class="cx"> , m_numInlinedGetByIds(0)
</span><span class="cx"> , m_numInlinedPutByIds(0)
</span><span class="cx"> , m_numInlinedCalls(0)
</span><span class="lines">@@ -131,6 +132,7 @@
</span><span class="cx"> result->putDirect(exec->vm(), exec->propertyNames().numInlinedGetByIds, jsNumber(m_numInlinedGetByIds));
</span><span class="cx"> result->putDirect(exec->vm(), exec->propertyNames().numInlinedPutByIds, jsNumber(m_numInlinedPutByIds));
</span><span class="cx"> result->putDirect(exec->vm(), exec->propertyNames().numInlinedCalls, jsNumber(m_numInlinedCalls));
</span><ins>+ result->putDirect(exec->vm(), exec->propertyNames().jettisonReason, jsString(exec, String::fromUTF8(toCString(m_jettisonReason))));
</ins><span class="cx">
</span><span class="cx"> return result;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilerCompilationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.h (163253 => 163254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.h        2014-02-02 02:18:09 UTC (rev 163253)
+++ trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.h        2014-02-02 02:25:13 UTC (rev 163254)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include "ProfilerCompilationKind.h"
</span><span class="cx"> #include "ProfilerCompiledBytecode.h"
</span><span class="cx"> #include "ProfilerExecutionCounter.h"
</span><ins>+#include "ProfilerJettisonReason.h"
</ins><span class="cx"> #include "ProfilerOSRExit.h"
</span><span class="cx"> #include "ProfilerOSRExitSite.h"
</span><span class="cx"> #include "ProfilerOriginStack.h"
</span><span class="lines">@@ -68,11 +69,17 @@
</span><span class="cx"> void addOSRExitSite(const Vector<const void*>& codeAddresses);
</span><span class="cx"> OSRExit* addOSRExit(unsigned id, const OriginStack&, ExitKind, bool isWatchpoint);
</span><span class="cx">
</span><ins>+ void setJettisonReason(JettisonReason jettisonReason)
+ {
+ m_jettisonReason = jettisonReason;
+ }
+
</ins><span class="cx"> JSValue toJS(ExecState*) const;
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> Bytecodes* m_bytecodes;
</span><span class="cx"> CompilationKind m_kind;
</span><ins>+ JettisonReason m_jettisonReason;
</ins><span class="cx"> Vector<ProfiledBytecodes> m_profiledBytecodes;
</span><span class="cx"> Vector<CompiledBytecode> m_descriptions;
</span><span class="cx"> HashMap<OriginStack, std::unique_ptr<ExecutionCounter>> m_counters;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilerJettisonReasoncpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.cpp (0 => 163254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.cpp         (rev 0)
+++ trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.cpp        2014-02-02 02:25:13 UTC (rev 163254)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ProfilerJettisonReason.h"
+
+#include <wtf/PrintStream.h>
+
+namespace WTF {
+
+using namespace JSC::Profiler;
+
+void printInternal(PrintStream& out, JettisonReason reason)
+{
+ switch (reason) {
+ case NotJettisoned:
+ out.print("NotJettisoned");
+ return;
+ case JettisonDueToWeakReference:
+ out.print("WeakReference");
+ return;
+ case JettisonDueToDebuggerBreakpoint:
+ out.print("DebuggerBreakpoint");
+ return;
+ case JettisonDueToDebuggerStepping:
+ out.print("DebuggerStepping");
+ return;
+ case JettisonDueToLegacyProfiler:
+ out.print("LegacyProfiler");
+ return;
+ case JettisonDueToBaselineLoopReoptimizationTrigger:
+ out.print("BaselineLoopReoptimizationTrigger");
+ return;
+ case JettisonDueToBaselineLoopReoptimizationTriggerOnOSREntryFail:
+ out.print("BaselineLoopReoptimizationTriggerOnOSREntryFail");
+ return;
+ case JettisonDueToOSRExit:
+ out.print("OSRExit");
+ return;
+ case JettisonDueToProfiledWatchpoint:
+ out.print("ProfiledWatchpoint");
+ return;
+ case JettisonDueToUnprofiledWatchpoint:
+ out.print("UnprofiledWatchpoint");
+ return;
+ }
+ RELEASE_ASSERT_NOT_REACHED();
+}
+
+} // namespace WTF
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilerJettisonReasonh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.h (0 => 163254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.h         (rev 0)
+++ trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.h        2014-02-02 02:25:13 UTC (rev 163254)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ProfilerJettisonReason_h
+#define ProfilerJettisonReason_h
+
+namespace JSC { namespace Profiler {
+
+enum JettisonReason {
+ NotJettisoned,
+ JettisonDueToWeakReference,
+ JettisonDueToDebuggerBreakpoint,
+ JettisonDueToDebuggerStepping,
+ JettisonDueToLegacyProfiler,
+ JettisonDueToBaselineLoopReoptimizationTrigger,
+ JettisonDueToBaselineLoopReoptimizationTriggerOnOSREntryFail,
+ JettisonDueToOSRExit,
+ JettisonDueToProfiledWatchpoint,
+ JettisonDueToUnprofiledWatchpoint
+};
+
+} } // namespace JSC::Profiler
+
+namespace WTF {
+
+class PrintStream;
+void printInternal(PrintStream&, JSC::Profiler::JettisonReason);
+
+} // namespace WTF
+
+#endif // ProfilerJettisonReason_h
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonIdentifiersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h (163253 => 163254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2014-02-02 02:18:09 UTC (rev 163253)
+++ trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2014-02-02 02:25:13 UTC (rev 163254)
</span><span class="lines">@@ -114,6 +114,7 @@
</span><span class="cx"> macro(isPrototypeOf) \
</span><span class="cx"> macro(isView) \
</span><span class="cx"> macro(isWatchpoint) \
</span><ins>+ macro(jettisonReason) \
</ins><span class="cx"> macro(join) \
</span><span class="cx"> macro(keys) \
</span><span class="cx"> macro(lastIndex) \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.cpp (163253 => 163254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.cpp        2014-02-02 02:18:09 UTC (rev 163253)
+++ trunk/Source/JavaScriptCore/runtime/VM.cpp        2014-02-02 02:25:13 UTC (rev 163254)
</span><span class="lines">@@ -836,7 +836,7 @@
</span><span class="cx"> bool operator()(CodeBlock* codeBlock)
</span><span class="cx"> {
</span><span class="cx"> if (JITCode::isOptimizingJIT(codeBlock->jitType()))
</span><del>- codeBlock->jettison();
</del><ins>+ codeBlock->jettison(Profiler::JettisonDueToLegacyProfiler);
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (163253 => 163254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-02-02 02:18:09 UTC (rev 163253)
+++ trunk/Tools/ChangeLog        2014-02-02 02:25:13 UTC (rev 163254)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2014-02-01 Filip Pizlo <fpizlo@apple.com>
+
+ JSC profiler should show reasons for jettison
+ https://bugs.webkit.org/show_bug.cgi?id=128047
+
+ 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:
+
</ins><span class="cx"> 2014-01-31 Ryosuke Niwa <rniwa@webkit.org>
</span><span class="cx">
</span><span class="cx"> Remove inline member functions of FrameSelection that access m_selection
</span></span></pre></div>
<a id="trunkToolsScriptsdisplayprofileroutput"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/display-profiler-output (163253 => 163254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/display-profiler-output        2014-02-02 02:18:09 UTC (rev 163253)
+++ trunk/Tools/Scripts/display-profiler-output        2014-02-02 02:25:13 UTC (rev 163254)
</span><span class="lines">@@ -331,7 +331,7 @@
</span><span class="cx"> class Compilation
</span><span class="cx"> attr_accessor :bytecode, :engine, :descriptions, :counters, :compilationIndex
</span><span class="cx"> attr_accessor :osrExits, :profiledBytecodes, :numInlinedGetByIds, :numInlinedPutByIds
</span><del>- attr_accessor :numInlinedCalls
</del><ins>+ attr_accessor :numInlinedCalls, :jettisonReason
</ins><span class="cx">
</span><span class="cx"> def initialize(json)
</span><span class="cx"> @bytecode = $bytecodes[json["bytecodesID"].to_i]
</span><span class="lines">@@ -384,6 +384,7 @@
</span><span class="cx"> @numInlinedGetByIds = json["numInlinedGetByIds"]
</span><span class="cx"> @numInlinedPutByIds = json["numInlinedPutByIds"]
</span><span class="cx"> @numInlinedCalls = json["numInlinedCalls"]
</span><ins>+ @jettisonReason = json["jettisonReason"]
</ins><span class="cx"> end
</span><span class="cx">
</span><span class="cx"> def codeHashSortKey
</span><span class="lines">@@ -394,6 +395,24 @@
</span><span class="cx"> @counters[origin]
</span><span class="cx"> end
</span><span class="cx">
</span><ins>+ def totalCount
+ sum = 0
+ @counters.values.each {
+ | value |
+ sum += value.count
+ }
+ sum
+ end
+
+ def maxCount
+ max = 0
+ @counters.values.each {
+ | value |
+ max = [max, value.count].max
+ }
+ max
+ end
+
</ins><span class="cx"> def to_s
</span><span class="cx"> "#{bytecode}-#{compilationIndex}-#{engine}"
</span><span class="cx"> end
</span><span class="lines">@@ -417,7 +436,18 @@
</span><span class="cx"> end
</span><span class="cx"> end
</span><span class="cx"> end
</span><del>-
</del><ins>+
+def originToPrintStack(origin)
+ (0...(origin.size - 1)).map {
+ | index |
+ "bc\##{origin[index].bytecodeIndex} --> #{origin[index + 1].bytecodes}"
+ }
+end
+
+def originToString(origin)
+ originToPrintStack(origin).join(" ") + "bc\##{origin[-1].bytecodeIndex}"
+end
+
</ins><span class="cx"> if ARGV.length != 1
</span><span class="cx"> $stderr.puts "Usage: display-profiler-output <path to profiler output file>"
</span><span class="cx"> $stderr.puts
</span><span class="lines">@@ -624,6 +654,69 @@
</span><span class="cx"> }
</span><span class="cx"> end
</span><span class="cx">
</span><ins>+def queryCompilations(command, args)
+ compilationIndex = nil
+
+ case args.length
+ when 1
+ hash = args[0]
+ engine = nil
+ when 2
+ if mayBeHash(args[0])
+ hash = args[0]
+ engine = args[1]
+ else
+ engine = args[0]
+ hash = args[1]
+ end
+ else
+ puts "Usage: #{command} <code block hash> <engine>"
+ return
+ end
+
+ if hash and hash =~ /-(-?[0-9]+)-/
+ hash = $~.pre_match
+ engine = $~.post_match
+ compilationIndex = $1.to_i
+ end
+
+ if engine and not $engines.index(engine)
+ pattern = Regexp.new(Regexp.escape(engine), "i")
+ trueEngine = nil
+ $engines.each {
+ | myEngine |
+ if myEngine =~ pattern
+ trueEngine = myEngine
+ break
+ end
+ }
+ unless trueEngine
+ puts "#{engine} is not a valid engine, try #{$engines.join(' or ')}."
+ return
+ end
+ engine = trueEngine
+ end
+
+ if hash == "*"
+ hash = nil
+ end
+
+ sortByMode($compilations).each {
+ | compilation |
+ next if hash and not compilation.bytecode.matches(hash)
+ next if engine and compilation.engine != engine
+ if compilationIndex
+ if compilationIndex < 0
+ next unless compilation.bytecode.compilations[compilationIndex] == compilation
+ else
+ next unless compilation.compilationIndex == compilationIndex
+ end
+ end
+
+ yield compilation
+ }
+end
+
</ins><span class="cx"> def executeCommand(*commandArray)
</span><span class="cx"> command = commandArray[0]
</span><span class="cx"> args = commandArray[1..-1]
</span><span class="lines">@@ -634,6 +727,7 @@
</span><span class="cx"> puts "source Show the source for a code block."
</span><span class="cx"> puts "bytecode (b) Show the bytecode for a code block, with counts."
</span><span class="cx"> puts "profiling (p) Show the (internal) profiling data for a code block."
</span><ins>+ puts "log (l) List the compilations, exits, and jettisons involving this code block."
</ins><span class="cx"> puts "display (d) Display details for a code block."
</span><span class="cx"> puts "inlines Show all inlining stacks that the code block was on."
</span><span class="cx"> puts "counts Set whether to show counts for 'bytecode' and 'display'."
</span><span class="lines">@@ -750,6 +844,22 @@
</span><span class="cx"> end
</span><span class="cx"> }
</span><span class="cx"> }
</span><ins>+ when "log", "l"
+ queryCompilations("log", args) {
+ | compilation |
+ puts "Compilation #{compilation}:"
+ puts " Total count: #{compilation.totalCount} Max count: #{compilation.maxCount}"
+ compilation.osrExits.values.each {
+ | exits |
+ exits.each {
+ | exit |
+ puts " EXIT: at #{originToString(exit.origin)} due to #{exit.exitKind}, #{exit.count} times"
+ }
+ }
+ if compilation.jettisonReason != "NotJettisoned"
+ puts " Jettisoned due to #{compilation.jettisonReason}"
+ end
+ }
</ins><span class="cx"> when "inlines"
</span><span class="cx"> if args.length != 1
</span><span class="cx"> puts "Usage: inlines <code block hash>"
</span><span class="lines">@@ -793,13 +903,6 @@
</span><span class="cx"> printArray = []
</span><span class="cx"> lastPrintStack = []
</span><span class="cx">
</span><del>- def originToPrintStack(origin)
- (0...(origin.size - 1)).map {
- | index |
- "bc\##{origin[index].bytecodeIndex} --> #{origin[index + 1].bytecodes}"
- }
- end
-
</del><span class="cx"> def printStack(printArray, stack, lastStack)
</span><span class="cx"> stillCommon = true
</span><span class="cx"> stack.each_with_index {
</span><span class="lines">@@ -827,67 +930,13 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> when "display", "d"
</span><del>- compilationIndex = nil
-
- case args.length
- when 1
- hash = args[0]
- engine = nil
- when 2
- if mayBeHash(args[0])
- hash = args[0]
- engine = args[1]
- else
- engine = args[0]
- hash = args[1]
- end
- else
- puts "Usage: summary <code block hash> <engine>"
- return
- end
-
- if hash and hash =~ /-(-?[0-9]+)-/
- hash = $~.pre_match
- engine = $~.post_match
- compilationIndex = $1.to_i
- end
-
- if engine and not $engines.index(engine)
- pattern = Regexp.new(Regexp.escape(engine), "i")
- trueEngine = nil
- $engines.each {
- | myEngine |
- if myEngine =~ pattern
- trueEngine = myEngine
- break
- end
- }
- unless trueEngine
- puts "#{engine} is not a valid engine, try #{$engines.join(' or ')}."
- return
- end
- engine = trueEngine
- end
-
- if hash == "*"
- hash = nil
- end
-
</del><span class="cx"> actualCountCols = 13
</span><span class="cx"> sourceCountCols = 10 * $engines.size
</span><span class="cx">
</span><span class="cx"> first = true
</span><del>- sortByMode($compilations).each {
</del><ins>+
+ queryCompilations("display", args) {
</ins><span class="cx"> | compilation |
</span><del>- next if hash and not compilation.bytecode.matches(hash)
- next if engine and compilation.engine != engine
- if compilationIndex
- if compilationIndex < 0
- next unless compilation.bytecode.compilations[compilationIndex] == compilation
- else
- next unless compilation.compilationIndex == compilationIndex
- end
- end
</del><span class="cx">
</span><span class="cx"> if first
</span><span class="cx"> first = false
</span></span></pre>
</div>
</div>
</body>
</html>