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

Unified Diff: pkg/compiler/lib/src/dump_info.dart

Issue 1287533002: dart2js: add parent references to some info objects (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 months 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/info/info.dart » ('j') | pkg/compiler/lib/src/info/info.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/dump_info.dart
diff --git a/pkg/compiler/lib/src/dump_info.dart b/pkg/compiler/lib/src/dump_info.dart
index e89812c9167c08e7ed1e0e430839c53a1173f7af..b5bb9598645c09d35f4866459e71eafae06c8e49 100644
--- a/pkg/compiler/lib/src/dump_info.dart
+++ b/pkg/compiler/lib/src/dump_info.dart
@@ -69,12 +69,16 @@ class ElementInfoCollector extends BaseElementVisitor<Info, dynamic> {
Info child = this.process(member);
if (child is ClassInfo) {
info.classes.add(child);
+ child.parent = info;
} else if (child is FunctionInfo) {
info.topLevelFunctions.add(child);
+ child.parent = info;
} else if (child is FieldInfo) {
info.topLevelVariables.add(child);
+ child.parent = info;
} else if (child is TypedefInfo) {
info.typedefs.add(child);
+ child.parent = info;
} else if (child != null) {
print('unexpected child of $info: $child ==> ${child.runtimeType}');
assert(false);
@@ -150,9 +154,11 @@ class ElementInfoCollector extends BaseElementVisitor<Info, dynamic> {
if (info == null) return;
if (info is FieldInfo) {
classInfo.fields.add(info);
+ info.parent = classInfo;
} else {
assert(info is FunctionInfo);
classInfo.functions.add(info);
+ info.parent = classInfo;
}
// Closures are placed in the library namespace, but we want to attribute
@@ -274,6 +280,7 @@ class ElementInfoCollector extends BaseElementVisitor<Info, dynamic> {
child.name = "${parent.name}.${child.name}";
}
nestedClosures.add(child);
+ child.parent = parent;
size += child.size;
}
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/info/info.dart » ('j') | pkg/compiler/lib/src/info/info.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698