Title: [120589] trunk/Source/WebCore
Revision
120589
Author
loi...@chromium.org
Date
2012-06-18 04:40:47 -0700 (Mon, 18 Jun 2012)

Log Message

Web Inspector: Add heap profiler owned memory to the pie chart
https://bugs.webkit.org/show_bug.cgi?id=89203

Heap profiler may consume considerable amount of memory
which is currently falls into Unknown category.
Give it a separate sector on the pie chart.

Patch by Alexei Filippov <alex...@chromium.org> on 2012-06-18
Reviewed by Yury Semikhatsky.

* bindings/js/ScriptProfiler.h:
(WebCore::ScriptProfiler::profilerSnapshotsSize):
* bindings/v8/ScriptProfiler.cpp:
(WebCore::ScriptProfiler::profilerSnapshotsSize):
(WebCore):
* bindings/v8/ScriptProfiler.h:
(ScriptProfiler):
* inspector/InspectorMemoryAgent.cpp:
(MemoryBlockName):
(WebCore):
(WebCore::inspectorData):
(WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):
* inspector/front-end/NativeMemorySnapshotView.js:
(WebInspector.MemoryBlockViewProperties._initialize):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (120588 => 120589)


--- trunk/Source/WebCore/ChangeLog	2012-06-18 11:13:14 UTC (rev 120588)
+++ trunk/Source/WebCore/ChangeLog	2012-06-18 11:40:47 UTC (rev 120589)
@@ -1,3 +1,29 @@
+2012-06-18  Alexei Filippov  <alex...@chromium.org>
+
+        Web Inspector: Add heap profiler owned memory to the pie chart
+        https://bugs.webkit.org/show_bug.cgi?id=89203
+
+        Heap profiler may consume considerable amount of memory
+        which is currently falls into Unknown category.
+        Give it a separate sector on the pie chart.
+
+        Reviewed by Yury Semikhatsky.
+
+        * bindings/js/ScriptProfiler.h:
+        (WebCore::ScriptProfiler::profilerSnapshotsSize):
+        * bindings/v8/ScriptProfiler.cpp:
+        (WebCore::ScriptProfiler::profilerSnapshotsSize):
+        (WebCore):
+        * bindings/v8/ScriptProfiler.h:
+        (ScriptProfiler):
+        * inspector/InspectorMemoryAgent.cpp:
+        (MemoryBlockName):
+        (WebCore):
+        (WebCore::inspectorData):
+        (WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):
+        * inspector/front-end/NativeMemorySnapshotView.js:
+        (WebInspector.MemoryBlockViewProperties._initialize):
+
 2012-06-18  Mario Sanchez Prada  <msanc...@igalia.com>
 
         [GTK] Get rid of DumpRenderTreeSupportGtk::{in|de}crementAccessibilityValue

Modified: trunk/Source/WebCore/bindings/js/ScriptProfiler.h (120588 => 120589)


--- trunk/Source/WebCore/bindings/js/ScriptProfiler.h	2012-06-18 11:13:14 UTC (rev 120588)
+++ trunk/Source/WebCore/bindings/js/ScriptProfiler.h	2012-06-18 11:40:47 UTC (rev 120589)
@@ -74,6 +74,7 @@
     // FIXME: Implement this counter for JSC. See bug 73936 for more details.
     static void visitJSDOMWrappers(DOMWrapperVisitor*) { }
     static void visitExternalJSStrings(DOMWrapperVisitor*) { }
+    static size_t profilerSnapshotsSize() { return 0; }
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/v8/ScriptProfiler.cpp (120588 => 120589)


--- trunk/Source/WebCore/bindings/v8/ScriptProfiler.cpp	2012-06-18 11:13:14 UTC (rev 120588)
+++ trunk/Source/WebCore/bindings/v8/ScriptProfiler.cpp	2012-06-18 11:40:47 UTC (rev 120589)
@@ -196,6 +196,11 @@
     V8BindingPerIsolateData::current()->visitJSExternalStrings(visitor);
 }
 
+size_t ScriptProfiler::profilerSnapshotsSize()
+{
+    return v8::HeapProfiler::GetMemorySizeUsedByProfiler();
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)

Modified: trunk/Source/WebCore/bindings/v8/ScriptProfiler.h (120588 => 120589)


--- trunk/Source/WebCore/bindings/v8/ScriptProfiler.h	2012-06-18 11:13:14 UTC (rev 120588)
+++ trunk/Source/WebCore/bindings/v8/ScriptProfiler.h	2012-06-18 11:40:47 UTC (rev 120589)
@@ -78,6 +78,7 @@
     static void initialize();
     static void visitJSDOMWrappers(DOMWrapperVisitor*);
     static void visitExternalJSStrings(DOMWrapperVisitor*);
+    static size_t profilerSnapshotsSize();
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp (120588 => 120589)


--- trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp	2012-06-18 11:13:14 UTC (rev 120588)
+++ trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp	2012-06-18 11:40:47 UTC (rev 120589)
@@ -66,6 +66,7 @@
 namespace MemoryBlockName {
 static const char jsHeapAllocated[] = "JSHeapAllocated";
 static const char jsHeapUsed[] = "JSHeapUsed";
+static const char inspectorData[] = "InspectorData";
 static const char memoryCache[] = "MemoryCache";
 static const char processPrivateMemory[] = "ProcessPrivateMemory";
 
@@ -347,6 +348,14 @@
     return jsHeapAllocated.release();
 }
 
+static PassRefPtr<InspectorMemoryBlock> inspectorData()
+{
+    size_t dataSize = ScriptProfiler::profilerSnapshotsSize();
+    RefPtr<InspectorMemoryBlock> inspectorData = InspectorMemoryBlock::create().setName(MemoryBlockName::inspectorData);
+    inspectorData->setSize(static_cast<int>(dataSize));
+    return inspectorData.release();
+}
+
 static PassRefPtr<InspectorMemoryBlock> renderTreeInfo(Page* page)
 {
     ArenaSize arenaSize = page->renderTreeSize();
@@ -401,6 +410,7 @@
 
     RefPtr<TypeBuilder::Array<InspectorMemoryBlock> > children = TypeBuilder::Array<InspectorMemoryBlock>::create();
     children->addItem(jsHeapInfo());
+    children->addItem(inspectorData());
     children->addItem(memoryCacheInfo());
     children->addItem(renderTreeInfo(m_page)); // TODO: collect for all pages?
     processMemory->setChildren(children);

Modified: trunk/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js (120588 => 120589)


--- trunk/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js	2012-06-18 11:13:14 UTC (rev 120588)
+++ trunk/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js	2012-06-18 11:40:47 UTC (rev 120589)
@@ -214,13 +214,14 @@
     {
         WebInspector.MemoryBlockViewProperties._standardBlocks[name] = new WebInspector.MemoryBlockViewProperties(fillStyle, name, WebInspector.UIString(description));
     }
-    addBlock("rgba(255, 255, 255, 0.8)", "ProcessPrivateMemory", "Total");
-    addBlock("rgba(240, 240, 250, 0.8)", "Other", "Other");
-    addBlock("rgba(250, 200, 200, 0.8)", "JSHeapAllocated", "_javascript_ heap");
-    addBlock("rgba(200, 250, 200, 0.8)", "JSHeapUsed", "Used _javascript_ heap");
-    addBlock("rgba(200, 170, 200, 0.8)", "MemoryCache", "Memory cache resources");
-    addBlock("rgba(250, 250, 150, 0.8)", "RenderTreeAllocated", "Render tree");
-    addBlock("rgba(200, 150, 150, 0.8)", "RenderTreeUsed", "Render tree used");
+    addBlock("hsl(  0,  0%, 100%)", "ProcessPrivateMemory", "Total");
+    addBlock("hsl(  0,  0%,  80%)", "Other", "Other");
+    addBlock("hsl( 90, 60%,  80%)", "JSHeapAllocated", "_javascript_ heap");
+    addBlock("hsl( 90, 80%,  80%)", "JSHeapUsed", "Used _javascript_ heap");
+    addBlock("hsl(210, 60%,  80%)", "InspectorData", "Inspector data");
+    addBlock("hsl( 30, 60%,  80%)", "MemoryCache", "Memory cache resources");
+    addBlock("hsl( 60, 60%,  80%)", "RenderTreeAllocated", "Render tree");
+    addBlock("hsl( 60, 60%,  80%)", "RenderTreeUsed", "Render tree used");
 }
 
 WebInspector.MemoryBlockViewProperties._forMemoryBlock = function(memoryBlock)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to