| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 import '../patch_parser.dart' show | 53 import '../patch_parser.dart' show |
| 54 checkNativeAnnotation, checkJsInteropAnnotation; | 54 checkNativeAnnotation, checkJsInteropAnnotation; |
| 55 import '../resolution/tree_elements.dart' show | 55 import '../resolution/tree_elements.dart' show |
| 56 TreeElements; | 56 TreeElements; |
| 57 import '../tree/tree.dart' show | 57 import '../tree/tree.dart' show |
| 58 Node, | 58 Node, |
| 59 Send; | 59 Send; |
| 60 import '../universe/call_structure.dart' show | 60 import '../universe/call_structure.dart' show |
| 61 CallStructure; | 61 CallStructure; |
| 62 import '../universe/world_impact.dart' show | 62 import '../universe/world_impact.dart' show |
| 63 ImpactStrategy, |
| 63 WorldImpact; | 64 WorldImpact; |
| 64 | 65 |
| 65 import 'codegen.dart' show | 66 import 'codegen.dart' show |
| 66 CodegenWorkItem; | 67 CodegenWorkItem; |
| 67 import 'registry.dart' show | 68 import 'registry.dart' show |
| 68 Registry; | 69 Registry; |
| 69 import 'tasks.dart' show | 70 import 'tasks.dart' show |
| 70 CompilerTask; | 71 CompilerTask; |
| 71 import 'work.dart' show | 72 import 'work.dart' show |
| 72 ItemCompilationContext; | 73 ItemCompilationContext; |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 void registerForeignCall(Send node, | 418 void registerForeignCall(Send node, |
| 418 Element element, | 419 Element element, |
| 419 CallStructure callStructure, | 420 CallStructure callStructure, |
| 420 ForeignResolver resolver) {} | 421 ForeignResolver resolver) {} |
| 421 | 422 |
| 422 /// Returns the location of the patch-file associated with [libraryName] | 423 /// Returns the location of the patch-file associated with [libraryName] |
| 423 /// resolved from [plaformConfigUri]. | 424 /// resolved from [plaformConfigUri]. |
| 424 /// | 425 /// |
| 425 /// Returns null if there is none. | 426 /// Returns null if there is none. |
| 426 Uri resolvePatchUri(String libraryName, Uri plaformConfigUri); | 427 Uri resolvePatchUri(String libraryName, Uri plaformConfigUri); |
| 428 |
| 429 /// Creates an impact strategy to use for compilation. |
| 430 ImpactStrategy createImpactStrategy( |
| 431 {bool supportDeferredLoad: true, |
| 432 bool supportDumpInfo: true}) { |
| 433 return const ImpactStrategy(); |
| 434 } |
| 427 } | 435 } |
| 428 | 436 |
| 429 /// Interface for resolving calls to foreign functions. | 437 /// Interface for resolving calls to foreign functions. |
| 430 abstract class ForeignResolver { | 438 abstract class ForeignResolver { |
| 431 /// Returns the constant expression of [node], or `null` if [node] is not | 439 /// Returns the constant expression of [node], or `null` if [node] is not |
| 432 /// a constant expression. | 440 /// a constant expression. |
| 433 ConstantExpression getConstant(Node node); | 441 ConstantExpression getConstant(Node node); |
| 434 | 442 |
| 435 /// Registers [type] as instantiated. | 443 /// Registers [type] as instantiated. |
| 436 void registerInstantiatedType(InterfaceType type); | 444 void registerInstantiatedType(InterfaceType type); |
| 437 | 445 |
| 438 /// Resolves [typeName] to a type in the context of [node]. | 446 /// Resolves [typeName] to a type in the context of [node]. |
| 439 DartType resolveTypeFromString(Node node, String typeName); | 447 DartType resolveTypeFromString(Node node, String typeName); |
| 440 } | 448 } |
| 441 | 449 |
| 442 /// Backend transformation methods for the world impacts. | 450 /// Backend transformation methods for the world impacts. |
| 443 class ImpactTransformer { | 451 class ImpactTransformer { |
| 444 /// Transform the [ResolutionImpact] into a [WorldImpact] adding the | 452 /// Transform the [ResolutionImpact] into a [WorldImpact] adding the |
| 445 /// backend dependencies for features used in [worldImpact]. | 453 /// backend dependencies for features used in [worldImpact]. |
| 446 WorldImpact transformResolutionImpact(ResolutionImpact worldImpact) { | 454 WorldImpact transformResolutionImpact(ResolutionImpact worldImpact) { |
| 447 return worldImpact; | 455 return worldImpact; |
| 448 } | 456 } |
| 449 | 457 |
| 450 /// Transform the [CodegenImpact] into a [WorldImpact] adding the | 458 /// Transform the [CodegenImpact] into a [WorldImpact] adding the |
| 451 /// backend dependencies for features used in [worldImpact]. | 459 /// backend dependencies for features used in [worldImpact]. |
| 452 WorldImpact transformCodegenImpact(CodegenImpact worldImpact) { | 460 WorldImpact transformCodegenImpact(CodegenImpact worldImpact) { |
| 453 return worldImpact; | 461 return worldImpact; |
| 454 } | 462 } |
| 455 } | 463 } |
| OLD | NEW |