- Revision
- 109660
- Author
- [email protected]
- Date
- 2012-03-03 04:34:40 -0800 (Sat, 03 Mar 2012)
Log Message
Unreviewed, rolling out r109343.
http://trac.webkit.org/changeset/109343
https://bugs.webkit.org/show_bug.cgi?id=80212
Int32array can't handle values for native nodes because they
have int64 ids (Requested by loislo1 on #webkit).
Patch by Sheriff Bot <[email protected]> on 2012-03-03
Source/WebCore:
* inspector/front-end/HeapSnapshot.js:
(WebInspector.HeapSnapshotLoader.prototype._parseNodes):
(WebInspector.HeapSnapshotLoader.prototype.pushJSONChunk):
(WebInspector.HeapSnapshot):
(WebInspector.HeapSnapshot.prototype._init):
LayoutTests:
* inspector/profiler/heap-snapshot-loader.html:
* inspector/profiler/heap-snapshot-test.js:
(initialize_HeapSnapshotTest.InspectorTest.createHeapSnapshotMock):
(initialize_HeapSnapshotTest.InspectorTest.createHeapSnapshotMockWithDOM):
(initialize_HeapSnapshotTest):
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (109659 => 109660)
--- trunk/LayoutTests/ChangeLog 2012-03-03 09:16:57 UTC (rev 109659)
+++ trunk/LayoutTests/ChangeLog 2012-03-03 12:34:40 UTC (rev 109660)
@@ -1,3 +1,18 @@
+2012-03-03 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r109343.
+ http://trac.webkit.org/changeset/109343
+ https://bugs.webkit.org/show_bug.cgi?id=80212
+
+ Int32array can't handle values for native nodes because they
+ have int64 ids (Requested by loislo1 on #webkit).
+
+ * inspector/profiler/heap-snapshot-loader.html:
+ * inspector/profiler/heap-snapshot-test.js:
+ (initialize_HeapSnapshotTest.InspectorTest.createHeapSnapshotMock):
+ (initialize_HeapSnapshotTest.InspectorTest.createHeapSnapshotMockWithDOM):
+ (initialize_HeapSnapshotTest):
+
2012-03-03 Philippe Normand <[email protected]>
Unreviewed, GTK tests_expectations update.
Modified: trunk/LayoutTests/inspector/profiler/heap-snapshot-loader.html (109659 => 109660)
--- trunk/LayoutTests/inspector/profiler/heap-snapshot-loader.html 2012-03-03 09:16:57 UTC (rev 109659)
+++ trunk/LayoutTests/inspector/profiler/heap-snapshot-loader.html 2012-03-03 12:34:40 UTC (rev 109660)
@@ -14,14 +14,14 @@
InspectorTest.runTestSuite([
function heapSnapshotLoaderTest(next)
{
- var source = InspectorTest.createHeapSnapshotMockRaw();
+ var source = InspectorTest.createHeapSnapshotMock();
var sourceStringified = JSON.stringify(source);
var partSize = sourceStringified.length >> 3;
var loader = new WebInspector.HeapSnapshotLoader();
for (var i = 0, l = sourceStringified.length; i < l; i += partSize)
loader.pushJSONChunk(sourceStringified.slice(i, i + partSize));
var result = loader.finishLoading();
- InspectorTest.assertSnapshotEquals(new WebInspector.HeapSnapshot(InspectorTest.createHeapSnapshotMock()), result);
+ InspectorTest.assertSnapshotEquals(new WebInspector.HeapSnapshot(source), result);
next();
}
]);
Modified: trunk/LayoutTests/inspector/profiler/heap-snapshot-test.js (109659 => 109660)
--- trunk/LayoutTests/inspector/profiler/heap-snapshot-test.js 2012-03-03 09:16:57 UTC (rev 109659)
+++ trunk/LayoutTests/inspector/profiler/heap-snapshot-test.js 2012-03-03 12:34:40 UTC (rev 109660)
@@ -37,7 +37,7 @@
};
};
-InspectorTest.createHeapSnapshotMockRaw = function()
+InspectorTest.createHeapSnapshotMock = function()
{
return {
snapshot: {},
@@ -66,24 +66,9 @@
};
};
-InspectorTest._postprocessHeapSnapshotMock = function(mock)
-{
- mock.metaNode = mock.nodes[0];
- mock.nodes[0] = 0;
- var tempNodes = new Int32Array(1000);
- tempNodes.set(mock.nodes);
- mock.nodes = tempNodes.subarray(0, mock.nodes.length);
- return mock;
-};
-
-InspectorTest.createHeapSnapshotMock = function()
-{
- return InspectorTest._postprocessHeapSnapshotMock(InspectorTest.createHeapSnapshotMockRaw());
-};
-
InspectorTest.createHeapSnapshotMockWithDOM = function()
{
- return InspectorTest._postprocessHeapSnapshotMock({
+ return {
snapshot: {},
nodes: [
{ fields: ["type", "name", "id", "children_count", "children"],
@@ -115,7 +100,7 @@
/* M */ 1, 9, 13, 0
],
strings: ["", "A", "B", "C", "D", "E", "F", "G", "H", "M", "N", "Window", "native"]
- });
+ };
};
};
Modified: trunk/Source/WebCore/ChangeLog (109659 => 109660)
--- trunk/Source/WebCore/ChangeLog 2012-03-03 09:16:57 UTC (rev 109659)
+++ trunk/Source/WebCore/ChangeLog 2012-03-03 12:34:40 UTC (rev 109660)
@@ -1,3 +1,18 @@
+2012-03-03 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r109343.
+ http://trac.webkit.org/changeset/109343
+ https://bugs.webkit.org/show_bug.cgi?id=80212
+
+ Int32array can't handle values for native nodes because they
+ have int64 ids (Requested by loislo1 on #webkit).
+
+ * inspector/front-end/HeapSnapshot.js:
+ (WebInspector.HeapSnapshotLoader.prototype._parseNodes):
+ (WebInspector.HeapSnapshotLoader.prototype.pushJSONChunk):
+ (WebInspector.HeapSnapshot):
+ (WebInspector.HeapSnapshot.prototype._init):
+
2012-03-03 Andreas Kling <[email protected]>
Free up a bit in RenderObject.
Modified: trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js (109659 => 109660)
--- trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js 2012-03-03 09:16:57 UTC (rev 109659)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js 2012-03-03 12:34:40 UTC (rev 109660)
@@ -28,30 +28,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-WebInspector.Int32Array = function()
-{
- const preallocateSize = 1000;
- this._usedSize = 0;
- this._array = new Int32Array(preallocateSize);
-}
-
-WebInspector.Int32Array.prototype = {
- push: function(value)
- {
- if (this._usedSize + 1 > this._array.length) {
- var tempArray = new Int32Array(this._array.length * 2);
- tempArray.set(this._array);
- this._array = tempArray;
- }
- this._array[this._usedSize++] = value;
- },
-
- get array()
- {
- return this._array.subarray(0, this._usedSize);
- }
-}
-
WebInspector.HeapSnapshotLoader = function()
{
this._json = "";
@@ -100,7 +76,8 @@
break;
else if (code === closingBracket) {
this._json = this._json.slice(index + 1);
- this._snapshot.nodes = this._nodes.array;
+ // Shave off provisionally allocated space.
+ this._snapshot.nodes = this._snapshot.nodes.slice(0);
return false;
}
++index;
@@ -120,7 +97,7 @@
this._json = this._json.slice(startIndex);
return true;
}
- this._nodes.push(parseInt(this._json.slice(startIndex, index)));
+ this._snapshot.nodes.push(parseInt(this._json.slice(startIndex, index)));
}
},
@@ -174,9 +151,7 @@
var closingBracketIndex = this._findBalancedCurlyBrackets();
if (closingBracketIndex === -1)
return;
- this._nodes = new WebInspector.Int32Array();
- this._nodes.push(0);
- this._snapshot.metaNode = JSON.parse(this._json.slice(0, closingBracketIndex));
+ this._snapshot.nodes = [JSON.parse(this._json.slice(0, closingBracketIndex))];
this._json = this._json.slice(closingBracketIndex);
this._state = "parse-nodes";
this.pushJSONChunk("");
@@ -734,7 +709,6 @@
{
this.uid = profile.snapshot.uid;
this._nodes = profile.nodes;
- this._metaNode = profile.metaNode;
this._strings = profile.strings;
this._init();
@@ -743,8 +717,9 @@
WebInspector.HeapSnapshot.prototype = {
_init: function()
{
+ this._metaNodeIndex = 0;
this._rootNodeIndex = 1;
- var meta = this._metaNode;
+ var meta = this._nodes[this._metaNodeIndex];
this._nodeTypeOffset = meta.fields.indexOf("type");
this._nodeNameOffset = meta.fields.indexOf("name");
this._nodeIdOffset = meta.fields.indexOf("id");