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.js_backend.element_strategy; | 5 library dart2js.js_backend.element_strategy; |
6 | 6 |
7 import '../backend_strategy.dart'; | 7 import '../backend_strategy.dart'; |
8 import '../closure.dart' show ClosureConversionTask, ClosureTask; | 8 import '../closure.dart' show ClosureConversionTask, ClosureTask; |
9 import '../common.dart'; | 9 import '../common.dart'; |
10 import '../common/codegen.dart'; | 10 import '../common/codegen.dart'; |
(...skipping 16 matching lines...) Expand all Loading... | |
27 import '../ssa/ssa.dart'; | 27 import '../ssa/ssa.dart'; |
28 import '../options.dart'; | 28 import '../options.dart'; |
29 import '../universe/world_builder.dart'; | 29 import '../universe/world_builder.dart'; |
30 import '../universe/world_impact.dart'; | 30 import '../universe/world_impact.dart'; |
31 import '../world.dart'; | 31 import '../world.dart'; |
32 | 32 |
33 /// Strategy for using the [Element] model from the resolver as the backend | 33 /// Strategy for using the [Element] model from the resolver as the backend |
34 /// model. | 34 /// model. |
35 class ElementBackendStrategy implements BackendStrategy { | 35 class ElementBackendStrategy implements BackendStrategy { |
36 final Compiler _compiler; | 36 final Compiler _compiler; |
37 final ClosureConversionTask closureDataLookup; | |
37 SourceInformationStrategy _sourceInformationStrategy; | 38 SourceInformationStrategy _sourceInformationStrategy; |
38 | 39 |
39 ElementBackendStrategy(this._compiler); | 40 ElementBackendStrategy(this._compiler) |
41 : closureDataLookup = new ClosureTask(_compiler); | |
40 | 42 |
41 ClosedWorldRefiner createClosedWorldRefiner(ClosedWorldImpl closedWorld) => | 43 ClosedWorldRefiner createClosedWorldRefiner(ClosedWorldImpl closedWorld) => |
42 closedWorld; | 44 closedWorld; |
43 | 45 |
44 Sorter get sorter => const ElementSorter(); | 46 Sorter get sorter => const ElementSorter(); |
45 | 47 |
46 @override | 48 @override |
47 ClosureConversionTask createClosureConversionTask(Compiler compiler) => | |
Emily Fortuna
2017/06/19 17:44:41
is taking this out the direction you want to go? I
Johnni Winther
2017/06/20 10:33:12
I want to get rid of CompilerTask as base classes.
| |
48 new ClosureTask(compiler); | |
49 | |
50 @override | |
51 CodegenWorldBuilder createCodegenWorldBuilder( | 49 CodegenWorldBuilder createCodegenWorldBuilder( |
52 NativeBasicData nativeBasicData, | 50 NativeBasicData nativeBasicData, |
53 ClosedWorld closedWorld, | 51 ClosedWorld closedWorld, |
54 SelectorConstraintsStrategy selectorConstraintsStrategy) { | 52 SelectorConstraintsStrategy selectorConstraintsStrategy) { |
55 return new ElementCodegenWorldBuilderImpl( | 53 return new ElementCodegenWorldBuilderImpl( |
56 _compiler.backend.constants, | 54 _compiler.backend.constants, |
57 closedWorld.elementEnvironment, | 55 closedWorld.elementEnvironment, |
58 nativeBasicData, | 56 nativeBasicData, |
59 closedWorld, | 57 closedWorld, |
60 selectorConstraintsStrategy); | 58 selectorConstraintsStrategy); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 | 157 |
160 MemberElement get element => resolvedAst.element; | 158 MemberElement get element => resolvedAst.element; |
161 | 159 |
162 WorldImpact run() { | 160 WorldImpact run() { |
163 registry = new CodegenRegistry(_closedWorld.elementEnvironment, element); | 161 registry = new CodegenRegistry(_closedWorld.elementEnvironment, element); |
164 return _backend.codegen(this, _closedWorld); | 162 return _backend.codegen(this, _closedWorld); |
165 } | 163 } |
166 | 164 |
167 String toString() => 'CodegenWorkItem(${resolvedAst.element})'; | 165 String toString() => 'CodegenWorkItem(${resolvedAst.element})'; |
168 } | 166 } |
OLD | NEW |