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

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

Issue 12598003: Support type variables as expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 8b737bf3057520084a2c77f7a564c2258a17aff3..2dacc283c3180f545e51cbbaba393084be7f9fef 100644
--- a/sdk/lib/_internal/compiler/implementation/world.dart
+++ b/sdk/lib/_internal/compiler/implementation/world.dart
@@ -12,6 +12,10 @@ class World {
final Map<ClassElement, Set<ClassElement>> rtiDependencies;
final FullFunctionSet allFunctions;
+ // The set of classes that use one of their type variables as expressions
+ // to get the runtime type.
+ final Set<ClassElement> classesUsingVariableExpression;
ngeoffray 2013/03/11 10:24:06 Isn't that just an rtiDependency? So could you ju
karlklose 2013/03/12 09:05:02 No, this class and its subclasses need RTI because
+
// We keep track of subtype and subclass relationships in four
// distinct sets to make class hierarchy analysis faster.
final Map<ClassElement, Set<ClassElement>> subclasses =
@@ -30,6 +34,7 @@ class World {
classesNeedingRti = new Set<ClassElement>(),
rtiDependencies = new Map<ClassElement, Set<ClassElement>>(),
allFunctions = new FullFunctionSet(compiler),
+ classesUsingVariableExpression = new Set<ClassElement>(),
this.compiler = compiler;
void populate() {
@@ -130,6 +135,9 @@ class World {
potentiallyAddForRti(variable.enclosingElement);
}
});
+ // Add the classes that need RTI because they use a type variable as
+ // expression.
+ classesUsingVariableExpression.forEach(potentiallyAddForRti);
}
Iterable<ClassElement> commonSupertypesOf(ClassElement x, ClassElement y) {

Powered by Google App Engine
This is Rietveld 408576698