Index: runtime/observatory/lib/src/heap_snapshot/heap_snapshot.dart |
diff --git a/runtime/observatory/lib/src/heap_snapshot/heap_snapshot.dart b/runtime/observatory/lib/src/heap_snapshot/heap_snapshot.dart |
index 5345d8c1ddbb8344ea74e84dc876c8a9e0366a5c..2d7abcd313aa5b095ab199b480d75026c3f93486 100644 |
--- a/runtime/observatory/lib/src/heap_snapshot/heap_snapshot.dart |
+++ b/runtime/observatory/lib/src/heap_snapshot/heap_snapshot.dart |
@@ -11,6 +11,7 @@ class HeapSnapshot implements M.HeapSnapshot { |
int get references => graph.edgeCount; |
int get size => graph.size; |
HeapSnapshotDominatorNode dominatorTree; |
+ HeapSnapshotMergedDominatorNode mergedDominatorTree; |
List<MergedVertex> classReferences; |
static Future sleep([Duration duration = const Duration(microseconds: 0)]) { |
@@ -36,6 +37,8 @@ class HeapSnapshot implements M.HeapSnapshot { |
}); |
await stream.last; |
dominatorTree = new HeapSnapshotDominatorNode(isolate, graph.root); |
+ mergedDominatorTree = |
+ new HeapSnapshotMergedDominatorNode(isolate, graph.mergedRoot); |
classReferences = await buildMergedVertices(isolate, graph, signal); |
progress.close(); |
}()); |
@@ -151,6 +154,36 @@ class HeapSnapshotDominatorNode implements M.HeapSnapshotDominatorNode { |
v = vertex; |
} |
+class HeapSnapshotMergedDominatorNode |
+ implements M.HeapSnapshotMergedDominatorNode { |
+ final MergedObjectVertex v; |
+ final S.Isolate isolate; |
+ |
+ Future<S.HeapObject> get klass { |
+ return new Future.value(isolate.getClassByCid(v.vmCid)); |
+ } |
+ |
+ Iterable<HeapSnapshotMergedDominatorNode> _children; |
+ Iterable<HeapSnapshotMergedDominatorNode> get children { |
+ if (_children != null) { |
+ return _children; |
+ } else { |
+ return _children = |
+ new List.unmodifiable(v.dominatorTreeChildren().map((v) { |
+ return new HeapSnapshotMergedDominatorNode(isolate, v); |
+ })); |
+ } |
+ } |
+ |
+ int get instanceCount => v.instanceCount; |
+ int get retainedSize => v.retainedSize; |
+ int get shallowSize => v.shallowSize; |
+ |
+ HeapSnapshotMergedDominatorNode(S.Isolate isolate, MergedObjectVertex vertex) |
+ : isolate = isolate, |
+ v = vertex; |
+} |
+ |
class MergedEdge { |
final MergedVertex sourceVertex; |
final MergedVertex targetVertex; |