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 '../dart_types.dart' show DartType, InterfaceType; | 18 import '../dart_types.dart' show DartType, InterfaceType; |
19 import '../elements/elements.dart' | 19 import '../elements/elements.dart' |
20 show ClassElement, Element, FunctionElement, LibraryElement; | 20 show ClassElement, Element, FunctionElement, LibraryElement; |
21 import '../enqueue.dart' | 21 import '../enqueue.dart' show Enqueuer, EnqueueTask, ResolutionEnqueuer; |
22 show Enqueuer, EnqueueTask, CodegenEnqueuer, ResolutionEnqueuer; | |
23 import '../io/code_output.dart' show CodeBuffer; | 22 import '../io/code_output.dart' show CodeBuffer; |
24 import '../io/source_information.dart' show SourceInformationStrategy; | 23 import '../io/source_information.dart' show SourceInformationStrategy; |
25 import '../js_backend/backend_helpers.dart' as js_backend show BackendHelpers; | 24 import '../js_backend/backend_helpers.dart' as js_backend show BackendHelpers; |
26 import '../js_backend/js_backend.dart' as js_backend; | 25 import '../js_backend/js_backend.dart' as js_backend; |
27 import '../library_loader.dart' show LibraryLoader, LoadedLibraries; | 26 import '../library_loader.dart' show LibraryLoader, LoadedLibraries; |
28 import '../native/native.dart' as native show NativeEnqueuer, maybeEnableNative; | 27 import '../native/native.dart' as native show NativeEnqueuer, maybeEnableNative; |
29 import '../patch_parser.dart' | 28 import '../patch_parser.dart' |
30 show checkNativeAnnotation, checkJsInteropAnnotation; | 29 show checkNativeAnnotation, checkJsInteropAnnotation; |
31 import '../serialization/serialization.dart' | 30 import '../serialization/serialization.dart' |
32 show DeserializerPlugin, SerializerPlugin; | 31 show DeserializerPlugin, SerializerPlugin; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 Iterable<ClassElement> classesRequiredForReflection = const []; | 75 Iterable<ClassElement> classesRequiredForReflection = const []; |
77 | 76 |
78 // Given a [FunctionElement], return a buffer with the code generated for it | 77 // Given a [FunctionElement], return a buffer with the code generated for it |
79 // or null if no code was generated. | 78 // or null if no code was generated. |
80 CodeBuffer codeOf(Element element) => null; | 79 CodeBuffer codeOf(Element element) => null; |
81 | 80 |
82 void initializeHelperClasses() {} | 81 void initializeHelperClasses() {} |
83 | 82 |
84 void enqueueHelpers(ResolutionEnqueuer world, Registry registry); | 83 void enqueueHelpers(ResolutionEnqueuer world, Registry registry); |
85 | 84 |
86 /// Creates a [CodegenEnqueuer] specific to this backend. | 85 /// Creates an [Enqueuer] for code generation specific to this backend. |
87 CodegenEnqueuer createCodegenEnqueuer(Compiler compiler); | 86 Enqueuer createCodegenEnqueuer(Compiler compiler); |
88 | 87 |
89 WorldImpact codegen(CodegenWorkItem work); | 88 WorldImpact codegen(CodegenWorkItem work); |
90 | 89 |
91 // The backend determines the native resolution enqueuer, with a no-op | 90 // The backend determines the native resolution enqueuer, with a no-op |
92 // default, so tools like dart2dart can ignore the native classes. | 91 // default, so tools like dart2dart can ignore the native classes. |
93 native.NativeEnqueuer nativeResolutionEnqueuer(world) { | 92 native.NativeEnqueuer nativeResolutionEnqueuer(world) { |
94 return new native.NativeEnqueuer(); | 93 return new native.NativeEnqueuer(); |
95 } | 94 } |
96 | 95 |
97 native.NativeEnqueuer nativeCodegenEnqueuer(world) { | 96 native.NativeEnqueuer nativeCodegenEnqueuer(world) { |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 } | 409 } |
411 } | 410 } |
412 | 411 |
413 /// Interface for serialization of backend specific data. | 412 /// Interface for serialization of backend specific data. |
414 class BackendSerialization { | 413 class BackendSerialization { |
415 const BackendSerialization(); | 414 const BackendSerialization(); |
416 | 415 |
417 SerializerPlugin get serializer => const SerializerPlugin(); | 416 SerializerPlugin get serializer => const SerializerPlugin(); |
418 DeserializerPlugin get deserializer => const DeserializerPlugin(); | 417 DeserializerPlugin get deserializer => const DeserializerPlugin(); |
419 } | 418 } |
OLD | NEW |