Title: [126746] trunk/Source/WebCore
Revision
126746
Author
[email protected]
Date
2012-08-27 04:32:46 -0700 (Mon, 27 Aug 2012)

Log Message

Web Inspector: HeapSnapshot: filter weak links in markQueriableHeapObjects and two other minor fixes.
https://bugs.webkit.org/show_bug.cgi?id=95068

Reviewed by Yury Semikhatsky.

- count shortcuts as normal links in distance;
shortcuts help us to show object properties without exposing internal scope object
- set initial distance to 1 instead of 0
the initial value for window was 0 and bfs counted the window object as not visited.

* inspector/front-end/HeapSnapshot.js:
(WebInspector.HeapSnapshot.prototype._calculateObjectToWindowDistance):
(WebInspector.HeapSnapshot.prototype._bfs):
(WebInspector.HeapSnapshot.prototype._markQueriableHeapObjects):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (126745 => 126746)


--- trunk/Source/WebCore/ChangeLog	2012-08-27 11:09:05 UTC (rev 126745)
+++ trunk/Source/WebCore/ChangeLog	2012-08-27 11:32:46 UTC (rev 126746)
@@ -1,3 +1,20 @@
+2012-08-27  Ilya Tikhonovsky  <[email protected]>
+
+        Web Inspector: HeapSnapshot: filter weak links in markQueriableHeapObjects and two other minor fixes.
+        https://bugs.webkit.org/show_bug.cgi?id=95068
+
+        Reviewed by Yury Semikhatsky.
+
+        - count shortcuts as normal links in distance;
+        shortcuts help us to show object properties without exposing internal scope object
+        - set initial distance to 1 instead of 0
+        the initial value for window was 0 and bfs counted the window object as not visited.
+
+        * inspector/front-end/HeapSnapshot.js:
+        (WebInspector.HeapSnapshot.prototype._calculateObjectToWindowDistance):
+        (WebInspector.HeapSnapshot.prototype._bfs):
+        (WebInspector.HeapSnapshot.prototype._markQueriableHeapObjects):
+
 2012-08-27  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r126694 and r126731.

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


--- trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js	2012-08-27 11:09:05 UTC (rev 126745)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js	2012-08-27 11:32:46 UTC (rev 126746)
@@ -919,7 +919,7 @@
             var node = iter.edge.node();
             if (node.isWindow()) {
                 nodesToVisit[nodesToVisitLength++] = node.nodeIndex;
-                distances[node.nodeIndex / nodeFieldCount] = 0;
+                distances[node.nodeIndex / nodeFieldCount] = 1;
             }
         }
         this._bfs(nodesToVisit, nodesToVisitLength, distances);
@@ -927,7 +927,7 @@
         // bfs for root
         nodesToVisitLength = 0;
         nodesToVisit[nodesToVisitLength++] = this._rootNodeIndex;
-        distances[this._rootNodeIndex / nodeFieldCount] = 0;
+        distances[this._rootNodeIndex / nodeFieldCount] = 1;
         this._bfs(nodesToVisit, nodesToVisitLength, distances);
         this._distancesToWindow = distances;
     },
@@ -956,7 +956,7 @@
             var edgesEnd = firstEdgeIndexes[nodeOrdinal + 1];
             for (var edgeIndex = firstEdgeIndex; edgeIndex < edgesEnd; edgeIndex += edgeFieldsCount) {
                 var edgeType = containmentEdges[edgeIndex + edgeTypeOffset];
-                if (edgeType == edgeWeakType || edgeType == edgeShortcutType)
+                if (edgeType == edgeWeakType)
                     continue;
                 var childNodeIndex = containmentEdges[edgeIndex + edgeToNodeOffset];
                 var childNodeOrdinal = childNodeIndex / nodeFieldCount;
@@ -1456,6 +1456,7 @@
         var hiddenEdgeType = this._edgeHiddenType;
         var internalEdgeType = this._edgeInternalType;
         var invisibleEdgeType = this._edgeInvisibleType;
+        var weakEdgeType = this._edgeWeakType;
         var edgeToNodeOffset = this._edgeToNodeOffset;
         var edgeTypeOffset = this._edgeTypeOffset;
         var edgeFieldsCount = this._edgeFieldsCount;
@@ -1486,7 +1487,7 @@
                 if (flags[childNodeOrdinal] & flag)
                     continue;
                 var type = containmentEdges[edgeIndex + edgeTypeOffset];
-                if (type === hiddenEdgeType || type === invisibleEdgeType || type === internalEdgeType)
+                if (type === hiddenEdgeType || type === invisibleEdgeType || type === internalEdgeType || type === weakEdgeType)
                     continue;
                 list.push(childNodeOrdinal);
             }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to