*/
retainedSize: function()
{
- var snapshot = this._snapshot;
- return snapshot._nodes[this.nodeIndex + snapshot._nodeRetainedSizeOffset];
+ return this._snapshot._retainedSizes[this._ordinal()];
},
/**
*/
WebInspector.HeapSnapshot = function(profile, progress)
{
- this.uid = profile.snapshot.uid;
this._nodes = profile.nodes;
this._containmentEdges = profile.edges;
/** @type {!HeapSnapshotMetainfo} */
this._init();
- if (WebInspector.HeapSnapshot.enableAllocationProfiler) {
+ if (profile.snapshot.trace_function_count) {
this._progress.updateStatus("Buiding allocation statistics\u2026");
this._allocationProfile = new WebInspector.AllocationProfile(profile);
this._progress.updateStatus("Done");
}
}
-WebInspector.HeapSnapshot.enableAllocationProfiler = false;
-
/**
* @constructor
*/
{
// New format.
this.title = "";
- this.uid = 0;
this.meta = new HeapSnapshotMetainfo();
this.node_count = 0;
this.edge_count = 0;
var nodeSelfSizeOffset = this._nodeSelfSizeOffset;
var nodeFieldCount = this._nodeFieldCount;
var dominatorsTree = this._dominatorsTree;
- // Reuse now unused edge_count field to store retained size.
- var nodeRetainedSizeOffset = this._nodeRetainedSizeOffset = this._nodeEdgeCountOffset;
- delete this._nodeEdgeCountOffset;
+ var retainedSizes = this._retainedSizes = new Float64Array(nodeCount);
- for (var nodeIndex = 0, l = nodes.length; nodeIndex < l; nodeIndex += nodeFieldCount)
- nodes[nodeIndex + nodeRetainedSizeOffset] = nodes[nodeIndex + nodeSelfSizeOffset];
+ for (var nodeOrdinal = 0; nodeOrdinal < nodeCount; ++nodeOrdinal)
+ retainedSizes[nodeOrdinal] = nodes[nodeOrdinal * nodeFieldCount + nodeSelfSizeOffset];
// Propagate retained sizes for each node excluding root.
for (var postOrderIndex = 0; postOrderIndex < nodeCount - 1; ++postOrderIndex) {
var nodeOrdinal = postOrderIndex2NodeOrdinal[postOrderIndex];
- var nodeIndex = nodeOrdinal * nodeFieldCount;
- var dominatorIndex = dominatorsTree[nodeOrdinal] * nodeFieldCount;
- nodes[dominatorIndex + nodeRetainedSizeOffset] += nodes[nodeIndex + nodeRetainedSizeOffset];
+ var dominatorOrdinal = dominatorsTree[nodeOrdinal];
+ retainedSizes[dominatorOrdinal] += retainedSizes[nodeOrdinal];
}
},
*/
updateStaticData: function()
{
- return new WebInspector.HeapSnapshotCommon.StaticData(this.nodeCount, this._rootNodeIndex, this.totalSize, this.uid, this._maxJsNodeId());
+ return new WebInspector.HeapSnapshotCommon.StaticData(this.nodeCount, this._rootNodeIndex, this.totalSize, this._maxJsNodeId());
}
};