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

Unified Diff: pkg/compiler/lib/src/ssa/optimize.dart

Issue 2981543002: Handle type variable test and typed list literal. (Closed)
Patch Set: Updated cf. comment Created 3 years, 5 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 | « pkg/compiler/lib/src/ssa/locals_handler.dart ('k') | pkg/compiler/lib/src/ssa/type_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/optimize.dart
diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
index d4e0766dea5bde70217524d6ab62c5ee0da14c7e..5b544b34be2ff0370fde9612a2b17d314475e85d 100644
--- a/pkg/compiler/lib/src/ssa/optimize.dart
+++ b/pkg/compiler/lib/src/ssa/optimize.dart
@@ -1257,15 +1257,16 @@ class SsaInstructionSimplifier extends HBaseVisitor
}
HInstruction visitTypeInfoReadVariable(HTypeInfoReadVariable node) {
- ResolutionTypeVariableType variable = node.variable;
+ TypeVariableType variable = node.variable;
+ ClassEntity contextClass = variable.element.typeDeclaration;
HInstruction object = node.object;
- HInstruction finishGroundType(ResolutionInterfaceType groundType) {
- ResolutionInterfaceType typeAtVariable =
- groundType.asInstanceOf(variable.element.enclosingClass);
+ HInstruction finishGroundType(InterfaceType groundType) {
+ InterfaceType typeAtVariable =
+ _closedWorld.dartTypes.asInstanceOf(groundType, contextClass);
if (typeAtVariable != null) {
int index = variable.element.index;
- ResolutionDartType typeArgument = typeAtVariable.typeArguments[index];
+ DartType typeArgument = typeAtVariable.typeArguments[index];
HInstruction replacement = new HTypeInfoExpression(
TypeInfoExpressionKind.COMPLETE,
typeArgument,
@@ -1279,17 +1280,19 @@ class SsaInstructionSimplifier extends HBaseVisitor
/// Read the type variable from an allocation of type [createdClass], where
/// [selectTypeArgumentFromObjectCreation] extracts the type argument from
/// the allocation for factory constructor call.
- HInstruction finishSubstituted(ClassElement createdClass,
+ HInstruction finishSubstituted(ClassEntity createdClass,
HInstruction selectTypeArgumentFromObjectCreation(int index)) {
+ InterfaceType thisType = _closedWorld.dartTypes.getThisType(createdClass);
+
HInstruction instructionForTypeVariable(ResolutionTypeVariableType tv) {
return selectTypeArgumentFromObjectCreation(
- createdClass.thisType.typeArguments.indexOf(tv));
+ thisType.typeArguments.indexOf(tv));
}
- ResolutionDartType type = createdClass.thisType
- .asInstanceOf(variable.element.enclosingClass)
+ DartType type = _closedWorld.dartTypes
+ .asInstanceOf(thisType, contextClass)
.typeArguments[variable.element.index];
- if (type is ResolutionTypeVariableType) {
+ if (type is TypeVariableType) {
return instructionForTypeVariable(type);
}
List<HInstruction> arguments = <HInstruction>[];
« no previous file with comments | « pkg/compiler/lib/src/ssa/locals_handler.dart ('k') | pkg/compiler/lib/src/ssa/type_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698