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

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

Issue 1961323002: Register mixin use from modelz. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 7 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/world.dart
diff --git a/pkg/compiler/lib/src/world.dart b/pkg/compiler/lib/src/world.dart
index f217263404ad03c728b490fce4e04bdd7771ef5e..db6563580798bf660aab65aa8f88e4720900fe5f 100644
--- a/pkg/compiler/lib/src/world.dart
+++ b/pkg/compiler/lib/src/world.dart
@@ -460,7 +460,7 @@ class World implements ClassWorld {
if (isInstantiated(mixinApplication)) {
uses.add(mixinApplication);
} else if (mixinApplication.isNamedMixinApplication) {
- List<MixinApplicationElement> next = _mixinUses[mixinApplication];
+ Set<MixinApplicationElement> next = _mixinUses[mixinApplication];
if (next != null) {
next.forEach(addLiveUse);
}
@@ -511,8 +511,8 @@ class World implements ClassWorld {
final Set<TypedefElement> allTypedefs = new Set<TypedefElement>();
- final Map<ClassElement, List<MixinApplicationElement>> _mixinUses =
- new Map<ClassElement, List<MixinApplicationElement>>();
+ final Map<ClassElement, Set<MixinApplicationElement>> _mixinUses =
+ new Map<ClassElement, Set<MixinApplicationElement>>();
Map<ClassElement, List<MixinApplicationElement>> _liveMixinUses;
final Map<ClassElement, Set<ClassElement>> _typesImplementedBySubclasses =
@@ -605,6 +605,15 @@ class World implements ClassWorld {
ClassSet subtypeSet = _ensureClassSet(type.element);
subtypeSet.addSubtype(node);
}
+ if (cls.isMixinApplication) {
+ // TODO(johnniwinther): Store this in the [ClassSet].
+ MixinApplicationElement mixinApplication = cls;
+ if (mixinApplication.mixin != null) {
+ // If [mixinApplication] is malformed [mixin] is `null`.
+ registerMixinUse(mixinApplication, mixinApplication.mixin);
+ }
+ }
+
return classSet;
});
}
@@ -687,8 +696,8 @@ class World implements ClassWorld {
// TODO(johnniwinther): Add map restricted to live classes.
// We don't support patch classes as mixin.
assert(mixin.isDeclaration);
- List<MixinApplicationElement> users = _mixinUses.putIfAbsent(
- mixin, () => new List<MixinApplicationElement>());
+ Set<MixinApplicationElement> users = _mixinUses.putIfAbsent(
+ mixin, () => new Set<MixinApplicationElement>());
users.add(mixinApplication);
}
« no previous file with comments | « pkg/compiler/lib/src/serialization/modelz.dart ('k') | tests/compiler/dart2js/serialization/model_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698