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

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: Address comments. 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 271629bf64132666df45a3b3aba08074886ca86e..0f94a5d6a03d8ff26b81d882a8fa00e09be514a0 100644
--- a/sdk/lib/_internal/compiler/implementation/world.dart
+++ b/sdk/lib/_internal/compiler/implementation/world.dart
@@ -60,7 +60,6 @@ class World {
// (3) subclasses of (2) and (3).
void potentiallyAddForRti(ClassElement cls) {
- if (cls.typeVariables.isEmpty) return;
if (classesNeedingRti.contains(cls)) return;
classesNeedingRti.add(cls);
@@ -85,6 +84,10 @@ class World {
if (!itf.isRaw) {
potentiallyAddForRti(itf.element);
}
+ } else if (type is TypeVariableType) {
+ TypeVariableElement variable = type.element;
+ ClassElement enclosing = variable.enclosingElement;
ngeoffray 2013/02/22 11:04:30 Why this change?
+ potentiallyAddForRti(enclosing);
}
});
}
@@ -112,7 +115,9 @@ class World {
}
bool needsRti(ClassElement cls) {
- return classesNeedingRti.contains(cls) || compiler.enabledRuntimeType;
+ return classesNeedingRti.contains(cls) ||
+ compiler.enabledRuntimeType ||
+ compiler.hasVariableTypecheck;
ngeoffray 2013/02/22 11:04:30 So any class needs rti when the check is on? Shoul
}
bool hasAnyUserDefinedGetter(Selector selector) {

Powered by Google App Engine
This is Rietveld 408576698