Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (204488 => 204489)
--- trunk/Source/_javascript_Core/ChangeLog 2016-08-15 23:31:39 UTC (rev 204488)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-08-15 23:32:03 UTC (rev 204489)
@@ -1,5 +1,22 @@
2016-08-15 Saam Barati <[email protected]>
+ 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 <[email protected]>
+
Array.prototype.map builtin should go on the fast path when constructor===@Array
https://bugs.webkit.org/show_bug.cgi?id=160836
Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorRuntimeAgent.cpp (204488 => 204489)
--- trunk/Source/_javascript_Core/inspector/agents/InspectorRuntimeAgent.cpp 2016-08-15 23:31:39 UTC (rev 204488)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorRuntimeAgent.cpp 2016-08-15 23:32:03 UTC (rev 204489)
@@ -317,6 +317,16 @@
setTypeProfilerEnabledState(false);
}
+void InspectorRuntimeAgent::enableControlFlowProfiler(ErrorString&)
+{
+ setControlFlowProfilerEnabledState(true);
+}
+
+void InspectorRuntimeAgent::disableControlFlowProfiler(ErrorString&)
+{
+ setControlFlowProfilerEnabledState(false);
+}
+
void InspectorRuntimeAgent::setTypeProfilerEnabledState(bool isTypeProfilingEnabled)
{
if (m_isTypeProfilingEnabled == isTypeProfilingEnabled)
@@ -326,10 +336,22 @@
VM& vm = m_vm;
vm.whenIdle([&vm, isTypeProfilingEnabled] () {
bool shouldRecompileFromTypeProfiler = (isTypeProfilingEnabled ? vm.enableTypeProfiler() : vm.disableTypeProfiler());
- bool shouldRecompileFromControlFlowProfiler = (isTypeProfilingEnabled ? vm.enableControlFlowProfiler() : vm.disableControlFlowProfiler());
- bool needsToRecompile = shouldRecompileFromTypeProfiler || shouldRecompileFromControlFlowProfiler;
+ if (shouldRecompileFromTypeProfiler)
+ vm.deleteAllCode();
+ });
+}
- if (needsToRecompile)
+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)
vm.deleteAllCode();
});
}
Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorRuntimeAgent.h (204488 => 204489)
--- trunk/Source/_javascript_Core/inspector/agents/InspectorRuntimeAgent.h 2016-08-15 23:31:39 UTC (rev 204488)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorRuntimeAgent.h 2016-08-15 23:32:03 UTC (rev 204489)
@@ -70,6 +70,8 @@
void getRuntimeTypesForVariablesAtOffsets(ErrorString&, const Inspector::InspectorArray& locations, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::TypeDescription>>&) override;
void enableTypeProfiler(ErrorString&) override;
void disableTypeProfiler(ErrorString&) override;
+ void enableControlFlowProfiler(ErrorString&) override;
+ void disableControlFlowProfiler(ErrorString&) override;
void getBasicBlocks(ErrorString&, const String& in_sourceID, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::BasicBlock>>& out_basicBlocks) override;
bool enabled() const { return m_enabled; }
@@ -86,6 +88,7 @@
private:
void setTypeProfilerEnabledState(bool);
+ void setControlFlowProfilerEnabledState(bool);
InjectedScriptManager& m_injectedScriptManager;
ScriptDebugServer& m_scriptDebugServer;
@@ -92,6 +95,7 @@
JSC::VM& m_vm;
bool m_enabled {false};
bool m_isTypeProfilingEnabled {false};
+ bool m_isControlFlowProfilingEnabled {false};
};
} // namespace Inspector
Modified: trunk/Source/_javascript_Core/inspector/protocol/Runtime.json (204488 => 204489)
--- trunk/Source/_javascript_Core/inspector/protocol/Runtime.json 2016-08-15 23:31:39 UTC (rev 204488)
+++ trunk/Source/_javascript_Core/inspector/protocol/Runtime.json 2016-08-15 23:32:03 UTC (rev 204489)
@@ -331,6 +331,14 @@
"description": "Disables type profiling on the VM."
},
{
+ "name": "enableControlFlowProfiler",
+ "description": "Enables control flow profiling on the VM."
+ },
+ {
+ "name": "disableControlFlowProfiler",
+ "description": "Disables control flow profiling on the VM."
+ },
+ {
"name": "getBasicBlocks",
"parameters": [
{ "name": "sourceID", "type": "string", "description": "Indicates which sourceID information is requested for." }
Modified: trunk/Source/WebInspectorUI/ChangeLog (204488 => 204489)
--- 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)
@@ -1,3 +1,16 @@
+2016-08-15 Saam Barati <[email protected]>
+
+ 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):
+
2016-08-12 Timothy Hatcher <[email protected]>
Web Inspector: Add application/vnd.api+json as a valid JSON MIME-type
Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (204488 => 204489)
--- 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)
@@ -160,8 +160,11 @@
// COMPATIBILITY (iOS 8): Page.enableTypeProfiler did not exist.
this.showJavaScriptTypeInformationSetting = new WebInspector.Setting("show-_javascript_-type-information", false);
- if (this.showJavaScriptTypeInformationSetting.value && window.RuntimeAgent && RuntimeAgent.enableTypeProfiler)
+ if (this.showJavaScriptTypeInformationSetting.value && window.RuntimeAgent && RuntimeAgent.enableTypeProfiler) {
RuntimeAgent.enableTypeProfiler();
+ if (RuntimeAgent.enableControlFlowProfiler)
+ RuntimeAgent.enableControlFlowProfiler();
+ }
// COMPATIBILITY (iOS 8): Page.setShowPaintRects did not exist.
this.showPaintRectsSetting = new WebInspector.Setting("show-paint-rects", false);
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js (204488 => 204489)
--- 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)
@@ -1692,6 +1692,8 @@
console.assert(this.visible, "Annotators should not be enabled if the TextEditor is not visible");
RuntimeAgent.enableTypeProfiler();
+ if (RuntimeAgent.enableControlFlowProfiler)
+ RuntimeAgent.enableControlFlowProfiler();
this._typeTokenAnnotator.reset();
if (this._basicBlockAnnotator) {