Changeset 110423 in webkit
- Timestamp:
- Mar 12, 2012 6:59:47 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r110420 r110423 1 2012-03-12 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Re-apply the patch after v8 roll to r11000. 4 5 Web Inspector: move heap snapshot nodes data to external array. 6 https://bugs.webkit.org/show_bug.cgi?id=79911 7 8 Reviewed by Vsevolod Vlasov. 9 10 * inspector/profiler/heap-snapshot-loader.html: 11 * inspector/profiler/heap-snapshot-test.js: 12 (initialize_HeapSnapshotTest.InspectorTest.createHeapSnapshotMockRaw): 13 (initialize_HeapSnapshotTest.InspectorTest.createHeapSnapshotMock): 14 (initialize_HeapSnapshotTest.InspectorTest.createHeapSnapshotMockWithDOM): 15 1 16 2012-03-12 Hans Wennborg <hans@chromium.org> 2 17 -
trunk/LayoutTests/inspector/profiler/heap-snapshot-loader.html
r109660 r110423 15 15 function heapSnapshotLoaderTest(next) 16 16 { 17 var source = InspectorTest.createHeapSnapshotMock ();17 var source = InspectorTest.createHeapSnapshotMockRaw(); 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( source), result);24 InspectorTest.assertSnapshotEquals(new WebInspector.HeapSnapshot(InspectorTest.createHeapSnapshotMock()), result); 25 25 next(); 26 26 } -
trunk/LayoutTests/inspector/profiler/heap-snapshot-test.js
r109660 r110423 38 38 }; 39 39 40 InspectorTest.createHeapSnapshotMock = function()40 InspectorTest.createHeapSnapshotMockRaw = 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 69 84 InspectorTest.createHeapSnapshotMockWithDOM = function() 70 85 { 71 return {86 return InspectorTest._postprocessHeapSnapshotMock({ 72 87 snapshot: {}, 73 88 nodes: [ … … 101 116 ], 102 117 strings: ["", "A", "B", "C", "D", "E", "F", "G", "H", "M", "N", "Window", "native"] 103 } ;118 }); 104 119 }; 105 120 -
trunk/PerformanceTests/inspector/detailed-heapshots-smoke-test.html
r110421 r110423 90 90 } 91 91 92 makeObjectsTree2("t", 1 4);92 makeObjectsTree2("t", 16); 93 93 94 94 </script> -
trunk/Source/WebCore/ChangeLog
r110422 r110423 1 2012-03-12 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Re-apply the patch after v8 roll to r11000. 4 5 Web Inspector: move heap snapshot nodes data to external array. 6 https://bugs.webkit.org/show_bug.cgi?id=79911 7 8 Reviewed by Vsevolod Vlasov. 9 10 Tests: 11 heap-shapshot.html 12 heap-shapshot-loader.html 13 14 * inspector/front-end/HeapSnapshot.js: 15 (WebInspector.Int32Array): 16 (WebInspector.Int32Array.prototype.get array): 17 (WebInspector.HeapSnapshotLoader.prototype._parseNodes): 18 (WebInspector.HeapSnapshotLoader.prototype.pushJSONChunk): 19 (WebInspector.HeapSnapshot): 20 (WebInspector.HeapSnapshot.prototype._init): 21 1 22 2012-03-12 Simon Hausmann <simon.hausmann@nokia.com> 2 23 -
trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js
r109660 r110423 29 29 */ 30 30 31 WebInspector.Int32Array = function(size) 32 { 33 const preallocateSize = 1000; 34 size = size || preallocateSize; 35 this._usedSize = 0; 36 this._array = new Int32Array(preallocateSize); 37 } 38 39 WebInspector.Int32Array.prototype = { 40 push: function(value) 41 { 42 if (this._usedSize + 1 > this._array.length) { 43 var tempArray = new Int32Array(this._array.length * 2); 44 tempArray.set(this._array); 45 this._array = tempArray; 46 } 47 this._array[this._usedSize++] = value; 48 }, 49 50 get array() 51 { 52 return this._array.subarray(0, this._usedSize); 53 } 54 } 55 31 56 WebInspector.HeapSnapshotLoader = function() 32 57 { … … 77 102 else if (code === closingBracket) { 78 103 this._json = this._json.slice(index + 1); 79 // Shave off provisionally allocated space. 80 this._snapshot.nodes = this._snapshot.nodes.slice(0); 104 this._snapshot.nodes = this._nodes.array; 81 105 return false; 82 106 } … … 98 122 return true; 99 123 } 100 this._ snapshot.nodes.push(parseInt(this._json.slice(startIndex, index)));124 this._nodes.push(parseInt(this._json.slice(startIndex, index))); 101 125 } 102 126 }, … … 152 176 if (closingBracketIndex === -1) 153 177 return; 154 this._snapshot.nodes = [JSON.parse(this._json.slice(0, closingBracketIndex))]; 178 this._nodes = new WebInspector.Int32Array(); 179 this._nodes.push(0); 180 this._snapshot.metaNode = JSON.parse(this._json.slice(0, closingBracketIndex)); 155 181 this._json = this._json.slice(closingBracketIndex); 156 182 this._state = "parse-nodes"; … … 203 229 if (typeof end === "undefined") 204 230 end = start + this._start + this.length; 205 return this._snapshot[this._arrayName].s lice(this._start + start, end);231 return this._snapshot[this._arrayName].subarray(this._start + start, end); 206 232 } 207 233 } … … 710 736 this.uid = profile.snapshot.uid; 711 737 this._nodes = profile.nodes; 738 this._metaNode = profile.metaNode; 712 739 this._strings = profile.strings; 713 740 … … 718 745 _init: function() 719 746 { 720 this._metaNodeIndex = 0;721 747 this._rootNodeIndex = 1; 722 var meta = this._ nodes[this._metaNodeIndex];748 var meta = this._metaNode; 723 749 this._nodeTypeOffset = meta.fields.indexOf("type"); 724 750 this._nodeNameOffset = meta.fields.indexOf("name"); … … 896 922 // - "indexArray" is an array of indexes in the "backRefsArray" 897 923 // with the same positions as in the _nodeIndex. 898 var indexArray = this[indexArrayName] = new Array(this._nodeIndex.length);924 var indexArray = this[indexArrayName] = new Int32Array(this._nodeIndex.length); 899 925 for (var i = 0, l = indexArray.length; i < l; ++i) 900 926 indexArray[i] = 0; … … 905 931 for (i = 0, l = indexArray.length; i < l; ++i) 906 932 backRefsCount += indexArray[i]; 907 var backRefsArray = this[backRefsArrayName] = new Array(backRefsCount + 1);933 var backRefsArray = this[backRefsArrayName] = new Int32Array(backRefsCount + 1); 908 934 // Put in the first slot of each backRefsArray slice the count of entries 909 935 // that will be filled. … … 1058 1084 { 1059 1085 var count = this.nodeCount; 1060 this._nodeIndex = new Array(count + 1);1086 this._nodeIndex = new Int32Array(count + 1); 1061 1087 count = 0; 1062 1088 for (var nodesIter = this._allNodes; nodesIter.hasNext(); nodesIter.next(), ++count)
Note: See TracChangeset
for help on using the changeset viewer.