OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 /** | 51 /** |
52 * @param {number} nodeIndex | 52 * @param {number} nodeIndex |
53 * @return {!WebInspector.JSHeapSnapshotNode} | 53 * @return {!WebInspector.JSHeapSnapshotNode} |
54 */ | 54 */ |
55 createNode: function(nodeIndex) | 55 createNode: function(nodeIndex) |
56 { | 56 { |
57 return new WebInspector.JSHeapSnapshotNode(this, nodeIndex); | 57 return new WebInspector.JSHeapSnapshotNode(this, nodeIndex); |
58 }, | 58 }, |
59 | 59 |
60 /** | 60 /** |
61 * @param {!Uint32Array} edges | 61 * @param {!Array.<number>} edges |
62 * @param {number} edgeIndex | 62 * @param {number} edgeIndex |
63 * @return {!WebInspector.JSHeapSnapshotEdge} | 63 * @return {!WebInspector.JSHeapSnapshotEdge} |
64 */ | 64 */ |
65 createEdge: function(edges, edgeIndex) | 65 createEdge: function(edges, edgeIndex) |
66 { | 66 { |
67 return new WebInspector.JSHeapSnapshotEdge(this, edges, edgeIndex); | 67 return new WebInspector.JSHeapSnapshotEdge(this, edges, edgeIndex); |
68 }, | 68 }, |
69 | 69 |
70 /** | 70 /** |
71 * @param {number} retainedNodeIndex | 71 * @param {number} retainedNodeIndex |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 var globalObjEdge = innerIter.edge; | 140 var globalObjEdge = innerIter.edge; |
141 if (globalObjEdge.isShortcut()) | 141 if (globalObjEdge.isShortcut()) |
142 propNames[globalObjEdge._nameOrIndex()] = true; | 142 propNames[globalObjEdge._nameOrIndex()] = true; |
143 } | 143 } |
144 for (innerIter.rewind(); innerIter.hasNext(); innerIter.next()) { | 144 for (innerIter.rewind(); innerIter.hasNext(); innerIter.next()) { |
145 var globalObjEdge = innerIter.edge; | 145 var globalObjEdge = innerIter.edge; |
146 if (!globalObjEdge.isShortcut() | 146 if (!globalObjEdge.isShortcut() |
147 && globalObjEdge.node().isHidden() | 147 && globalObjEdge.node().isHidden() |
148 && globalObjEdge._hasStringName() | 148 && globalObjEdge._hasStringName() |
149 && (globalObjEdge._nameOrIndex() in propNames)) | 149 && (globalObjEdge._nameOrIndex() in propNames)) |
150 globalObjEdge._edges[globalObjEdge.edgeIndex + this._edgeTyp
eOffset] = this._edgeInvisibleType; | 150 this._containmentEdges[globalObjEdge._edges._start + globalO
bjEdge.edgeIndex + this._edgeTypeOffset] = this._edgeInvisibleType; |
151 } | 151 } |
152 } | 152 } |
153 }, | 153 }, |
154 | 154 |
155 _calculateFlags: function() | 155 _calculateFlags: function() |
156 { | 156 { |
157 this._flags = new Uint32Array(this.nodeCount); | 157 this._flags = new Uint32Array(this.nodeCount); |
158 this._markDetachedDOMTreeNodes(); | 158 this._markDetachedDOMTreeNodes(); |
159 this._markQueriableHeapObjects(); | 159 this._markQueriableHeapObjects(); |
160 this._markPageOwnedNodes(); | 160 this._markPageOwnedNodes(); |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 return result; | 659 return result; |
660 }, | 660 }, |
661 | 661 |
662 __proto__: WebInspector.HeapSnapshotNode.prototype | 662 __proto__: WebInspector.HeapSnapshotNode.prototype |
663 }; | 663 }; |
664 | 664 |
665 /** | 665 /** |
666 * @constructor | 666 * @constructor |
667 * @extends {WebInspector.HeapSnapshotEdge} | 667 * @extends {WebInspector.HeapSnapshotEdge} |
668 * @param {!WebInspector.JSHeapSnapshot} snapshot | 668 * @param {!WebInspector.JSHeapSnapshot} snapshot |
669 * @param {!Uint32Array} edges | 669 * @param {!Array.<number>} edges |
670 * @param {number=} edgeIndex | 670 * @param {number=} edgeIndex |
671 */ | 671 */ |
672 WebInspector.JSHeapSnapshotEdge = function(snapshot, edges, edgeIndex) | 672 WebInspector.JSHeapSnapshotEdge = function(snapshot, edges, edgeIndex) |
673 { | 673 { |
674 WebInspector.HeapSnapshotEdge.call(this, snapshot, edges, edgeIndex); | 674 WebInspector.HeapSnapshotEdge.call(this, snapshot, edges, edgeIndex); |
675 } | 675 } |
676 | 676 |
677 WebInspector.JSHeapSnapshotEdge.prototype = { | 677 WebInspector.JSHeapSnapshotEdge.prototype = { |
678 /** | 678 /** |
679 * @return {!WebInspector.JSHeapSnapshotEdge} | 679 * @return {!WebInspector.JSHeapSnapshotEdge} |
680 */ | 680 */ |
681 clone: function() | 681 clone: function() |
682 { | 682 { |
683 var snapshot = /** @type {!WebInspector.JSHeapSnapshot} */ (this._snapsh
ot); | 683 return new WebInspector.JSHeapSnapshotEdge(this._snapshot, this._edges,
this.edgeIndex); |
684 return new WebInspector.JSHeapSnapshotEdge(snapshot, this._edges, this.e
dgeIndex); | |
685 }, | 684 }, |
686 | 685 |
687 /** | 686 /** |
688 * @return {boolean} | 687 * @return {boolean} |
689 */ | 688 */ |
690 hasStringName: function() | 689 hasStringName: function() |
691 { | 690 { |
692 if (!this.isShortcut()) | 691 if (!this.isShortcut()) |
693 return this._hasStringName(); | 692 return this._hasStringName(); |
694 return isNaN(parseInt(this._name(), 10)); | 693 return isNaN(parseInt(this._name(), 10)); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 return !this.isElement() && !this.isHidden(); | 782 return !this.isElement() && !this.isHidden(); |
784 }, | 783 }, |
785 | 784 |
786 _name: function() | 785 _name: function() |
787 { | 786 { |
788 return this._hasStringName() ? this._snapshot._strings[this._nameOrIndex
()] : this._nameOrIndex(); | 787 return this._hasStringName() ? this._snapshot._strings[this._nameOrIndex
()] : this._nameOrIndex(); |
789 }, | 788 }, |
790 | 789 |
791 _nameOrIndex: function() | 790 _nameOrIndex: function() |
792 { | 791 { |
793 return this._edges[this.edgeIndex + this._snapshot._edgeNameOffset]; | 792 return this._edges.item(this.edgeIndex + this._snapshot._edgeNameOffset)
; |
794 }, | 793 }, |
795 | 794 |
796 _type: function() | 795 _type: function() |
797 { | 796 { |
798 return this._edges[this.edgeIndex + this._snapshot._edgeTypeOffset]; | 797 return this._edges.item(this.edgeIndex + this._snapshot._edgeTypeOffset)
; |
799 }, | 798 }, |
800 | 799 |
801 __proto__: WebInspector.HeapSnapshotEdge.prototype | 800 __proto__: WebInspector.HeapSnapshotEdge.prototype |
802 }; | 801 }; |
803 | 802 |
804 | 803 |
805 /** | 804 /** |
806 * @constructor | 805 * @constructor |
807 * @extends {WebInspector.HeapSnapshotRetainerEdge} | 806 * @extends {WebInspector.HeapSnapshotRetainerEdge} |
808 * @param {!WebInspector.JSHeapSnapshot} snapshot | 807 * @param {!WebInspector.JSHeapSnapshot} snapshot |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 * @return {boolean} | 856 * @return {boolean} |
858 */ | 857 */ |
859 isWeak: function() | 858 isWeak: function() |
860 { | 859 { |
861 return this._edge().isWeak(); | 860 return this._edge().isWeak(); |
862 }, | 861 }, |
863 | 862 |
864 __proto__: WebInspector.HeapSnapshotRetainerEdge.prototype | 863 __proto__: WebInspector.HeapSnapshotRetainerEdge.prototype |
865 } | 864 } |
866 | 865 |
OLD | NEW |