<!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>[204489] trunk/Source</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/204489">204489</a></dd>
<dt>Author</dt> <dd>sbarati@apple.com</dd>
<dt>Date</dt> <dd>2016-08-15 16:32:03 -0700 (Mon, 15 Aug 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: Introduce a method to enable code coverage profiler without enabling type profiler
https://bugs.webkit.org/show_bug.cgi?id=160750
<rdar://problem/27793469>
Reviewed by Joseph Pecoraro.
Source/JavaScriptCore:
* inspector/agents/InspectorRuntimeAgent.cpp:
(Inspector::InspectorRuntimeAgent::disableTypeProfiler):
(Inspector::InspectorRuntimeAgent::enableControlFlowProfiler):
(Inspector::InspectorRuntimeAgent::disableControlFlowProfiler):
(Inspector::InspectorRuntimeAgent::setTypeProfilerEnabledState):
(Inspector::InspectorRuntimeAgent::setControlFlowProfilerEnabledState):
* inspector/agents/InspectorRuntimeAgent.h:
* inspector/protocol/Runtime.json:
Source/WebInspectorUI:
* UserInterface/Base/Main.js:
(WebInspector.loaded):
* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype._setTypeTokenAnnotatorEnabledState):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgentcpp">trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgenth">trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorprotocolRuntimejson">trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseMainjs">trunk/Source/WebInspectorUI/UserInterface/Base/Main.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTextEditorjs">trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (204488 => 204489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-08-15 23:31:39 UTC (rev 204488)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-08-15 23:32:03 UTC (rev 204489)
</span><span class="lines">@@ -1,5 +1,22 @@
</span><span class="cx"> 2016-08-15 Saam Barati <sbarati@apple.com>
</span><span class="cx">
</span><ins>+ Web Inspector: Introduce a method to enable code coverage profiler without enabling type profiler
+ https://bugs.webkit.org/show_bug.cgi?id=160750
+ <rdar://problem/27793469>
+
+ Reviewed by Joseph Pecoraro.
+
+ * inspector/agents/InspectorRuntimeAgent.cpp:
+ (Inspector::InspectorRuntimeAgent::disableTypeProfiler):
+ (Inspector::InspectorRuntimeAgent::enableControlFlowProfiler):
+ (Inspector::InspectorRuntimeAgent::disableControlFlowProfiler):
+ (Inspector::InspectorRuntimeAgent::setTypeProfilerEnabledState):
+ (Inspector::InspectorRuntimeAgent::setControlFlowProfilerEnabledState):
+ * inspector/agents/InspectorRuntimeAgent.h:
+ * inspector/protocol/Runtime.json:
+
+2016-08-15 Saam Barati <sbarati@apple.com>
+
</ins><span class="cx"> Array.prototype.map builtin should go on the fast path when constructor===@Array
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=160836
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp (204488 => 204489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp        2016-08-15 23:31:39 UTC (rev 204488)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp        2016-08-15 23:32:03 UTC (rev 204489)
</span><span class="lines">@@ -317,6 +317,16 @@
</span><span class="cx"> setTypeProfilerEnabledState(false);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void InspectorRuntimeAgent::enableControlFlowProfiler(ErrorString&)
+{
+ setControlFlowProfilerEnabledState(true);
+}
+
+void InspectorRuntimeAgent::disableControlFlowProfiler(ErrorString&)
+{
+ setControlFlowProfilerEnabledState(false);
+}
+
</ins><span class="cx"> void InspectorRuntimeAgent::setTypeProfilerEnabledState(bool isTypeProfilingEnabled)
</span><span class="cx"> {
</span><span class="cx"> if (m_isTypeProfilingEnabled == isTypeProfilingEnabled)
</span><span class="lines">@@ -326,10 +336,22 @@
</span><span class="cx"> VM& vm = m_vm;
</span><span class="cx"> vm.whenIdle([&vm, isTypeProfilingEnabled] () {
</span><span class="cx"> bool shouldRecompileFromTypeProfiler = (isTypeProfilingEnabled ? vm.enableTypeProfiler() : vm.disableTypeProfiler());
</span><del>- bool shouldRecompileFromControlFlowProfiler = (isTypeProfilingEnabled ? vm.enableControlFlowProfiler() : vm.disableControlFlowProfiler());
- bool needsToRecompile = shouldRecompileFromTypeProfiler || shouldRecompileFromControlFlowProfiler;
</del><ins>+ if (shouldRecompileFromTypeProfiler)
+ vm.deleteAllCode();
+ });
+}
</ins><span class="cx">
</span><del>- if (needsToRecompile)
</del><ins>+void InspectorRuntimeAgent::setControlFlowProfilerEnabledState(bool isControlFlowProfilingEnabled)
+{
+ if (m_isControlFlowProfilingEnabled == isControlFlowProfilingEnabled)
+ return;
+ m_isControlFlowProfilingEnabled = isControlFlowProfilingEnabled;
+
+ VM& vm = m_vm;
+ vm.whenIdle([&vm, isControlFlowProfilingEnabled] () {
+ bool shouldRecompileFromControlFlowProfiler = (isControlFlowProfilingEnabled ? vm.enableControlFlowProfiler() : vm.disableControlFlowProfiler());
+
+ if (shouldRecompileFromControlFlowProfiler)
</ins><span class="cx"> vm.deleteAllCode();
</span><span class="cx"> });
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h (204488 => 204489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h        2016-08-15 23:31:39 UTC (rev 204488)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h        2016-08-15 23:32:03 UTC (rev 204489)
</span><span class="lines">@@ -70,6 +70,8 @@
</span><span class="cx"> void getRuntimeTypesForVariablesAtOffsets(ErrorString&, const Inspector::InspectorArray& locations, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::TypeDescription>>&) override;
</span><span class="cx"> void enableTypeProfiler(ErrorString&) override;
</span><span class="cx"> void disableTypeProfiler(ErrorString&) override;
</span><ins>+ void enableControlFlowProfiler(ErrorString&) override;
+ void disableControlFlowProfiler(ErrorString&) override;
</ins><span class="cx"> void getBasicBlocks(ErrorString&, const String& in_sourceID, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::BasicBlock>>& out_basicBlocks) override;
</span><span class="cx">
</span><span class="cx"> bool enabled() const { return m_enabled; }
</span><span class="lines">@@ -86,6 +88,7 @@
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> void setTypeProfilerEnabledState(bool);
</span><ins>+ void setControlFlowProfilerEnabledState(bool);
</ins><span class="cx">
</span><span class="cx"> InjectedScriptManager& m_injectedScriptManager;
</span><span class="cx"> ScriptDebugServer& m_scriptDebugServer;
</span><span class="lines">@@ -92,6 +95,7 @@
</span><span class="cx"> JSC::VM& m_vm;
</span><span class="cx"> bool m_enabled {false};
</span><span class="cx"> bool m_isTypeProfilingEnabled {false};
</span><ins>+ bool m_isControlFlowProfilingEnabled {false};
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace Inspector
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorprotocolRuntimejson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json (204488 => 204489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json        2016-08-15 23:31:39 UTC (rev 204488)
+++ trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json        2016-08-15 23:32:03 UTC (rev 204489)
</span><span class="lines">@@ -331,6 +331,14 @@
</span><span class="cx"> "description": "Disables type profiling on the VM."
</span><span class="cx"> },
</span><span class="cx"> {
</span><ins>+ "name": "enableControlFlowProfiler",
+ "description": "Enables control flow profiling on the VM."
+ },
+ {
+ "name": "disableControlFlowProfiler",
+ "description": "Disables control flow profiling on the VM."
+ },
+ {
</ins><span class="cx"> "name": "getBasicBlocks",
</span><span class="cx"> "parameters": [
</span><span class="cx"> { "name": "sourceID", "type": "string", "description": "Indicates which sourceID information is requested for." }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (204488 => 204489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2016-08-15 23:31:39 UTC (rev 204488)
+++ trunk/Source/WebInspectorUI/ChangeLog        2016-08-15 23:32:03 UTC (rev 204489)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-08-15 Saam Barati <sbarati@apple.com>
+
+ Web Inspector: Introduce a method to enable code coverage profiler without enabling type profiler
+ https://bugs.webkit.org/show_bug.cgi?id=160750
+ <rdar://problem/27793469>
+
+ Reviewed by Joseph Pecoraro.
+
+ * UserInterface/Base/Main.js:
+ (WebInspector.loaded):
+ * UserInterface/Views/SourceCodeTextEditor.js:
+ (WebInspector.SourceCodeTextEditor.prototype._setTypeTokenAnnotatorEnabledState):
+
</ins><span class="cx"> 2016-08-12 Timothy Hatcher <timothy@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: Add application/vnd.api+json as a valid JSON MIME-type
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseMainjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (204488 => 204489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js        2016-08-15 23:31:39 UTC (rev 204488)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js        2016-08-15 23:32:03 UTC (rev 204489)
</span><span class="lines">@@ -160,8 +160,11 @@
</span><span class="cx">
</span><span class="cx"> // COMPATIBILITY (iOS 8): Page.enableTypeProfiler did not exist.
</span><span class="cx"> this.showJavaScriptTypeInformationSetting = new WebInspector.Setting("show-javascript-type-information", false);
</span><del>- if (this.showJavaScriptTypeInformationSetting.value && window.RuntimeAgent && RuntimeAgent.enableTypeProfiler)
</del><ins>+ if (this.showJavaScriptTypeInformationSetting.value && window.RuntimeAgent && RuntimeAgent.enableTypeProfiler) {
</ins><span class="cx"> RuntimeAgent.enableTypeProfiler();
</span><ins>+ if (RuntimeAgent.enableControlFlowProfiler)
+ RuntimeAgent.enableControlFlowProfiler();
+ }
</ins><span class="cx">
</span><span class="cx"> // COMPATIBILITY (iOS 8): Page.setShowPaintRects did not exist.
</span><span class="cx"> this.showPaintRectsSetting = new WebInspector.Setting("show-paint-rects", false);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTextEditorjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js (204488 => 204489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js        2016-08-15 23:31:39 UTC (rev 204488)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js        2016-08-15 23:32:03 UTC (rev 204489)
</span><span class="lines">@@ -1692,6 +1692,8 @@
</span><span class="cx"> console.assert(this.visible, "Annotators should not be enabled if the TextEditor is not visible");
</span><span class="cx">
</span><span class="cx"> RuntimeAgent.enableTypeProfiler();
</span><ins>+ if (RuntimeAgent.enableControlFlowProfiler)
+ RuntimeAgent.enableControlFlowProfiler();
</ins><span class="cx">
</span><span class="cx"> this._typeTokenAnnotator.reset();
</span><span class="cx"> if (this._basicBlockAnnotator) {
</span></span></pre>
</div>
</div>
</body>
</html>