Commit 82bad543 authored by yurys@chromium.org's avatar yurys@chromium.org
Browse files

Unreviewed, rolling out r111688.

http://trac.webkit.org/changeset/111688
https://bugs.webkit.org/show_bug.cgi?id=81912

"Heap profiler test fails" (Requested by yurys on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-03-22

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@111702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a0a09190
2012-03-22 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r111688.
http://trac.webkit.org/changeset/111688
https://bugs.webkit.org/show_bug.cgi?id=81912
"Heap profiler test fails" (Requested by yurys on #webkit).
* inspector/front-end/HeapSnapshot.js:
(WebInspector.HeapSnapshot.prototype._buildRetainers):
2012-03-22 Dana Jansens <danakj@chromium.org> 2012-03-22 Dana Jansens <danakj@chromium.org>
   
[chromium] Early out in a new prepareToDraw() step if checkerboarding an accelerated animation in order to skip the frame [chromium] Early out in a new prepareToDraw() step if checkerboarding an accelerated animation in order to skip the frame
...@@ -959,56 +959,22 @@ WebInspector.HeapSnapshot.prototype = { ...@@ -959,56 +959,22 @@ WebInspector.HeapSnapshot.prototype = {
_buildRetainers: function() _buildRetainers: function()
{ {
var nodeIndexes = this.nodeIndexes; this._buildReverseIndex(
var nodePositions = this._nodePosition; "_retainerIndex",
var nodeCount = this.nodeCount; "_retainers",
var nodes = this._nodes; (function (node, callback)
{
// Builds up two arrays: for (var edgesIter = node.edges; edgesIter.hasNext(); edgesIter.next())
// - "backRefsArray" is a continuous array, where each node owns an callback(this._nodePosition[edgesIter.edge.nodeIndex]);
// interval (can be empty) with corresponding back references. }).bind(this),
// - "indexArray" is an array of indexes in the "backRefsArray" (function (node, indexCallback, dataCallback)
// with the same positions as in the _nodeIndex. {
var indexArray = this._retainerIndex = new Int32Array(nodeCount); for (var edgesIter = node.edges; edgesIter.hasNext(); edgesIter.next()) {
var edgesCountOffset = this._edgesCountOffset; var edge = edgesIter.edge;
var firstEdgeOffset = this._firstEdgeOffset; var retIndex = this._getRetainerIndex(edge.nodeIndex);
var edgeFieldsCount = this._edgeFieldsCount; dataCallback(indexCallback(retIndex), node.nodeIndex + this._firstEdgeOffset + edge.edgeIndex);
var edgeToNodeOffset = this._edgeToNodeOffset; }
var backRefsCount = 0; }).bind(this));
// Count the number of retainers for each node
for (var i = 0; i < nodeCount; ++i) {
var nodeIndex = nodeIndexes[i];
var edgesOffset = nodeIndex + firstEdgeOffset + edgeToNodeOffset;
var edgesCount = nodes[nodeIndex + edgesCountOffset];
backRefsCount += edgesCount;
for (var j = 0; j < edgesCount; ++j) {
var targetNodeIndex = nodes[j * edgeFieldsCount + edgesOffset];
++indexArray[nodePositions[targetNodeIndex]];
}
}
var backRefsArray = this._retainers = new Int32Array(backRefsCount);
// Put in the first slot of each backRefsArray slice the count of entries
// that will be filled.
var backRefsPosition = 0;
for (i = 0; i < nodeCount; ++i) {
backRefsCount = backRefsArray[backRefsPosition] = indexArray[i];
indexArray[i] = backRefsPosition;
backRefsPosition += backRefsCount;
}
var retainerIndex = this._retainerIndex;
// Fill up the retainers array with indexes of edges.
for (var i = 0; i < nodeCount; ++i) {
var nodeIndex = nodeIndexes[i];
var edgesOffset = nodeIndex + firstEdgeOffset;
var edgesCount = nodes[nodeIndex + edgesCountOffset];
for (var j = 0; j < edgesCount; ++j) {
var edgeIndex = j * edgeFieldsCount + edgesOffset;
var retNode = nodePositions[nodes[edgeIndex + edgeToNodeOffset]];
var retIndex = indexArray[retNode];
var backRefIndex = retIndex + (--backRefsArray[retIndex]);
backRefsArray[backRefIndex] = edgeIndex;
}
}
}, },
_calculateObjectToWindowDistance: function() _calculateObjectToWindowDistance: function()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment