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 {!Array.<number>} edges | 61 * @param {!Uint32Array} 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 this._containmentEdges[globalObjEdge._edges._start + globalO
bjEdge.edgeIndex + this._edgeTypeOffset] = this._edgeInvisibleType; | 150 globalObjEdge._edges[globalObjEdge.edgeIndex + this._edgeTyp
eOffset] = 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 {!Array.<number>} edges | 669 * @param {!Uint32Array} 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 return new WebInspector.JSHeapSnapshotEdge(this._snapshot, this._edges,
this.edgeIndex); | 683 var snapshot = /** @type {!WebInspector.JSHeapSnapshot} */ (this._snapsh
ot); |
| 684 return new WebInspector.JSHeapSnapshotEdge(snapshot, this._edges, this.e
dgeIndex); |
684 }, | 685 }, |
685 | 686 |
686 /** | 687 /** |
687 * @return {boolean} | 688 * @return {boolean} |
688 */ | 689 */ |
689 hasStringName: function() | 690 hasStringName: function() |
690 { | 691 { |
691 if (!this.isShortcut()) | 692 if (!this.isShortcut()) |
692 return this._hasStringName(); | 693 return this._hasStringName(); |
693 return isNaN(parseInt(this._name(), 10)); | 694 return isNaN(parseInt(this._name(), 10)); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 return !this.isElement() && !this.isHidden(); | 783 return !this.isElement() && !this.isHidden(); |
783 }, | 784 }, |
784 | 785 |
785 _name: function() | 786 _name: function() |
786 { | 787 { |
787 return this._hasStringName() ? this._snapshot._strings[this._nameOrIndex
()] : this._nameOrIndex(); | 788 return this._hasStringName() ? this._snapshot._strings[this._nameOrIndex
()] : this._nameOrIndex(); |
788 }, | 789 }, |
789 | 790 |
790 _nameOrIndex: function() | 791 _nameOrIndex: function() |
791 { | 792 { |
792 return this._edges.item(this.edgeIndex + this._snapshot._edgeNameOffset)
; | 793 return this._edges[this.edgeIndex + this._snapshot._edgeNameOffset]; |
793 }, | 794 }, |
794 | 795 |
795 _type: function() | 796 _type: function() |
796 { | 797 { |
797 return this._edges.item(this.edgeIndex + this._snapshot._edgeTypeOffset)
; | 798 return this._edges[this.edgeIndex + this._snapshot._edgeTypeOffset]; |
798 }, | 799 }, |
799 | 800 |
800 __proto__: WebInspector.HeapSnapshotEdge.prototype | 801 __proto__: WebInspector.HeapSnapshotEdge.prototype |
801 }; | 802 }; |
802 | 803 |
803 | 804 |
804 /** | 805 /** |
805 * @constructor | 806 * @constructor |
806 * @extends {WebInspector.HeapSnapshotRetainerEdge} | 807 * @extends {WebInspector.HeapSnapshotRetainerEdge} |
807 * @param {!WebInspector.JSHeapSnapshot} snapshot | 808 * @param {!WebInspector.JSHeapSnapshot} snapshot |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 * @return {boolean} | 857 * @return {boolean} |
857 */ | 858 */ |
858 isWeak: function() | 859 isWeak: function() |
859 { | 860 { |
860 return this._edge().isWeak(); | 861 return this._edge().isWeak(); |
861 }, | 862 }, |
862 | 863 |
863 __proto__: WebInspector.HeapSnapshotRetainerEdge.prototype | 864 __proto__: WebInspector.HeapSnapshotRetainerEdge.prototype |
864 } | 865 } |
865 | 866 |
OLD | NEW |