Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/native_handler.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/native_handler.dart b/sdk/lib/_internal/compiler/implementation/native_handler.dart |
| index 0c1579b538351b24c9572dfdf7ea94f6632210af..8de208fbf826c224fa23617670c0dccaa7569c2f 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/native_handler.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/native_handler.dart |
| @@ -296,6 +296,8 @@ class NativeCodegenEnqueuer extends NativeEnqueuerBase { |
| final CodeEmitterTask emitter; |
| + final Set<ClassElement> doneAddSubtypes = new Set<ClassElement>(); |
|
karlklose
2012/11/23 13:07:24
How about the name 'processedClasses'?
sra1
2012/11/24 00:05:50
We already have three sets of classes to do with t
|
| + |
| NativeCodegenEnqueuer(Enqueuer world, Compiler compiler, this.emitter) |
| : super(world, compiler, compiler.enableNativeLiveTypeAnalysis); |
| @@ -320,6 +322,14 @@ class NativeCodegenEnqueuer extends NativeEnqueuerBase { |
| } |
| void addSubtypes(ClassElement cls, NativeEmitter emitter) { |
| + if (!cls.isNative()) return; |
| + if (doneAddSubtypes.contains(cls)) return; |
| + doneAddSubtypes.add(cls); |
| + |
| + // Walk the superclass chain since classes on the superclass chain might not |
| + // be instantiated (abstract or simply unused). |
| + addSubtypes(cls.superclass, emitter); |
|
karlklose
2012/11/23 13:07:24
Why does this terminate?
sra1
2012/11/24 00:05:50
The check on line 326 is a standard graph algorith
karlklose
2012/11/26 11:24:56
Ah, I did not see l. 327.
|
| + |
| for (DartType type in cls.allSupertypes) { |
| List<Element> subtypes = emitter.subtypes.putIfAbsent( |
| type.element, |