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

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: Update illegal_invocation_test and status. 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
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/builder.dart ('k') | tests/co19/co19-dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 66c32e66d19ea0aed8c563f855080ec3869f7072..31ad44c8188955c7db9cb861ed95862c196418fb 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> classesUsingTypeVariableExpression;
+
// 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),
+ classesUsingTypeVariableExpression = 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.
+ classesUsingTypeVariableExpression.forEach(potentiallyAddForRti);
}
Iterable<ClassElement> commonSupertypesOf(ClassElement x, ClassElement y) {
@@ -179,6 +187,10 @@ class World {
classes.add(dependency);
}
+ void registerClassUsingVariableExpression(ClassElement cls) {
+ classesUsingTypeVariableExpression.add(cls);
+ }
+
bool needsRti(ClassElement cls) {
return classesNeedingRti.contains(cls) || compiler.enabledRuntimeType;
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/builder.dart ('k') | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698