| 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 | 10 import '../common/codegen.dart' show |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 | 405 |
| 406 void registerAsyncMarker(FunctionElement element, | 406 void registerAsyncMarker(FunctionElement element, |
| 407 Enqueuer enqueuer, | 407 Enqueuer enqueuer, |
| 408 Registry registry) {} | 408 Registry registry) {} |
| 409 | 409 |
| 410 /// Called when resolving a call to a foreign function. | 410 /// Called when resolving a call to a foreign function. |
| 411 void registerForeignCall(Send node, | 411 void registerForeignCall(Send node, |
| 412 Element element, | 412 Element element, |
| 413 CallStructure callStructure, | 413 CallStructure callStructure, |
| 414 ForeignResolver resolver) {} | 414 ForeignResolver resolver) {} |
| 415 |
| 416 /// Returns the location of the patch-file associated with [libraryName] |
| 417 /// resolved from [plaformConfigUri]. |
| 418 /// |
| 419 /// Returns null if there is none. |
| 420 Uri resolvePatchUri(String libraryName, Uri plaformConfigUri); |
| 415 } | 421 } |
| 416 | 422 |
| 417 /// Interface for resolving calls to foreign functions. | 423 /// Interface for resolving calls to foreign functions. |
| 418 abstract class ForeignResolver { | 424 abstract class ForeignResolver { |
| 419 /// Returns the constant expression of [node], or `null` if [node] is not | 425 /// Returns the constant expression of [node], or `null` if [node] is not |
| 420 /// a constant expression. | 426 /// a constant expression. |
| 421 ConstantExpression getConstant(Node node); | 427 ConstantExpression getConstant(Node node); |
| 422 | 428 |
| 423 /// Registers [type] as instantiated. | 429 /// Registers [type] as instantiated. |
| 424 void registerInstantiatedType(InterfaceType type); | 430 void registerInstantiatedType(InterfaceType type); |
| 425 | 431 |
| 426 /// Resolves [typeName] to a type in the context of [node]. | 432 /// Resolves [typeName] to a type in the context of [node]. |
| 427 DartType resolveTypeFromString(Node node, String typeName); | 433 DartType resolveTypeFromString(Node node, String typeName); |
| 428 } | 434 } |
| 429 | 435 |
| 430 /// Backend transformation methods for the world impacts. | 436 /// Backend transformation methods for the world impacts. |
| 431 class ImpactTransformer { | 437 class ImpactTransformer { |
| 432 /// Transform the [ResolutionImpact] into a [WorldImpact] adding the | 438 /// Transform the [ResolutionImpact] into a [WorldImpact] adding the |
| 433 /// backend dependencies for features used in [worldImpact]. | 439 /// backend dependencies for features used in [worldImpact]. |
| 434 WorldImpact transformResolutionImpact(ResolutionImpact worldImpact) { | 440 WorldImpact transformResolutionImpact(ResolutionImpact worldImpact) { |
| 435 return worldImpact; | 441 return worldImpact; |
| 436 } | 442 } |
| 437 | 443 |
| 438 /// Transform the [CodegenImpact] into a [WorldImpact] adding the | 444 /// Transform the [CodegenImpact] into a [WorldImpact] adding the |
| 439 /// backend dependencies for features used in [worldImpact]. | 445 /// backend dependencies for features used in [worldImpact]. |
| 440 WorldImpact transformCodegenImpact(CodegenImpact worldImpact) { | 446 WorldImpact transformCodegenImpact(CodegenImpact worldImpact) { |
| 441 return worldImpact; | 447 return worldImpact; |
| 442 } | 448 } |
| 443 } | 449 } |
| OLD | NEW |