Chromium Code Reviews| 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) { |