Title: [134033] trunk/Source
Revision
134033
Author
commit-qu...@webkit.org
Date
2012-11-09 01:50:57 -0800 (Fri, 09 Nov 2012)

Log Message

Web Inspector: Fix heap snapshots counted several times by NMI
https://bugs.webkit.org/show_bug.cgi?id=101085

The fix moves snapshots size counting to V8PerIsolateData class. As long
as it has one instance per isolate its reportMemoryUsage should be
called once per isolate.

Patch by Alexei Filippov <a...@chromium.org> on 2012-11-09
Reviewed by Yury Semikhatsky.

Source/WebCore:

* bindings/v8/V8PerIsolateData.cpp:
(WebCore::V8PerIsolateData::reportMemoryUsage):
* inspector/InspectorProfilerAgent.cpp:
(WebCore::InspectorProfilerAgent::reportMemoryUsage):

Source/WTF:

* wtf/MemoryInstrumentation.h:
(WTF::MemoryClassInfo::addPrivateBuffer):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (134032 => 134033)


--- trunk/Source/WTF/ChangeLog	2012-11-09 09:47:47 UTC (rev 134032)
+++ trunk/Source/WTF/ChangeLog	2012-11-09 09:50:57 UTC (rev 134033)
@@ -1,3 +1,17 @@
+2012-11-09  Alexei Filippov  <a...@chromium.org>
+
+        Web Inspector: Fix heap snapshots counted several times by NMI
+        https://bugs.webkit.org/show_bug.cgi?id=101085
+
+        The fix moves snapshots size counting to V8PerIsolateData class. As long
+        as it has one instance per isolate its reportMemoryUsage should be
+        called once per isolate.
+
+        Reviewed by Yury Semikhatsky.
+
+        * wtf/MemoryInstrumentation.h:
+        (WTF::MemoryClassInfo::addPrivateBuffer):
+
 2012-11-08  Michael Saboff  <msab...@apple.com>
 
         HashAndUTF8CharactersTranslator should create an 8 bit string if possible

Modified: trunk/Source/WTF/wtf/MemoryInstrumentation.h (134032 => 134033)


--- trunk/Source/WTF/wtf/MemoryInstrumentation.h	2012-11-09 09:47:47 UTC (rev 134032)
+++ trunk/Source/WTF/wtf/MemoryInstrumentation.h	2012-11-09 09:50:57 UTC (rev 134033)
@@ -201,10 +201,10 @@
 
     template<typename M> void addMember(const M& member) { m_memoryInstrumentation->addObject(member, m_objectType); }
     void addRawBuffer(const void* const& buffer, size_t size) { m_memoryInstrumentation->addRawBuffer(buffer, m_objectType, size); }
-    void addPrivateBuffer(size_t size)
+    void addPrivateBuffer(size_t size, MemoryObjectType ownerObjectType = 0)
     {
         if (size)
-            m_memoryInstrumentation->countObjectSize(0, m_objectType, size);
+            m_memoryInstrumentation->countObjectSize(0, ownerObjectType ? ownerObjectType : m_objectType, size);
     }
 
     void addWeakPointer(void*) { }

Modified: trunk/Source/WebCore/ChangeLog (134032 => 134033)


--- trunk/Source/WebCore/ChangeLog	2012-11-09 09:47:47 UTC (rev 134032)
+++ trunk/Source/WebCore/ChangeLog	2012-11-09 09:50:57 UTC (rev 134033)
@@ -1,3 +1,19 @@
+2012-11-09  Alexei Filippov  <a...@chromium.org>
+
+        Web Inspector: Fix heap snapshots counted several times by NMI
+        https://bugs.webkit.org/show_bug.cgi?id=101085
+
+        The fix moves snapshots size counting to V8PerIsolateData class. As long
+        as it has one instance per isolate its reportMemoryUsage should be
+        called once per isolate.
+
+        Reviewed by Yury Semikhatsky.
+
+        * bindings/v8/V8PerIsolateData.cpp:
+        (WebCore::V8PerIsolateData::reportMemoryUsage):
+        * inspector/InspectorProfilerAgent.cpp:
+        (WebCore::InspectorProfilerAgent::reportMemoryUsage):
+
 2012-11-08  Pavel Feldman  <pfeld...@chromium.org>
 
         Web Inspector: split SplitView into SplitView and SidebarView

Modified: trunk/Source/WebCore/bindings/v8/V8PerIsolateData.cpp (134032 => 134033)


--- trunk/Source/WebCore/bindings/v8/V8PerIsolateData.cpp	2012-11-09 09:47:47 UTC (rev 134032)
+++ trunk/Source/WebCore/bindings/v8/V8PerIsolateData.cpp	2012-11-09 09:50:57 UTC (rev 134033)
@@ -27,6 +27,7 @@
 #include "V8PerIsolateData.h"
 
 #include "ScriptGCEvent.h"
+#include "ScriptProfiler.h"
 #include "V8Binding.h"
 #include <wtf/MemoryInstrumentationHashMap.h>
 #include <wtf/MemoryInstrumentationVector.h>
@@ -109,6 +110,8 @@
 
     for (size_t i = 0; i < m_domDataList.size(); i++)
         info.addMember(m_domDataList[i]);
+
+    info.addPrivateBuffer(ScriptProfiler::profilerSnapshotsSize(), WebCoreMemoryTypes::InspectorProfilerAgent);
 }
 
 #if ENABLE(INSPECTOR)

Modified: trunk/Source/WebCore/inspector/InspectorProfilerAgent.cpp (134032 => 134033)


--- trunk/Source/WebCore/inspector/InspectorProfilerAgent.cpp	2012-11-09 09:47:47 UTC (rev 134032)
+++ trunk/Source/WebCore/inspector/InspectorProfilerAgent.cpp	2012-11-09 09:50:57 UTC (rev 134033)
@@ -493,8 +493,6 @@
     info.addWeakPointer(m_frontend);
     info.addMember(m_profiles);
     info.addMember(m_snapshots);
-
-    info.addPrivateBuffer(ScriptProfiler::profilerSnapshotsSize());
 }
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to