Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: runtime/observatory/lib/src/heap_snapshot/heap_snapshot.dart

Issue 2502283003: Add a version of heap snapshots that use only fields and stack frames as roots and only include ins… (Closed)
Patch Set: . Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of heap_snapshot; 5 part of heap_snapshot;
6 6
7 class HeapSnapshot implements M.HeapSnapshot { 7 class HeapSnapshot implements M.HeapSnapshot {
8 ObjectGraph graph; 8 ObjectGraph graph;
9 DateTime timestamp; 9 DateTime timestamp;
10 int get objects => graph.vertexCount; 10 int get objects => graph.vertexCount;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 117 }
118 return result; 118 return result;
119 } 119 }
120 } 120 }
121 121
122 class HeapSnapshotDominatorNode implements M.HeapSnapshotDominatorNode { 122 class HeapSnapshotDominatorNode implements M.HeapSnapshotDominatorNode {
123 final ObjectVertex v; 123 final ObjectVertex v;
124 final S.Isolate isolate; 124 final S.Isolate isolate;
125 S.HeapObject _preloaded; 125 S.HeapObject _preloaded;
126 126
127 bool get isStack => v.isStack;
128
127 Future<S.HeapObject> get object { 129 Future<S.HeapObject> get object {
128 if (_preloaded != null) { 130 if (_preloaded != null) {
129 return new Future.value(_preloaded); 131 return new Future.value(_preloaded);
130 } else { 132 } else {
131 return isolate.getObjectByAddress(v.address).then((S.HeapObject obj) { 133 return isolate.getObjectByAddress(v.address).then((S.HeapObject obj) {
132 return _preloaded = obj; 134 return _preloaded = obj;
133 }); 135 });
134 } 136 }
135 } 137 }
136 138
(...skipping 15 matching lines...) Expand all
152 HeapSnapshotDominatorNode(S.Isolate isolate, ObjectVertex vertex) 154 HeapSnapshotDominatorNode(S.Isolate isolate, ObjectVertex vertex)
153 : isolate = isolate, 155 : isolate = isolate,
154 v = vertex; 156 v = vertex;
155 } 157 }
156 158
157 class HeapSnapshotMergedDominatorNode 159 class HeapSnapshotMergedDominatorNode
158 implements M.HeapSnapshotMergedDominatorNode { 160 implements M.HeapSnapshotMergedDominatorNode {
159 final MergedObjectVertex v; 161 final MergedObjectVertex v;
160 final S.Isolate isolate; 162 final S.Isolate isolate;
161 163
164 bool get isStack => v.isStack;
165
162 Future<S.HeapObject> get klass { 166 Future<S.HeapObject> get klass {
163 return new Future.value(isolate.getClassByCid(v.vmCid)); 167 return new Future.value(isolate.getClassByCid(v.vmCid));
164 } 168 }
165 169
166 Iterable<HeapSnapshotMergedDominatorNode> _children; 170 Iterable<HeapSnapshotMergedDominatorNode> _children;
167 Iterable<HeapSnapshotMergedDominatorNode> get children { 171 Iterable<HeapSnapshotMergedDominatorNode> get children {
168 if (_children != null) { 172 if (_children != null) {
169 return _children; 173 return _children;
170 } else { 174 } else {
171 return _children = 175 return _children =
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 final MergedEdge edge; 258 final MergedEdge edge;
255 S.Class get target => edge.sourceVertex != vertex 259 S.Class get target => edge.sourceVertex != vertex
256 ? edge.sourceVertex.clazz 260 ? edge.sourceVertex.clazz
257 : edge.targetVertex.clazz; 261 : edge.targetVertex.clazz;
258 int get count => edge.count; 262 int get count => edge.count;
259 int get shallowSize => edge.shallowSize; 263 int get shallowSize => edge.shallowSize;
260 int get retainedSize => edge.retainedSize; 264 int get retainedSize => edge.retainedSize;
261 265
262 HeapSnapshotClassOutbound(this.vertex, this.edge); 266 HeapSnapshotClassOutbound(this.vertex, this.edge);
263 } 267 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698