Title: [102006] trunk/Source/WebCore
Revision
102006
Author
mnaga...@chromium.org
Date
2011-12-05 09:29:50 -0800 (Mon, 05 Dec 2011)

Log Message

Web Inspector: [Chromium] Heap profiler should designate weak references.
https://bugs.webkit.org/show_bug.cgi?id=69948

Weak references are now ignored when tracing paths to GC roots.

Reviewed by Yury Semikhatsky.

* inspector/front-end/HeapSnapshot.js:
(WebInspector.HeapSnapshotEdge.prototype.get isWeak):
(WebInspector.HeapSnapshotEdge.prototype.toString):
(WebInspector.HeapSnapshotEdge.prototype.get _hasStringName):
(WebInspector.HeapSnapshotRetainerEdge.prototype.get isWeak):
(WebInspector.HeapSnapshot.prototype._init):
(WebInspector.HeapSnapshotPathFinder.prototype._fillRootChildren):
(WebInspector.HeapSnapshotPathFinder.prototype._skipEdge):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (102005 => 102006)


--- trunk/Source/WebCore/ChangeLog	2011-12-05 17:07:30 UTC (rev 102005)
+++ trunk/Source/WebCore/ChangeLog	2011-12-05 17:29:50 UTC (rev 102006)
@@ -1,3 +1,21 @@
+2011-12-05  Mikhail Naganov  <mnaga...@chromium.org>
+
+        Web Inspector: [Chromium] Heap profiler should designate weak references.
+        https://bugs.webkit.org/show_bug.cgi?id=69948
+
+        Weak references are now ignored when tracing paths to GC roots.
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/front-end/HeapSnapshot.js:
+        (WebInspector.HeapSnapshotEdge.prototype.get isWeak):
+        (WebInspector.HeapSnapshotEdge.prototype.toString):
+        (WebInspector.HeapSnapshotEdge.prototype.get _hasStringName):
+        (WebInspector.HeapSnapshotRetainerEdge.prototype.get isWeak):
+        (WebInspector.HeapSnapshot.prototype._init):
+        (WebInspector.HeapSnapshotPathFinder.prototype._fillRootChildren):
+        (WebInspector.HeapSnapshotPathFinder.prototype._skipEdge):
+
 2011-12-05  Sheriff Bot  <webkit.review....@gmail.com>
 
         Unreviewed, rolling out r102004.

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


--- trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js	2011-12-05 17:07:30 UTC (rev 102005)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js	2011-12-05 17:29:50 UTC (rev 102006)
@@ -236,6 +236,11 @@
         return this._type() === this._snapshot._edgeHiddenType;
     },
 
+    get isWeak()
+    {
+        return this._type() === this._snapshot._edgeWeakType;
+    },
+
     get isInternal()
     {
         return this._type() === this._snapshot._edgeInternalType;
@@ -279,6 +284,7 @@
         switch (this.type) {
         case "context": return "->" + this.name;
         case "element": return "[" + this.name + "]";
+        case "weak": return "[[" + this.name + "]]";
         case "property":
             return this.name.indexOf(" ") === -1 ? "." + this.name : "[\"" + this.name + "\"]";
         case "shortcut":
@@ -302,7 +308,7 @@
 
     get _hasStringName()
     {
-        return !this.isElement && !this.isHidden;
+        return !this.isElement && !this.isHidden && !this.isWeak;
     },
 
     get _name()
@@ -401,6 +407,11 @@
         return this._edge.isShortcut;
     },
 
+    get isWeak()
+    {
+        return this._edge.isWeak;
+    },
+
     get name()
     {
         return this._edge.name;
@@ -695,6 +706,7 @@
         this._edgeHiddenType = this._edgeTypes.indexOf("hidden");
         this._edgeInternalType = this._edgeTypes.indexOf("internal");
         this._edgeShortcutType = this._edgeTypes.indexOf("shortcut");
+        this._edgeWeakType = this._edgeTypes.indexOf("weak");
         this._edgeInvisibleType = this._edgeTypes.length;
         this._edgeTypes.push("invisible");
 
@@ -1406,8 +1418,12 @@
     {
         var result = [];
         for (var iter = this._snapshot.rootNode.edges; iter.hasNext(); iter.next()) {
-            if (!filter || filter(iter.edge.node))
+            if (!filter) {
+                if (!iter.edge.isShortcut)
+                    result[iter.edge.nodeIndex] = true;
+            } else if (filter(iter.edge.node)) {
                 result[iter.edge.nodeIndex] = true;
+            }
         }
         return result;
     },
@@ -1450,6 +1466,7 @@
     {
         return edge.isInvisible
             || (this._skipHidden && (edge.isHidden || edge.node.isHidden))
+            || edge.isWeak
             || this._hasInPath(edge.nodeIndex);
     },
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to