Changeset 109660 in webkit
- Timestamp:
- Mar 3, 2012 4:34:40 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r109659 r109660 1 2012-03-03 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r109343. 4 http://trac.webkit.org/changeset/109343 5 https://bugs.webkit.org/show_bug.cgi?id=80212 6 7 Int32array can't handle values for native nodes because they 8 have int64 ids (Requested by loislo1 on #webkit). 9 10 * inspector/profiler/heap-snapshot-loader.html: 11 * inspector/profiler/heap-snapshot-test.js: 12 (initialize_HeapSnapshotTest.InspectorTest.createHeapSnapshotMock): 13 (initialize_HeapSnapshotTest.InspectorTest.createHeapSnapshotMockWithDOM): 14 (initialize_HeapSnapshotTest): 15 1 16 2012-03-03 Philippe Normand <pnormand@igalia.com> 2 17 -
trunk/LayoutTests/inspector/profiler/heap-snapshot-loader.html
r109343 r109660 15 15 function heapSnapshotLoaderTest(next) 16 16 { 17 var source = InspectorTest.createHeapSnapshotMock Raw();17 var source = InspectorTest.createHeapSnapshotMock(); 18 18 var sourceStringified = JSON.stringify(source); 19 19 var partSize = sourceStringified.length >> 3; … … 22 22 loader.pushJSONChunk(sourceStringified.slice(i, i + partSize)); 23 23 var result = loader.finishLoading(); 24 InspectorTest.assertSnapshotEquals(new WebInspector.HeapSnapshot( InspectorTest.createHeapSnapshotMock()), result);24 InspectorTest.assertSnapshotEquals(new WebInspector.HeapSnapshot(source), result); 25 25 next(); 26 26 } -
trunk/LayoutTests/inspector/profiler/heap-snapshot-test.js
r109343 r109660 38 38 }; 39 39 40 InspectorTest.createHeapSnapshotMock Raw= function()40 InspectorTest.createHeapSnapshotMock = function() 41 41 { 42 42 return { … … 67 67 }; 68 68 69 InspectorTest._postprocessHeapSnapshotMock = function(mock)70 {71 mock.metaNode = mock.nodes[0];72 mock.nodes[0] = 0;73 var tempNodes = new Int32Array(1000);74 tempNodes.set(mock.nodes);75 mock.nodes = tempNodes.subarray(0, mock.nodes.length);76 return mock;77 };78 79 InspectorTest.createHeapSnapshotMock = function()80 {81 return InspectorTest._postprocessHeapSnapshotMock(InspectorTest.createHeapSnapshotMockRaw());82 };83 84 69 InspectorTest.createHeapSnapshotMockWithDOM = function() 85 70 { 86 return InspectorTest._postprocessHeapSnapshotMock({71 return { 87 72 snapshot: {}, 88 73 nodes: [ … … 116 101 ], 117 102 strings: ["", "A", "B", "C", "D", "E", "F", "G", "H", "M", "N", "Window", "native"] 118 } );103 }; 119 104 }; 120 105 -
trunk/Source/WebCore/ChangeLog
r109658 r109660 1 2012-03-03 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r109343. 4 http://trac.webkit.org/changeset/109343 5 https://bugs.webkit.org/show_bug.cgi?id=80212 6 7 Int32array can't handle values for native nodes because they 8 have int64 ids (Requested by loislo1 on #webkit). 9 10 * inspector/front-end/HeapSnapshot.js: 11 (WebInspector.HeapSnapshotLoader.prototype._parseNodes): 12 (WebInspector.HeapSnapshotLoader.prototype.pushJSONChunk): 13 (WebInspector.HeapSnapshot): 14 (WebInspector.HeapSnapshot.prototype._init): 15 1 16 2012-03-03 Andreas Kling <awesomekling@apple.com> 2 17 -
trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js
r109343 r109660 29 29 */ 30 30 31 WebInspector.Int32Array = function()32 {33 const preallocateSize = 1000;34 this._usedSize = 0;35 this._array = new Int32Array(preallocateSize);36 }37 38 WebInspector.Int32Array.prototype = {39 push: function(value)40 {41 if (this._usedSize + 1 > this._array.length) {42 var tempArray = new Int32Array(this._array.length * 2);43 tempArray.set(this._array);44 this._array = tempArray;45 }46 this._array[this._usedSize++] = value;47 },48 49 get array()50 {51 return this._array.subarray(0, this._usedSize);52 }53 }54 55 31 WebInspector.HeapSnapshotLoader = function() 56 32 { … … 101 77 else if (code === closingBracket) { 102 78 this._json = this._json.slice(index + 1); 103 this._snapshot.nodes = this._nodes.array; 79 // Shave off provisionally allocated space. 80 this._snapshot.nodes = this._snapshot.nodes.slice(0); 104 81 return false; 105 82 } … … 121 98 return true; 122 99 } 123 this._ nodes.push(parseInt(this._json.slice(startIndex, index)));100 this._snapshot.nodes.push(parseInt(this._json.slice(startIndex, index))); 124 101 } 125 102 }, … … 175 152 if (closingBracketIndex === -1) 176 153 return; 177 this._nodes = new WebInspector.Int32Array(); 178 this._nodes.push(0); 179 this._snapshot.metaNode = JSON.parse(this._json.slice(0, closingBracketIndex)); 154 this._snapshot.nodes = [JSON.parse(this._json.slice(0, closingBracketIndex))]; 180 155 this._json = this._json.slice(closingBracketIndex); 181 156 this._state = "parse-nodes"; … … 735 710 this.uid = profile.snapshot.uid; 736 711 this._nodes = profile.nodes; 737 this._metaNode = profile.metaNode;738 712 this._strings = profile.strings; 739 713 … … 744 718 _init: function() 745 719 { 720 this._metaNodeIndex = 0; 746 721 this._rootNodeIndex = 1; 747 var meta = this._ metaNode;722 var meta = this._nodes[this._metaNodeIndex]; 748 723 this._nodeTypeOffset = meta.fields.indexOf("type"); 749 724 this._nodeNameOffset = meta.fields.indexOf("name");
Note: See TracChangeset
for help on using the changeset viewer.