Chromium Code Reviews| 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.dart'; | 8 import 'common.dart'; |
| 9 import 'common/tasks.dart'; | 9 import 'common/tasks.dart'; |
| 10 import 'enqueue.dart'; | 10 import 'enqueue.dart'; |
| 11 import 'elements/entities.dart'; | 11 import 'elements/entities.dart'; |
| 12 import 'io/source_information.dart'; | 12 import 'io/source_information.dart'; |
| 13 import 'js_backend/js_backend.dart'; | 13 import 'js_backend/js_backend.dart'; |
| 14 import 'js_backend/native_data.dart'; | 14 import 'js_backend/native_data.dart'; |
| 15 import 'js_emitter/sorter.dart'; | 15 import 'js_emitter/sorter.dart'; |
| 16 import 'ssa/ssa.dart'; | 16 import 'ssa/ssa.dart'; |
| 17 import 'types/types.dart'; | |
| 17 import 'universe/world_builder.dart'; | 18 import 'universe/world_builder.dart'; |
| 18 import 'world.dart'; | 19 import 'world.dart'; |
| 19 | 20 |
| 20 /// Strategy pattern that defines the element model used in type inference | 21 /// Strategy pattern that defines the element model used in type inference |
| 21 /// and code generation. | 22 /// and code generation. |
| 22 abstract class BackendStrategy { | 23 abstract class BackendStrategy { |
| 23 /// Create the [ClosedWorldRefiner] for [closedWorld]. | 24 /// Create the [ClosedWorldRefiner] for [closedWorld]. |
| 24 ClosedWorldRefiner createClosedWorldRefiner(ClosedWorld closedWorld); | 25 ClosedWorldRefiner createClosedWorldRefiner(ClosedWorld closedWorld); |
| 25 | 26 |
| 26 /// Create the task that analyzes the code to see what closures need to be | 27 /// Create the task that analyzes the code to see what closures need to be |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 41 | 42 |
| 42 /// Creates the [SsaBuilder] used for the element model. | 43 /// Creates the [SsaBuilder] used for the element model. |
| 43 SsaBuilder createSsaBuilder(CompilerTask task, JavaScriptBackend backend, | 44 SsaBuilder createSsaBuilder(CompilerTask task, JavaScriptBackend backend, |
| 44 SourceInformationStrategy sourceInformationStrategy); | 45 SourceInformationStrategy sourceInformationStrategy); |
| 45 | 46 |
| 46 /// Returns the [SourceInformationStrategy] use for the element model. | 47 /// Returns the [SourceInformationStrategy] use for the element model. |
| 47 SourceInformationStrategy get sourceInformationStrategy; | 48 SourceInformationStrategy get sourceInformationStrategy; |
| 48 | 49 |
| 49 /// Creates a [SourceSpan] from [spannable] in context of [currentElement]. | 50 /// Creates a [SourceSpan] from [spannable] in context of [currentElement]. |
| 50 SourceSpan spanFromSpannable(Spannable spannable, Entity currentElement); | 51 SourceSpan spanFromSpannable(Spannable spannable, Entity currentElement); |
| 52 | |
| 53 TypesInferrer createTypesInferrer(ClosedWorldRefiner closedWorldRefiner, | |
| 54 {bool disableTypeInference: false}); | |
| 55 | |
| 56 GlobalTypeInferenceResults createTypesInferrerResults( | |
|
Siggi Cherem (dart-lang)
2017/08/09 16:22:42
does this need to be in this strategy? Can't it be
Johnni Winther
2017/08/10 09:00:49
Good idea. Done.
| |
| 57 TypesInferrer typesInferrer, ClosedWorld closedWorld); | |
| 51 } | 58 } |
| OLD | NEW |