| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 library js_backend.backend.impact_transformer; | 5 library js_backend.backend.impact_transformer; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common_elements.dart'; | 8 import '../common_elements.dart'; |
| 9 import '../common/backend_api.dart' show ImpactTransformer; | 9 import '../common/backend_api.dart' show ImpactTransformer; |
| 10 import '../common/codegen.dart' show CodegenImpact; | 10 import '../common/codegen.dart' show CodegenImpact; |
| 11 import '../common/resolution.dart' show ResolutionImpact; | 11 import '../common/resolution.dart' show ResolutionImpact; |
| 12 import '../constants/expressions.dart'; | 12 import '../constants/expressions.dart'; |
| 13 import '../common_elements.dart' show ElementEnvironment; | 13 import '../common_elements.dart' show ElementEnvironment; |
| 14 import '../elements/entities.dart'; | 14 import '../elements/entities.dart'; |
| 15 import '../elements/resolution_types.dart' show Types; | |
| 16 import '../elements/types.dart'; | 15 import '../elements/types.dart'; |
| 17 import '../native/enqueue.dart'; | 16 import '../native/enqueue.dart'; |
| 18 import '../native/native.dart' as native; | 17 import '../native/native.dart' as native; |
| 19 import '../options.dart'; | 18 import '../options.dart'; |
| 20 import '../universe/feature.dart'; | 19 import '../universe/feature.dart'; |
| 21 import '../universe/use.dart' | 20 import '../universe/use.dart' |
| 22 show StaticUse, StaticUseKind, TypeUse, TypeUseKind; | 21 show StaticUse, StaticUseKind, TypeUse, TypeUseKind; |
| 23 import '../universe/world_impact.dart' show TransformedWorldImpact, WorldImpact; | 22 import '../universe/world_impact.dart' show TransformedWorldImpact, WorldImpact; |
| 24 import '../util/util.dart'; | 23 import '../util/util.dart'; |
| 25 import 'backend_impact.dart'; | 24 import 'backend_impact.dart'; |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 | 281 |
| 283 /// Register [type] as required for the runtime type information system. | 282 /// Register [type] as required for the runtime type information system. |
| 284 void registerRequiredType(DartType type) { | 283 void registerRequiredType(DartType type) { |
| 285 if (!type.isInterfaceType) return; | 284 if (!type.isInterfaceType) return; |
| 286 InterfaceType interfaceType = type; | 285 InterfaceType interfaceType = type; |
| 287 // If [argument] has type variables or is a type variable, this method | 286 // If [argument] has type variables or is a type variable, this method |
| 288 // registers a RTI dependency between the class where the type variable is | 287 // registers a RTI dependency between the class where the type variable is |
| 289 // defined (that is the enclosing class of the current element being | 288 // defined (that is the enclosing class of the current element being |
| 290 // resolved) and the class of [type]. If the class of [type] requires RTI, | 289 // resolved) and the class of [type]. If the class of [type] requires RTI, |
| 291 // then the class of the type variable does too. | 290 // then the class of the type variable does too. |
| 292 ClassEntity contextClass = Types.getClassContext(interfaceType); | 291 ClassEntity contextClass = DartTypes.getClassContext(interfaceType); |
| 293 if (contextClass != null) { | 292 if (contextClass != null) { |
| 294 _rtiNeedBuilder.registerRtiDependency( | 293 _rtiNeedBuilder.registerRtiDependency( |
| 295 interfaceType.element, contextClass); | 294 interfaceType.element, contextClass); |
| 296 } | 295 } |
| 297 } | 296 } |
| 298 | 297 |
| 299 // TODO(johnniwinther): Maybe split this into [onAssertType] and [onTestType]. | 298 // TODO(johnniwinther): Maybe split this into [onAssertType] and [onTestType]. |
| 300 void onIsCheck(DartType type, TransformedWorldImpact transformed) { | 299 void onIsCheck(DartType type, TransformedWorldImpact transformed) { |
| 301 void registerImpact(BackendImpact impact) { | 300 void registerImpact(BackendImpact impact) { |
| 302 impact.registerImpact(transformed, _elementEnvironment); | 301 impact.registerImpact(transformed, _elementEnvironment); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 _impacts.asyncStarBody | 470 _impacts.asyncStarBody |
| 472 .registerImpact(transformed, _elementEnvironment); | 471 .registerImpact(transformed, _elementEnvironment); |
| 473 break; | 472 break; |
| 474 } | 473 } |
| 475 } | 474 } |
| 476 | 475 |
| 477 // TODO(johnniwinther): Remove eager registration. | 476 // TODO(johnniwinther): Remove eager registration. |
| 478 return transformed; | 477 return transformed; |
| 479 } | 478 } |
| 480 } | 479 } |
| OLD | NEW |