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

Unified Diff: pkg/compiler/lib/src/enqueue.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
Index: pkg/compiler/lib/src/enqueue.dart
diff --git a/pkg/compiler/lib/src/enqueue.dart b/pkg/compiler/lib/src/enqueue.dart
index 35b564043a071e44417bbeeb9e154a998161d1ed..14b020d0dececdef67c1831c35e48901cb3e362b 100644
--- a/pkg/compiler/lib/src/enqueue.dart
+++ b/pkg/compiler/lib/src/enqueue.dart
@@ -196,7 +196,13 @@ abstract class Enqueuer {
ClassElement cls = type.element;
registry.registerDependency(cls);
cls.ensureResolved(compiler);
- universe.registerTypeInstantiation(type, byMirrors: mirrorUsage);
+ universe.registerTypeInstantiation(
+ type,
+ byMirrors: mirrorUsage,
+ onImplemented: (ClassElement cls) {
+ compiler.backend.registerImplementedClass(
+ cls, this, compiler.globalDependencies);
+ });
processInstantiatedClass(cls);
compiler.backend.registerInstantiatedType(type, registry);
});
@@ -322,26 +328,26 @@ abstract class Enqueuer {
// supertypes.
cls.ensureResolved(compiler);
- void processClass(ClassElement cls) {
- if (_processedClasses.contains(cls)) return;
+ void processClass(ClassElement superclass) {
+ if (_processedClasses.contains(superclass)) return;
- _processedClasses.add(cls);
- recentClasses.add(cls);
- cls.ensureResolved(compiler);
- cls.implementation.forEachMember(processInstantiatedClassMember);
- if (isResolutionQueue && !cls.isSynthesized) {
- compiler.resolver.checkClass(cls);
+ _processedClasses.add(superclass);
+ recentClasses.add(superclass);
+ superclass.ensureResolved(compiler);
+ superclass.implementation.forEachMember(processInstantiatedClassMember);
+ if (isResolutionQueue && !superclass.isSynthesized) {
+ compiler.resolver.checkClass(superclass);
}
- // We only tell the backend once that [cls] was instantiated, so
+ // We only tell the backend once that [superclass] was instantiated, so
// any additional dependencies must be treated as global
// dependencies.
compiler.backend.registerInstantiatedClass(
- cls, this, compiler.globalDependencies);
+ superclass, this, compiler.globalDependencies);
}
- processClass(cls);
- for (Link<DartType> supertypes = cls.allSupertypes;
- !supertypes.isEmpty; supertypes = supertypes.tail) {
- processClass(supertypes.head.element);
+
+ while (cls != null) {
+ processClass(cls);
+ cls = cls.superclass;
}
});
}
« no previous file with comments | « pkg/compiler/lib/src/elements/elements.dart ('k') | pkg/compiler/lib/src/inferrer/concrete_types_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698