| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 dart2js.backend_api; | 5 library dart2js.backend_api; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 | 8 |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../common/codegen.dart' show CodegenImpact; | 10 import '../common/codegen.dart' show CodegenImpact; |
| 11 import '../common/resolution.dart' show ResolutionImpact, Frontend, Target; | 11 import '../common/resolution.dart' show ResolutionImpact, Frontend, Target; |
| 12 import '../compile_time_constants.dart' | 12 import '../compile_time_constants.dart' |
| 13 show BackendConstantEnvironment, ConstantCompilerTask; | 13 show BackendConstantEnvironment, ConstantCompilerTask; |
| 14 import '../compiler.dart' show Compiler; | 14 import '../compiler.dart' show Compiler; |
| 15 import '../constants/constant_system.dart' show ConstantSystem; | 15 import '../constants/constant_system.dart' show ConstantSystem; |
| 16 import '../constants/expressions.dart' show ConstantExpression; | 16 import '../constants/expressions.dart' show ConstantExpression; |
| 17 import '../constants/values.dart' show ConstantValue; | 17 import '../constants/values.dart' show ConstantValue; |
| 18 import '../elements/resolution_types.dart' show DartType, InterfaceType; | 18 import '../elements/resolution_types.dart' |
| 19 show ResolutionDartType, ResolutionInterfaceType; |
| 19 import '../elements/elements.dart' | 20 import '../elements/elements.dart' |
| 20 show | 21 show |
| 21 ClassElement, | 22 ClassElement, |
| 22 Element, | 23 Element, |
| 23 FunctionElement, | 24 FunctionElement, |
| 24 MemberElement, | 25 MemberElement, |
| 25 MethodElement, | 26 MethodElement, |
| 26 LibraryElement; | 27 LibraryElement; |
| 27 import '../elements/entities.dart'; | 28 import '../elements/entities.dart'; |
| 28 import '../enqueue.dart' show Enqueuer, EnqueueTask, ResolutionEnqueuer; | 29 import '../enqueue.dart' show Enqueuer, EnqueueTask, ResolutionEnqueuer; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 144 |
| 144 /// Called to notify to the backend that a class is implemented by an | 145 /// Called to notify to the backend that a class is implemented by an |
| 145 /// instantiated class. Any backend specific [WorldImpact] of this is | 146 /// instantiated class. Any backend specific [WorldImpact] of this is |
| 146 /// returned. | 147 /// returned. |
| 147 WorldImpact registerImplementedClass(ClassElement cls, | 148 WorldImpact registerImplementedClass(ClassElement cls, |
| 148 {bool forResolution}) => | 149 {bool forResolution}) => |
| 149 const WorldImpact(); | 150 const WorldImpact(); |
| 150 | 151 |
| 151 /// Called to instruct to the backend register [type] as instantiated on | 152 /// Called to instruct to the backend register [type] as instantiated on |
| 152 /// [enqueuer]. | 153 /// [enqueuer]. |
| 153 void registerInstantiatedType(InterfaceType type) {} | 154 void registerInstantiatedType(ResolutionInterfaceType type) {} |
| 154 | 155 |
| 155 /// Register a runtime type variable bound tests between [typeArgument] and | 156 /// Register a runtime type variable bound tests between [typeArgument] and |
| 156 /// [bound]. | 157 /// [bound]. |
| 157 void registerTypeVariableBoundsSubtypeCheck( | 158 void registerTypeVariableBoundsSubtypeCheck( |
| 158 DartType typeArgument, DartType bound) {} | 159 ResolutionDartType typeArgument, ResolutionDartType bound) {} |
| 159 | 160 |
| 160 /// Called to instruct the backend to register that a closure exists for a | 161 /// Called to instruct the backend to register that a closure exists for a |
| 161 /// function on an instantiated generic class. Any backend specific | 162 /// function on an instantiated generic class. Any backend specific |
| 162 /// [WorldImpact] of this is returned. | 163 /// [WorldImpact] of this is returned. |
| 163 WorldImpact registerClosureWithFreeTypeVariables(Element closure, | 164 WorldImpact registerClosureWithFreeTypeVariables(Element closure, |
| 164 {bool forResolution}) => | 165 {bool forResolution}) => |
| 165 const WorldImpact(); | 166 const WorldImpact(); |
| 166 | 167 |
| 167 /// Called to register that a member has been closurized. Any backend specific | 168 /// Called to register that a member has been closurized. Any backend specific |
| 168 /// [WorldImpact] of this is returned. | 169 /// [WorldImpact] of this is returned. |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 void registerNativeData(dynamic nativeData); | 353 void registerNativeData(dynamic nativeData); |
| 353 } | 354 } |
| 354 | 355 |
| 355 /// Interface for resolving calls to foreign functions. | 356 /// Interface for resolving calls to foreign functions. |
| 356 abstract class ForeignResolver { | 357 abstract class ForeignResolver { |
| 357 /// Returns the constant expression of [node], or `null` if [node] is not | 358 /// Returns the constant expression of [node], or `null` if [node] is not |
| 358 /// a constant expression. | 359 /// a constant expression. |
| 359 ConstantExpression getConstant(Node node); | 360 ConstantExpression getConstant(Node node); |
| 360 | 361 |
| 361 /// Registers [type] as instantiated. | 362 /// Registers [type] as instantiated. |
| 362 void registerInstantiatedType(InterfaceType type); | 363 void registerInstantiatedType(ResolutionInterfaceType type); |
| 363 | 364 |
| 364 /// Resolves [typeName] to a type in the context of [node]. | 365 /// Resolves [typeName] to a type in the context of [node]. |
| 365 DartType resolveTypeFromString(Node node, String typeName); | 366 ResolutionDartType resolveTypeFromString(Node node, String typeName); |
| 366 } | 367 } |
| 367 | 368 |
| 368 /// Backend transformation methods for the world impacts. | 369 /// Backend transformation methods for the world impacts. |
| 369 class ImpactTransformer { | 370 class ImpactTransformer { |
| 370 /// Transform the [ResolutionImpact] into a [WorldImpact] adding the | 371 /// Transform the [ResolutionImpact] into a [WorldImpact] adding the |
| 371 /// backend dependencies for features used in [worldImpact]. | 372 /// backend dependencies for features used in [worldImpact]. |
| 372 WorldImpact transformResolutionImpact( | 373 WorldImpact transformResolutionImpact( |
| 373 ResolutionEnqueuer enqueuer, ResolutionImpact worldImpact) { | 374 ResolutionEnqueuer enqueuer, ResolutionImpact worldImpact) { |
| 374 return worldImpact; | 375 return worldImpact; |
| 375 } | 376 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 ClassElement get indexableImplementation; | 416 ClassElement get indexableImplementation; |
| 416 ClassElement get mutableIndexableImplementation; | 417 ClassElement get mutableIndexableImplementation; |
| 417 ClassElement get indexingBehaviorImplementation; | 418 ClassElement get indexingBehaviorImplementation; |
| 418 ClassElement get interceptorImplementation; | 419 ClassElement get interceptorImplementation; |
| 419 | 420 |
| 420 bool isDefaultEqualityImplementation(Element element); | 421 bool isDefaultEqualityImplementation(Element element); |
| 421 bool isInterceptorClass(ClassElement cls); | 422 bool isInterceptorClass(ClassElement cls); |
| 422 bool isNativeClass(ClassElement element); | 423 bool isNativeClass(ClassElement element); |
| 423 bool isNativeMember(MemberElement element); | 424 bool isNativeMember(MemberElement element); |
| 424 } | 425 } |
| OLD | NEW |