Title: [113988] trunk
Revision
113988
Author
[email protected]
Date
2012-04-12 08:57:19 -0700 (Thu, 12 Apr 2012)

Log Message

Web Inspector: Move meta node out of nodes in snapshot serialization.
https://bugs.webkit.org/show_bug.cgi?id=83701

Patch by Alexei Filippov <[email protected]> on 2012-04-12
Reviewed by Yury Semikhatsky.

Source/WebCore:

* inspector/front-end/HeapSnapshot.js:
(WebInspector.HeapSnapshotLoader.prototype.pushJSONChunk):
(WebInspector.HeapSnapshot):

LayoutTests:

* inspector/profiler/heap-snapshot-test.js:
(initialize_HeapSnapshotTest.InspectorTest.createHeapSnapshotSplitNodesEdgesMockRaw):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (113987 => 113988)


--- trunk/LayoutTests/ChangeLog	2012-04-12 15:53:46 UTC (rev 113987)
+++ trunk/LayoutTests/ChangeLog	2012-04-12 15:57:19 UTC (rev 113988)
@@ -1,3 +1,13 @@
+2012-04-12  Alexei Filippov  <[email protected]>
+
+        Web Inspector: Move meta node out of nodes in snapshot serialization.
+        https://bugs.webkit.org/show_bug.cgi?id=83701
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/profiler/heap-snapshot-test.js:
+        (initialize_HeapSnapshotTest.InspectorTest.createHeapSnapshotSplitNodesEdgesMockRaw):
+
 2012-04-12  Philippe Normand  <[email protected]>
 
         Unreviewed, GTK test_expectations post-Skipped-migration update.

Modified: trunk/LayoutTests/inspector/profiler/heap-snapshot-test.js (113987 => 113988)


--- trunk/LayoutTests/inspector/profiler/heap-snapshot-test.js	2012-04-12 15:53:46 UTC (rev 113987)
+++ trunk/LayoutTests/inspector/profiler/heap-snapshot-test.js	2012-04-12 15:57:19 UTC (rev 113988)
@@ -78,15 +78,16 @@
     // Return the same snapshot as above but having the nodes and edges
     // separated.
     return {
-        snapshot: {},
-        nodes: [
-            {
-                separate_edges: true,
+        snapshot: {
+            meta: {
                 node_fields: ["type", "name", "id", "self_size", "retained_size", "dominator", "edges_index"],
                 node_types: [["hidden", "object"], "", "", "", "", "", ""],
                 edge_fields: ["type", "name_or_index", "to_node"],
                 edge_types: [["element", "property"], "", ""]
             },
+            node_count: 6,
+            edge_count: 7},
+        nodes: [
             0, 0, 1, 0, 20,  0,  0,
             1, 1, 2, 2,  2,  0,  6,
             1, 2, 3, 3,  8,  0, 12,
@@ -104,7 +105,7 @@
 
 InspectorTest._postprocessHeapSnapshotMock = function(mock)
 {
-    mock.metaNode = mock.nodes[0];
+    mock.snapshot.meta = mock.nodes[0];
     mock.nodes[0] = 0;
     var tempNodes = new Int32Array(1000);
     tempNodes.set(mock.nodes);

Modified: trunk/Source/WebCore/ChangeLog (113987 => 113988)


--- trunk/Source/WebCore/ChangeLog	2012-04-12 15:53:46 UTC (rev 113987)
+++ trunk/Source/WebCore/ChangeLog	2012-04-12 15:57:19 UTC (rev 113988)
@@ -1,3 +1,14 @@
+2012-04-12  Alexei Filippov  <[email protected]>
+
+        Web Inspector: Move meta node out of nodes in snapshot serialization.
+        https://bugs.webkit.org/show_bug.cgi?id=83701
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/front-end/HeapSnapshot.js:
+        (WebInspector.HeapSnapshotLoader.prototype.pushJSONChunk):
+        (WebInspector.HeapSnapshot):
+
 2012-04-12  Yael Aharon  <[email protected]>
 
         [Qt][WK2] Nested fixed elements scroll too fast

Modified: trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js (113987 => 113988)


--- trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js	2012-04-12 15:53:46 UTC (rev 113987)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js	2012-04-12 15:57:19 UTC (rev 113988)
@@ -176,7 +176,15 @@
             if (bracketIndex === -1)
                 return;
             this._json = this._json.slice(bracketIndex + 1);
-            this._state = "parse-nodes-meta-info";
+            if (this._snapshot.snapshot.meta) {
+                var node_fields_count = this._snapshot.snapshot.meta.node_fields.length;
+                var nodes_length = this._snapshot.snapshot.node_count * node_fields_count;
+                this._array = new WebInspector.Uint32Array(nodes_length);
+                this._snapshot.snapshot.meta.separate_edges = true;
+                this._state = "parse-nodes";
+            } else {
+                this._state = "parse-nodes-meta-info";
+            }
             this.pushJSONChunk("");
             break;
         }
@@ -184,11 +192,10 @@
             var closingBracketIndex = this._findBalancedCurlyBrackets();
             if (closingBracketIndex === -1)
                 return;
-            this._snapshot.metaNode = JSON.parse(this._json.slice(0, closingBracketIndex));
+            this._snapshot.snapshot.meta = JSON.parse(this._json.slice(0, closingBracketIndex));
             this._json = this._json.slice(closingBracketIndex);
             this._array = new WebInspector.Uint32Array();
-            if (!this._snapshot.metaNode.separate_edges)
-                this._array.push(0);
+            this._array.push(0);
             this._state = "parse-nodes";
             this.pushJSONChunk("");
             break;
@@ -196,7 +203,7 @@
         case "parse-nodes": {
             if (this._parseUintArray())
                 return;
-            if (this._snapshot.metaNode.separate_edges) {
+            if (this._snapshot.snapshot.meta.separate_edges) {
                 this._snapshot._onlyNodes_ = this._array.array;
                 this._state = "find-edges";
             } else {
@@ -216,7 +223,9 @@
             if (bracketIndex === -1)
                 return;
             this._json = this._json.slice(bracketIndex + 1);
-            this._array = new WebInspector.Uint32Array();
+            var edge_fields_count = this._snapshot.snapshot.meta.edge_fields.length;
+            var edges_length = this._snapshot.snapshot.edge_count * edge_fields_count;
+            this._array = new WebInspector.Uint32Array(edges_length);
             this._state = "parse-edges";
             this.pushJSONChunk("");
             break;
@@ -823,7 +832,7 @@
     this._onlyNodes = profile.onlyNodes;
     this._containmentEdges = profile.containmentEdges;
     /** @type{HeapSnapshotMetainfo} */
-    this._metaNode = profile.metaNode;
+    this._metaNode = profile.snapshot.meta;
     this._strings = profile.strings;
 
     this._init();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to