OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'graph_builder.dart'; | 5 import 'graph_builder.dart'; |
6 import 'nodes.dart'; | 6 import 'nodes.dart'; |
7 import '../closure.dart'; | 7 import '../closure.dart'; |
8 import '../common.dart'; | 8 import '../common.dart'; |
9 import '../dart_types.dart'; | 9 import '../dart_types.dart'; |
10 import '../types/types.dart'; | 10 import '../types/types.dart'; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 HInstruction original, DartType type, int kind) { | 224 HInstruction original, DartType type, int kind) { |
225 if (type == null) return original; | 225 if (type == null) return original; |
226 // GENERIC_METHODS: The following statement was added for parsing and | 226 // GENERIC_METHODS: The following statement was added for parsing and |
227 // ignoring method type variables; must be generalized for full support of | 227 // ignoring method type variables; must be generalized for full support of |
228 // generic methods. | 228 // generic methods. |
229 type = type.dynamifyMethodTypeVariableType; | 229 type = type.dynamifyMethodTypeVariableType; |
230 type = type.unaliased; | 230 type = type.unaliased; |
231 assert(assertTypeInContext(type, original)); | 231 assert(assertTypeInContext(type, original)); |
232 if (type.isInterfaceType && !type.treatAsRaw) { | 232 if (type.isInterfaceType && !type.treatAsRaw) { |
233 TypeMask subtype = | 233 TypeMask subtype = |
234 new TypeMask.subtype(type.element, builder.compiler.closedWorld); | 234 new TypeMask.subtype(type.element, builder.closedWorld); |
235 HInstruction representations = | 235 HInstruction representations = |
236 buildTypeArgumentRepresentations(type, builder.sourceElement); | 236 buildTypeArgumentRepresentations(type, builder.sourceElement); |
237 builder.add(representations); | 237 builder.add(representations); |
238 return new HTypeConversion.withTypeRepresentation( | 238 return new HTypeConversion.withTypeRepresentation( |
239 type, kind, subtype, original, representations); | 239 type, kind, subtype, original, representations); |
240 } else if (type.isTypeVariable) { | 240 } else if (type.isTypeVariable) { |
241 TypeMask subtype = original.instructionType; | 241 TypeMask subtype = original.instructionType; |
242 HInstruction typeVariable = | 242 HInstruction typeVariable = |
243 addTypeVariableReference(type, builder.sourceElement); | 243 addTypeVariableReference(type, builder.sourceElement); |
244 return new HTypeConversion.withTypeRepresentation( | 244 return new HTypeConversion.withTypeRepresentation( |
245 type, kind, subtype, original, typeVariable); | 245 type, kind, subtype, original, typeVariable); |
246 } else if (type.isFunctionType) { | 246 } else if (type.isFunctionType) { |
247 return builder.buildFunctionTypeConversion(original, type, kind); | 247 return builder.buildFunctionTypeConversion(original, type, kind); |
248 } else { | 248 } else { |
249 return original.convertType(builder.closedWorld, type, kind); | 249 return original.convertType(builder.closedWorld, type, kind); |
250 } | 250 } |
251 } | 251 } |
252 } | 252 } |
OLD | NEW |