Title: [241274] trunk/Tools
Revision
241274
Author
[email protected]
Date
2019-02-11 11:25:50 -0800 (Mon, 11 Feb 2019)

Log Message

GCHeapInspector: Show the retained sizes in more places
https://bugs.webkit.org/show_bug.cgi?id=194464

Patch by Joseph Pecoraro <[email protected]> on 2019-02-11
Reviewed by Simon Fraser.

* GCHeapInspector/gc-heap-inspector.html:
* GCHeapInspector/script/interface.js:
(HeapInspectorUtils.humanReadableSize):
(HeapInspectorUtils.spanForNode.let.nodeHTML.node.className.span):
(HeapInspectorUtils.spanForNode.span.span):
(HeapSnapshotInspector.prototype.buildAllObjectsByType):
(HeapSnapshotInspector.prototype.buildRoots):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (241273 => 241274)


--- trunk/Tools/ChangeLog	2019-02-11 19:02:49 UTC (rev 241273)
+++ trunk/Tools/ChangeLog	2019-02-11 19:25:50 UTC (rev 241274)
@@ -1,3 +1,18 @@
+2019-02-11  Joseph Pecoraro  <[email protected]>
+
+        GCHeapInspector: Show the retained sizes in more places
+        https://bugs.webkit.org/show_bug.cgi?id=194464
+
+        Reviewed by Simon Fraser.
+
+        * GCHeapInspector/gc-heap-inspector.html:
+        * GCHeapInspector/script/interface.js:
+        (HeapInspectorUtils.humanReadableSize):
+        (HeapInspectorUtils.spanForNode.let.nodeHTML.node.className.span):
+        (HeapInspectorUtils.spanForNode.span.span):
+        (HeapSnapshotInspector.prototype.buildAllObjectsByType):
+        (HeapSnapshotInspector.prototype.buildRoots):
+
 2019-02-11  Daniel Bates  <[email protected]>
 
         [iOS] Mouse/Touch/Pointer events are missing modifier keys

Modified: trunk/Tools/GCHeapInspector/gc-heap-inspector.html (241273 => 241274)


--- trunk/Tools/GCHeapInspector/gc-heap-inspector.html	2019-02-11 19:02:49 UTC (rev 241273)
+++ trunk/Tools/GCHeapInspector/gc-heap-inspector.html	2019-02-11 19:25:50 UTC (rev 241274)
@@ -66,8 +66,9 @@
             color: gray;
         }
         
-        .node-size {
-            display: none;
+        .retained-size {
+            font-family: monospace;
+            color: rgb(25, 88, 180);
         }
         
         .node-gc-root {

Modified: trunk/Tools/GCHeapInspector/script/interface.js (241273 => 241274)


--- trunk/Tools/GCHeapInspector/script/interface.js	2019-02-11 19:02:49 UTC (rev 241273)
+++ trunk/Tools/GCHeapInspector/script/interface.js	2019-02-11 19:25:50 UTC (rev 241274)
@@ -37,8 +37,8 @@
     {
         var i = -1;
         if (sizeInBytes < 512)
-            return sizeInBytes + '&thinsp;B';
-        var byteUnits = ['&thinsp;KB', '&thinsp;MB', '&thinsp;GB'];
+            return sizeInBytes + 'B';
+        var byteUnits = ['KB', 'MB', 'GB'];
         do {
             sizeInBytes = sizeInBytes / 1024;
             i++;
@@ -75,7 +75,7 @@
 
         let wrappedAddressString = node.wrappedAddress ? `wrapped ${node.wrappedAddress}` : '';
 
-        let nodeHTML = node.className + ` <span class="node-id">${node.id}</span> <span class="node-address">cell ${node.address} ${wrappedAddressString}</span> <span class="node-size">(retains ${HeapInspectorUtils.humanReadableSize(node.retainedSize)})</span>`;
+        let nodeHTML = node.className + ` <span class="node-id">${node.id}</span> <span class="node-address">cell ${node.address} ${wrappedAddressString}</span> <span class="node-size retained-size">(retains ${HeapInspectorUtils.humanReadableSize(node.retainedSize)})</span>`;
     
         if (node.label.length)
             nodeHTML += ` <span class="node-label">“${node.label}”</span>`;
@@ -273,6 +273,11 @@
 
             let details = DOMUtils.createDetails(`${category.className} (${category.count})`);
             
+            let summaryElement = details.firstChild;
+            let sizeElement = summaryElement.appendChild(document.createElement('span'));
+            sizeElement.className = 'retained-size';
+            sizeElement.textContent = ' ' + HeapInspectorUtils.humanReadableSize(category.retainedSize);
+            
             let instanceListElement = document.createElement('ul');
             instanceListElement.className = 'instance-list';
             
@@ -314,6 +319,13 @@
             })
 
             let details = DOMUtils.createDetails(`${rootClassName} (${rootsOfType.length})`);
+
+            let summaryElement = details.firstChild;
+            let retainedSize = rootsOfType.reduce((accumulator, node) => accumulator + node.retainedSize, 0);
+            let sizeElement = summaryElement.appendChild(document.createElement('span'));
+            sizeElement.className = 'retained-size';
+            sizeElement.textContent = ' ' + HeapInspectorUtils.humanReadableSize(retainedSize);
+
             let rootsTypeList = document.createElement('ul')
             rootsTypeList.className = 'instance-list';
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to