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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart

Issue 12210138: Add substitution for classes that use type variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 10 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: sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
index 09ae310313f1b953b82ba9d4b2f29d49226b3c66..640c199f82d086fedcb8d3d6b3b18a7c73685bbf 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
@@ -1274,13 +1274,21 @@ $lazyInitializerLogic
// variable layout for this class is different. Instead we generate
// substitutions for all checks and make emitSubstitution a NOP for the
// rest of this function.
- for (ClassElement check in checkedClasses) {
- for (DartType supertype in cls.allSupertypes) {
- if (supertype.element == check) {
+ Set<ClassElement> emitted = new Set<ClassElement>();
+ // TODO(karlklose): move the computation of these checks to
+ // RuntimeTypeInformation.
+ if (compiler.world.needsRti(cls)) {
+ emitSubstitution(superclass, emitNull: true);
+ emitted.add(superclass);
+ }
+ for (DartType supertype in cls.allSupertypes) {
+ for (ClassElement check in checkedClasses) {
ngeoffray 2013/02/12 21:56:15 Any reason why you changed the order of the loops
+ if (supertype.element == check && !emitted.contains(check)) {
// Generate substitution. If no substitution is necessary, emit
// [:null:] to overwrite a (possibly) existing substitution from the
// super classes.
emitSubstitution(check, emitNull: true);
+ emitted.add(check);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698