Index: sdk/lib/_internal/compiler/implementation/enqueue.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/enqueue.dart b/sdk/lib/_internal/compiler/implementation/enqueue.dart |
index 1036a57eb779e6d256f3c1da586785959dd3f464..17ded6ca4bdb05ac869930f7365eee323ccfde71 100644 |
--- a/sdk/lib/_internal/compiler/implementation/enqueue.dart |
+++ b/sdk/lib/_internal/compiler/implementation/enqueue.dart |
@@ -86,11 +86,22 @@ abstract class Enqueuer { |
// the work list'? |
bool addElementToWorkList(Element element, [TreeElements elements]); |
+ void registerInstantiatedType(InterfaceType type) { |
+ universe.instantiatedTypes.add(type); |
+ registerInstantiatedClass(type.element); |
+ } |
+ |
void registerInstantiatedClass(ClassElement cls) { |
if (universe.instantiatedClasses.contains(cls)) return; |
if (!cls.isAbstract(compiler)) { |
universe.instantiatedClasses.add(cls); |
onRegisterInstantiatedClass(cls); |
+ } else { |
+ // For factories and instantiations of [List], the target is abstract. |
+ // Since we may need the type arguments for constructing the instance, |
+ // we register the class to be added to the classes needing rti. |
+ compiler.world.registerInstantiatedAbstractClass(cls); |
ngeoffray
2013/02/26 14:11:37
Instead of doing this here, it looks a bit cleaner
karlklose
2013/02/27 10:12:58
I moved the code to addToWorklist.
|
+ compiler.backend.registerRuntimeType(); |
ngeoffray
2013/02/26 14:11:37
You should not register this here.
karlklose
2013/02/27 10:12:58
Removed. Fixed a bug with registering getRuntimeTy
|
} |
compiler.backend.registerInstantiatedClass(cls, this); |
} |