Chromium Code Reviews| 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); |
| } |
| } |
| } |