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

Unified Diff: runtime/observatory/lib/src/heap_snapshot/heap_snapshot.dart

Issue 2480293003: Observatory: Add view of dominator tree with siblings merged by class. (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 side-by-side diff with in-line comments
Download patch
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;
« no previous file with comments | « runtime/observatory/lib/src/elements/heap_snapshot.dart ('k') | runtime/observatory/lib/src/models/objects/heap_snapshot.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698