| 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'; |
| 11 import '../common/tasks.dart'; | 11 import '../common/tasks.dart'; |
| 12 import '../common/work.dart'; | 12 import '../common/work.dart'; |
| 13 import '../compiler.dart'; | 13 import '../compiler.dart'; |
| 14 import '../elements/elements.dart'; | 14 import '../elements/elements.dart'; |
| 15 import '../enqueue.dart'; | 15 import '../enqueue.dart'; |
| 16 import '../io/multi_information.dart' show MultiSourceInformationStrategy; | 16 import '../io/multi_information.dart' show MultiSourceInformationStrategy; |
| 17 import '../io/position_information.dart' show PositionSourceInformationStrategy; | 17 import '../io/position_information.dart' show PositionSourceInformationStrategy; |
| 18 import '../io/source_information.dart'; | 18 import '../io/source_information.dart'; |
| 19 import '../io/start_end_information.dart' | 19 import '../io/start_end_information.dart' |
| 20 show StartEndSourceInformationStrategy; | 20 show StartEndSourceInformationStrategy; |
| 21 import '../js/js_source_mapping.dart' show JavaScriptSourceInformationStrategy; | 21 import '../js/js_source_mapping.dart' show JavaScriptSourceInformationStrategy; |
| 22 import '../js_backend/backend.dart'; | 22 import '../js_backend/backend.dart'; |
| 23 import '../js_backend/native_data.dart'; | 23 import '../js_backend/native_data.dart'; |
| 24 import '../js_emitter/sorter.dart'; | 24 import '../js_emitter/sorter.dart'; |
| 25 import '../resolution/resolution_strategy.dart'; |
| 25 import '../ssa/builder.dart'; | 26 import '../ssa/builder.dart'; |
| 26 import '../ssa/rasta_ssa_builder_task.dart'; | 27 import '../ssa/rasta_ssa_builder_task.dart'; |
| 27 import '../ssa/ssa.dart'; | 28 import '../ssa/ssa.dart'; |
| 28 import '../options.dart'; | 29 import '../options.dart'; |
| 29 import '../universe/world_builder.dart'; | 30 import '../universe/world_builder.dart'; |
| 30 import '../universe/world_impact.dart'; | 31 import '../universe/world_impact.dart'; |
| 31 import '../world.dart'; | 32 import '../world.dart'; |
| 32 | 33 |
| 33 /// Strategy for using the [Element] model from the resolver as the backend | 34 /// Strategy for using the [Element] model from the resolver as the backend |
| 34 /// model. | 35 /// model. |
| 35 class ElementBackendStrategy implements BackendStrategy { | 36 class ElementBackendStrategy extends ComputeSpannableMixin |
| 37 implements BackendStrategy { |
| 36 final Compiler _compiler; | 38 final Compiler _compiler; |
| 37 final ClosureConversionTask closureDataLookup; | 39 final ClosureConversionTask closureDataLookup; |
| 38 SourceInformationStrategy _sourceInformationStrategy; | 40 SourceInformationStrategy _sourceInformationStrategy; |
| 39 | 41 |
| 40 ElementBackendStrategy(this._compiler) | 42 ElementBackendStrategy(this._compiler) |
| 41 : closureDataLookup = new ClosureTask(_compiler); | 43 : closureDataLookup = new ClosureTask(_compiler); |
| 42 | 44 |
| 43 ClosedWorldRefiner createClosedWorldRefiner( | 45 ClosedWorldRefiner createClosedWorldRefiner( |
| 44 covariant ClosedWorldImpl closedWorld) => | 46 covariant ClosedWorldImpl closedWorld) => |
| 45 closedWorld; | 47 closedWorld; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 160 |
| 159 MemberElement get element => resolvedAst.element; | 161 MemberElement get element => resolvedAst.element; |
| 160 | 162 |
| 161 WorldImpact run() { | 163 WorldImpact run() { |
| 162 registry = new CodegenRegistry(_closedWorld.elementEnvironment, element); | 164 registry = new CodegenRegistry(_closedWorld.elementEnvironment, element); |
| 163 return _backend.codegen(this, _closedWorld); | 165 return _backend.codegen(this, _closedWorld); |
| 164 } | 166 } |
| 165 | 167 |
| 166 String toString() => 'CodegenWorkItem(${resolvedAst.element})'; | 168 String toString() => 'CodegenWorkItem(${resolvedAst.element})'; |
| 167 } | 169 } |
| OLD | NEW |