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

Unified Diff: sdk/lib/_internal/compiler/implementation/enqueue.dart

Issue 12210142: Implement is-checks against type variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove some obsolete code. 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/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);
}

Powered by Google App Engine
This is Rietveld 408576698