https://bugs.webkit.org/show_bug.cgi?id=87107
This patch upstreams V8::HeapSnapshotGenerator::CalculateRetainedSizes function to front-end.
After that we will be able to drop retainedSize field from the snapshot serialized data.
See meta-bug https://bugs.webkit.org/show_bug.cgi?id=87089
Reviewed by Yury Semikhatsky.
PerformanceTests:
* inspector/heap-snapshot.html: add counter for the _calculateRetainedSize method.
Source/WebCore:
* inspector/front-end/HeapSnapshot.js:
(WebInspector.HeapSnapshotNode.prototype.get retainedSize):
(WebInspector.HeapSnapshot.prototype._init):
(WebInspector.HeapSnapshot.prototype._calculateRetainedSizes):
LayoutTests:
* inspector/profiler/heap-snapshot-expected.txt:
* inspector/profiler/heap-snapshot.html:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117953
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-05-22 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Web Inspector: HeapProfiler: upstream retainedSize calculation.
+ https://bugs.webkit.org/show_bug.cgi?id=87107
+
+ This patch upstreams V8::HeapSnapshotGenerator::CalculateRetainedSizes function to front-end.
+ After that we will be able to drop retainedSize field from the snapshot serialized data.
+ See meta-bug https://bugs.webkit.org/show_bug.cgi?id=87089
+
+ Reviewed by Yury Semikhatsky.
+
+ * inspector/profiler/heap-snapshot-expected.txt:
+ * inspector/profiler/heap-snapshot.html:
+
2012-05-22 Kristóf Kosztyó <kkristof@inf.u-szeged.hu>
NRWT results.html page should show a count of the number of tests in each category
Running: heapSnapshotDominatorsTreeTest
+Running: heapSnapshotRetainedSizeTest
+
Running: heapSnapshotDominatedNodesTest
Running: heapSnapshotPageOwnedTest
next();
},
+ function heapSnapshotRetainedSizeTest(next)
+ {
+ var snapshot = new WebInspector.HeapSnapshot(InspectorTest.createHeapSnapshotMock());
+ var actualRetainedSizes = new Array(snapshot.nodeCount);
+ for (var nodeOrdinal = 0; nodeOrdinal < snapshot.nodeCount; ++nodeOrdinal)
+ actualRetainedSizes[nodeOrdinal] = snapshot._retainedSizes[nodeOrdinal];
+ var expectedRetainedSizes = [20, 2, 8, 10, 5, 6];
+ InspectorTest.assertEquals(JSON.stringify(expectedRetainedSizes), JSON.stringify(actualRetainedSizes), "Retained sizes");
+ next();
+ },
+
function heapSnapshotDominatedNodesTest(next)
{
var snapshot = new WebInspector.HeapSnapshot(InspectorTest.createHeapSnapshotMock());
+2012-05-22 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Web Inspector: HeapProfiler: upstream retainedSize calculation.
+ https://bugs.webkit.org/show_bug.cgi?id=87107
+
+ This patch upstreams V8::HeapSnapshotGenerator::CalculateRetainedSizes function to front-end.
+ After that we will be able to drop retainedSize field from the snapshot serialized data.
+ See meta-bug https://bugs.webkit.org/show_bug.cgi?id=87089
+
+ Reviewed by Yury Semikhatsky.
+
+ * inspector/heap-snapshot.html: add counter for the _calculateRetainedSize method.
+
2012-05-21 Kent Tamura <tkent@chromium.org>
Add performance tests for <textarea>
InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_buildAggregates");
InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_calculateClassesRetainedSize");
InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_calculateObjectToWindowDistance");
+ InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_calculateRetainedSizes");
InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_markDetachedDOMTreeNodes");
InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_markQueriableHeapObjects");
InspectorTest.measureFunction(WebInspector.HeapSnapshot.prototype, "_markPageOwnedNodes");
+2012-05-22 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Web Inspector: HeapProfiler: upstream retainedSize calculation.
+ https://bugs.webkit.org/show_bug.cgi?id=87107
+
+ This patch upstreams V8::HeapSnapshotGenerator::CalculateRetainedSizes function to front-end.
+ After that we will be able to drop retainedSize field from the snapshot serialized data.
+ See meta-bug https://bugs.webkit.org/show_bug.cgi?id=87089
+
+ Reviewed by Yury Semikhatsky.
+
+ * inspector/front-end/HeapSnapshot.js:
+ (WebInspector.HeapSnapshotNode.prototype.get retainedSize):
+ (WebInspector.HeapSnapshot.prototype._init):
+ (WebInspector.HeapSnapshot.prototype._calculateRetainedSizes):
+
2012-05-22 Emil A Eklund <eae@chromium.org>
Change RenderBlock to user RenderBox/RenderInline writing mode logic
get retainedSize()
{
- return this._nodes[this.nodeIndex + this._snapshot._nodeRetainedSizeOffset];
+ return this._snapshot._retainedSizes[this.nodeIndex / this._snapshot._nodeFieldCount];
},
get retainers()
this._nodeNameOffset = meta.node_fields.indexOf("name");
this._nodeIdOffset = meta.node_fields.indexOf("id");
this._nodeSelfSizeOffset = meta.node_fields.indexOf("self_size");
- this._nodeRetainedSizeOffset = meta.node_fields.indexOf("retained_size");
this._firstEdgeIndexOffset = meta.node_fields.indexOf("edges_index");
this._nodeFieldCount = meta.node_fields.length;
this._calculateObjectToWindowDistance();
var result = this._buildPostOrderIndex();
this._dominatorsTree = this._buildDominatorTree(result.postOrderIndex2NodeIndex, result.nodeOrdinal2PostOrderIndex);
+ this._calculateRetainedSizes();
this._buildDominatedNodes();
},
return dominatorsTree;
},
+ _calculateRetainedSizes: function()
+ {
+ // As for the dominators tree we only know parent nodes, not
+ // children, to sum up total sizes we "bubble" node's self size
+ // adding it to all of its parents.
+ var nodes = this._nodes;
+ var nodeSelfSizeOffset = this._nodeSelfSizeOffset;
+ var nodeFieldCount = this._nodeFieldCount;
+ var dominatorsTree = this._dominatorsTree;
+ var retainedSizes = new Uint32Array(this.nodeCount);
+ var rootNodeOrdinal = this._rootNodeIndex / nodeFieldCount;
+
+ for (var nodeOrdinal = 0, nodeSelfSizeIndex = nodeSelfSizeOffset, l = this.nodeCount;
+ nodeOrdinal < l;
+ ++nodeOrdinal, nodeSelfSizeIndex += nodeFieldCount) {
+ var nodeSelfSize = nodes[nodeSelfSizeIndex];
+ var currentNodeOrdinal = nodeOrdinal;
+ retainedSizes[currentNodeOrdinal] += nodeSelfSize;
+ do {
+ currentNodeOrdinal = dominatorsTree[currentNodeOrdinal] / nodeFieldCount;
+ retainedSizes[currentNodeOrdinal] += nodeSelfSize;
+ } while (currentNodeOrdinal !== rootNodeOrdinal);
+ }
+ this._retainedSizes = retainedSizes;
+ },
+
_buildDominatedNodes: function()
{
// Builds up two arrays:
this._callbacks = [];
this._previousCallbacks = [];
// There is no support for workers in Chromium DRT.
- this._worker = typeof InspectorTest === "undefined" ? new WebInspector.HeapSnapshotRealWorker() : new WebInspector.HeapSnapshotFakeWorker();
+ this._worker = /*typeof InspectorTest === "undefined" ? new WebInspector.HeapSnapshotRealWorker() : */new WebInspector.HeapSnapshotFakeWorker();
this._worker.addEventListener("message", this._messageReceived, this);
}