| 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 dart2js.backend_strategy; | 5 library dart2js.backend_strategy; |
| 6 | 6 |
| 7 import 'closure.dart' show ClosureConversionTask; | 7 import 'closure.dart' show ClosureConversionTask; |
| 8 import 'common/tasks.dart'; | 8 import 'common/tasks.dart'; |
| 9 import 'compiler.dart' show Compiler; | |
| 10 import 'enqueue.dart'; | 9 import 'enqueue.dart'; |
| 11 import 'io/source_information.dart'; | 10 import 'io/source_information.dart'; |
| 12 import 'js_backend/js_backend.dart'; | 11 import 'js_backend/js_backend.dart'; |
| 13 import 'js_backend/native_data.dart'; | 12 import 'js_backend/native_data.dart'; |
| 14 import 'js_emitter/sorter.dart'; | 13 import 'js_emitter/sorter.dart'; |
| 15 import 'ssa/ssa.dart'; | 14 import 'ssa/ssa.dart'; |
| 16 import 'universe/world_builder.dart'; | 15 import 'universe/world_builder.dart'; |
| 17 import 'world.dart'; | 16 import 'world.dart'; |
| 18 | 17 |
| 19 /// Strategy pattern that defines the element model used in type inference | 18 /// Strategy pattern that defines the element model used in type inference |
| 20 /// and code generation. | 19 /// and code generation. |
| 21 abstract class BackendStrategy { | 20 abstract class BackendStrategy { |
| 22 /// Create the [ClosedWorldRefiner] for [closedWorld]. | 21 /// Create the [ClosedWorldRefiner] for [closedWorld]. |
| 23 ClosedWorldRefiner createClosedWorldRefiner(ClosedWorld closedWorld); | 22 ClosedWorldRefiner createClosedWorldRefiner(ClosedWorld closedWorld); |
| 24 | 23 |
| 25 /// Create the task that analyzes the code to see what closures need to be | 24 /// Create the task that analyzes the code to see what closures need to be |
| 26 /// rewritten. | 25 /// rewritten. |
| 27 ClosureConversionTask createClosureConversionTask(Compiler compiler); | 26 ClosureConversionTask get closureDataLookup; |
| 28 | 27 |
| 29 /// The [Sorter] used for sorting elements in the generated code. | 28 /// The [Sorter] used for sorting elements in the generated code. |
| 30 Sorter get sorter; | 29 Sorter get sorter; |
| 31 | 30 |
| 32 /// Creates the [CodegenWorldBuilder] used by the codegen enqueuer. | 31 /// Creates the [CodegenWorldBuilder] used by the codegen enqueuer. |
| 33 CodegenWorldBuilder createCodegenWorldBuilder( | 32 CodegenWorldBuilder createCodegenWorldBuilder( |
| 34 NativeBasicData nativeBasicData, | 33 NativeBasicData nativeBasicData, |
| 35 ClosedWorld closedWorld, | 34 ClosedWorld closedWorld, |
| 36 SelectorConstraintsStrategy selectorConstraintsStrategy); | 35 SelectorConstraintsStrategy selectorConstraintsStrategy); |
| 37 | 36 |
| 38 /// Creates the [WorkItemBuilder] used by the codegen enqueuer. | 37 /// Creates the [WorkItemBuilder] used by the codegen enqueuer. |
| 39 WorkItemBuilder createCodegenWorkItemBuilder(ClosedWorld closedWorld); | 38 WorkItemBuilder createCodegenWorkItemBuilder(ClosedWorld closedWorld); |
| 40 | 39 |
| 41 /// Creates the [SsaBuilder] used for the element model. | 40 /// Creates the [SsaBuilder] used for the element model. |
| 42 SsaBuilder createSsaBuilder(CompilerTask task, JavaScriptBackend backend, | 41 SsaBuilder createSsaBuilder(CompilerTask task, JavaScriptBackend backend, |
| 43 SourceInformationStrategy sourceInformationStrategy); | 42 SourceInformationStrategy sourceInformationStrategy); |
| 44 | 43 |
| 45 /// Returns the [SourceInformationStrategy] use for the element model. | 44 /// Returns the [SourceInformationStrategy] use for the element model. |
| 46 SourceInformationStrategy get sourceInformationStrategy; | 45 SourceInformationStrategy get sourceInformationStrategy; |
| 47 } | 46 } |
| OLD | NEW |