Changeset 109660 in webkit


Ignore:
Timestamp:
Mar 3, 2012 4:34:40 AM (12 years ago)
Author:
commit-queue@webkit.org
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 <webkit.review.bot@gmail.com> 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):

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r109659 r109660  
     12012-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
    1162012-03-03  Philippe Normand  <pnormand@igalia.com>
    217
  • trunk/LayoutTests/inspector/profiler/heap-snapshot-loader.html

    r109343 r109660  
    1515        function heapSnapshotLoaderTest(next)
    1616        {
    17             var source = InspectorTest.createHeapSnapshotMockRaw();
     17            var source = InspectorTest.createHeapSnapshotMock();
    1818            var sourceStringified = JSON.stringify(source);
    1919            var partSize = sourceStringified.length >> 3;
     
    2222                loader.pushJSONChunk(sourceStringified.slice(i, i + partSize));
    2323            var result = loader.finishLoading();
    24             InspectorTest.assertSnapshotEquals(new WebInspector.HeapSnapshot(InspectorTest.createHeapSnapshotMock()), result);
     24            InspectorTest.assertSnapshotEquals(new WebInspector.HeapSnapshot(source), result);
    2525            next();
    2626        }
  • trunk/LayoutTests/inspector/profiler/heap-snapshot-test.js

    r109343 r109660  
    3838};
    3939
    40 InspectorTest.createHeapSnapshotMockRaw = function()
     40InspectorTest.createHeapSnapshotMock = function()
    4141{
    4242    return {
     
    6767};
    6868
    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 
    8469InspectorTest.createHeapSnapshotMockWithDOM = function()
    8570{
    86     return InspectorTest._postprocessHeapSnapshotMock({
     71    return {
    8772        snapshot: {},
    8873        nodes: [
     
    116101            ],
    117102        strings: ["", "A", "B", "C", "D", "E", "F", "G", "H", "M", "N", "Window", "native"]
    118     });
     103    };
    119104};
    120105
  • trunk/Source/WebCore/ChangeLog

    r109658 r109660  
     12012-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
    1162012-03-03  Andreas Kling  <awesomekling@apple.com>
    217
  • trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js

    r109343 r109660  
    2929 */
    3030
    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 
    5531WebInspector.HeapSnapshotLoader = function()
    5632{
     
    10177                else if (code === closingBracket) {
    10278                    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);
    10481                    return false;
    10582                }
     
    12198                return true;
    12299            }
    123             this._nodes.push(parseInt(this._json.slice(startIndex, index)));
     100            this._snapshot.nodes.push(parseInt(this._json.slice(startIndex, index)));
    124101        }
    125102    },
     
    175152            if (closingBracketIndex === -1)
    176153                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))];
    180155            this._json = this._json.slice(closingBracketIndex);
    181156            this._state = "parse-nodes";
     
    735710    this.uid = profile.snapshot.uid;
    736711    this._nodes = profile.nodes;
    737     this._metaNode = profile.metaNode;
    738712    this._strings = profile.strings;
    739713
     
    744718    _init: function()
    745719    {
     720        this._metaNodeIndex = 0;
    746721        this._rootNodeIndex = 1;
    747         var meta = this._metaNode;
     722        var meta = this._nodes[this._metaNodeIndex];
    748723        this._nodeTypeOffset = meta.fields.indexOf("type");
    749724        this._nodeNameOffset = meta.fields.indexOf("name");
Note: See TracChangeset for help on using the changeset viewer.