<!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
&lt;rdar://problem/27793469&gt;

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  &lt;sbarati@apple.com&gt;
</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
+        &lt;rdar://problem/27793469&gt;
+
+        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  &lt;sbarati@apple.com&gt;
+
</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&amp;)
+{
+    setControlFlowProfilerEnabledState(true);
+}
+
+void InspectorRuntimeAgent::disableControlFlowProfiler(ErrorString&amp;)
+{
+    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&amp; vm = m_vm;
</span><span class="cx">     vm.whenIdle([&amp;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&amp; vm = m_vm;
+    vm.whenIdle([&amp;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&amp;, const Inspector::InspectorArray&amp; locations, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::Runtime::TypeDescription&gt;&gt;&amp;) override;
</span><span class="cx">     void enableTypeProfiler(ErrorString&amp;) override;
</span><span class="cx">     void disableTypeProfiler(ErrorString&amp;) override;
</span><ins>+    void enableControlFlowProfiler(ErrorString&amp;) override;
+    void disableControlFlowProfiler(ErrorString&amp;) override;
</ins><span class="cx">     void getBasicBlocks(ErrorString&amp;, const String&amp; in_sourceID, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::Runtime::BasicBlock&gt;&gt;&amp; 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&amp; m_injectedScriptManager;
</span><span class="cx">     ScriptDebugServer&amp; m_scriptDebugServer;
</span><span class="lines">@@ -92,6 +95,7 @@
</span><span class="cx">     JSC::VM&amp; 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">             &quot;description&quot;: &quot;Disables type profiling on the VM.&quot;
</span><span class="cx">         },
</span><span class="cx">         {
</span><ins>+            &quot;name&quot;: &quot;enableControlFlowProfiler&quot;,
+            &quot;description&quot;: &quot;Enables control flow profiling on the VM.&quot;
+        },
+        {
+            &quot;name&quot;: &quot;disableControlFlowProfiler&quot;,
+            &quot;description&quot;: &quot;Disables control flow profiling on the VM.&quot;
+        },
+        {
</ins><span class="cx">             &quot;name&quot;: &quot;getBasicBlocks&quot;,
</span><span class="cx">             &quot;parameters&quot;: [
</span><span class="cx">                 { &quot;name&quot;: &quot;sourceID&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Indicates which sourceID information is requested for.&quot; }
</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  &lt;sbarati@apple.com&gt;
+
+        Web Inspector: Introduce a method to enable code coverage profiler without enabling type profiler
+        https://bugs.webkit.org/show_bug.cgi?id=160750
+        &lt;rdar://problem/27793469&gt;
+
+        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  &lt;timothy@apple.com&gt;
</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(&quot;show-javascript-type-information&quot;, false);
</span><del>-    if (this.showJavaScriptTypeInformationSetting.value &amp;&amp; window.RuntimeAgent &amp;&amp; RuntimeAgent.enableTypeProfiler)
</del><ins>+    if (this.showJavaScriptTypeInformationSetting.value &amp;&amp; window.RuntimeAgent &amp;&amp; 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(&quot;show-paint-rects&quot;, 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, &quot;Annotators should not be enabled if the TextEditor is not visible&quot;);
</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>