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

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

Issue 12210142: Implement is-checks against type variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Restore comment. 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/world.dart
diff --git a/sdk/lib/_internal/compiler/implementation/world.dart b/sdk/lib/_internal/compiler/implementation/world.dart
index 42307082a53d08c440392fac7f62f9642d2623e5..3040a25266043680082e55121bfd899ffdcaa26d 100644
--- a/sdk/lib/_internal/compiler/implementation/world.dart
+++ b/sdk/lib/_internal/compiler/implementation/world.dart
@@ -13,6 +13,7 @@ class World {
final Map<ClassElement, Set<ClassElement>> rtiDependencies;
final FunctionSet userDefinedGetters;
final FunctionSet userDefinedSetters;
+ Link<ClassElement> classesUsingTypeVariableTests;
World(Compiler compiler)
: subtypes = new Map<ClassElement, Set<ClassElement>>(),
@@ -23,6 +24,7 @@ class World {
userDefinedSetters = new FunctionSet(compiler),
classesNeedingRti = new Set<ClassElement>(),
rtiDependencies = new Map<ClassElement, Set<ClassElement>>(),
+ classesUsingTypeVariableTests = const Link<ClassElement>(),
this.compiler = compiler;
void populate() {
@@ -219,6 +221,16 @@ class World {
}
return result;
}
+
+ /**
+ * Register a class that contains an is-test against one of it type variables.
+ * The class and all its subtypes need runtime type information and we need to
+ * register the type arguments of their instantiations.
+ */
+ registerTypeVariableCheck(ClassElement cls) {
+ classesUsingTypeVariableTests = classesUsingTypeVariableTests.prepend(cls);
+ classesNeedingRti.add(cls);
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698