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

Unified Diff: pkg/compiler/lib/src/universe/class_set.dart

Issue 1352533002: Enqueue superclasses instead of supertypes. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Unify native behavior processing Created 5 years, 3 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 | « pkg/compiler/lib/src/types/type_mask.dart ('k') | pkg/compiler/lib/src/universe/universe.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/universe/class_set.dart
diff --git a/pkg/compiler/lib/src/universe/class_set.dart b/pkg/compiler/lib/src/universe/class_set.dart
index d19b2c1ceff8cd1cc655b6d0d016c9761c89a1ac..6cafa09f423bcf9ebed44c358b1217ebdafffc3e 100644
--- a/pkg/compiler/lib/src/universe/class_set.dart
+++ b/pkg/compiler/lib/src/universe/class_set.dart
@@ -101,27 +101,50 @@ class ClassHierarchyNode {
includeUninstantiated: includeUninstantiated);
}
- void dump(StringBuffer sb, String indentation) {
- sb.write('$indentation$cls:[');
+ void printOn(StringBuffer sb, String indentation,
+ {bool instantiatedOnly: false}) {
+ sb.write('$indentation$cls');
+ if (isDirectlyInstantiated) {
+ sb.write(' directly');
+ }
+ if (isIndirectlyInstantiated) {
+ sb.write(' indirectly');
+ }
+ sb.write(' [');
if (_directSubclasses.isEmpty) {
sb.write(']');
} else {
- sb.write('\n');
bool needsComma = false;
for (Link<ClassHierarchyNode> link = _directSubclasses;
!link.isEmpty;
link = link.tail) {
+ if (instantiatedOnly && !link.head.isInstantiated) {
+ continue;
+ }
if (needsComma) {
sb.write(',\n');
+ } else {
+ sb.write('\n');
}
- link.head.dump(sb, '$indentation ');
+ link.head.printOn(
+ sb, '$indentation ', instantiatedOnly: instantiatedOnly);
needsComma = true;
}
- sb.write('\n');
- sb.write('$indentation]');
+ if (needsComma) {
+ sb.write('\n');
+ sb.write('$indentation]');
+ } else {
+ sb.write(']');
+ }
}
}
+ String dump({String indentation: '', bool instantiatedOnly: false}) {
+ StringBuffer sb = new StringBuffer();
+ printOn(sb, indentation, instantiatedOnly: instantiatedOnly);
+ return sb.toString();
+ }
+
String toString() => cls.toString();
}
@@ -274,11 +297,11 @@ class ClassSet {
String toString() {
StringBuffer sb = new StringBuffer();
sb.write('[\n');
- node.dump(sb, ' ');
+ node.printOn(sb, ' ');
sb.write('\n');
if (_directSubtypes != null) {
for (ClassHierarchyNode node in _directSubtypes) {
- node.dump(sb, ' ');
+ node.printOn(sb, ' ');
sb.write('\n');
}
}
« no previous file with comments | « pkg/compiler/lib/src/types/type_mask.dart ('k') | pkg/compiler/lib/src/universe/universe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698