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_model.strategy; | 5 library dart2js.js_model.strategy; |
6 | 6 |
7 import '../closure.dart' show ClosureConversionTask; | 7 import '../closure.dart' show ClosureConversionTask; |
| 8 import '../common.dart'; |
8 import '../common/tasks.dart'; | 9 import '../common/tasks.dart'; |
9 import '../common_elements.dart'; | 10 import '../common_elements.dart'; |
10 import '../compiler.dart'; | 11 import '../compiler.dart'; |
11 import '../elements/elements.dart' show TypedefElement; | 12 import '../elements/elements.dart' show TypedefElement; |
12 import '../elements/entities.dart'; | 13 import '../elements/entities.dart'; |
13 import '../enqueue.dart'; | 14 import '../enqueue.dart'; |
14 import '../io/source_information.dart'; | 15 import '../io/source_information.dart'; |
15 import '../js_emitter/sorter.dart'; | 16 import '../js_emitter/sorter.dart'; |
16 import '../js/js_source_mapping.dart'; | 17 import '../js/js_source_mapping.dart'; |
17 import '../js_backend/backend.dart'; | 18 import '../js_backend/backend.dart'; |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 NativeBasicData nativeBasicData, | 202 NativeBasicData nativeBasicData, |
202 ClosedWorld closedWorld, | 203 ClosedWorld closedWorld, |
203 SelectorConstraintsStrategy selectorConstraintsStrategy) { | 204 SelectorConstraintsStrategy selectorConstraintsStrategy) { |
204 return new KernelCodegenWorldBuilder( | 205 return new KernelCodegenWorldBuilder( |
205 elementMap, | 206 elementMap, |
206 closedWorld.elementEnvironment, | 207 closedWorld.elementEnvironment, |
207 nativeBasicData, | 208 nativeBasicData, |
208 closedWorld, | 209 closedWorld, |
209 selectorConstraintsStrategy); | 210 selectorConstraintsStrategy); |
210 } | 211 } |
| 212 |
| 213 @override |
| 214 SourceSpan spanFromSpannable(Spannable spannable, Entity currentElement) { |
| 215 return _elementMap.getSourceSpan(spannable, currentElement); |
| 216 } |
211 } | 217 } |
212 | 218 |
213 class JsRuntimeTypesNeed implements RuntimeTypesNeed { | 219 class JsRuntimeTypesNeed implements RuntimeTypesNeed { |
214 final JsToFrontendMap _map; | 220 final JsToFrontendMap _map; |
215 final RuntimeTypesNeed _rtiNeed; | 221 final RuntimeTypesNeed _rtiNeed; |
216 | 222 |
217 JsRuntimeTypesNeed(this._map, this._rtiNeed); | 223 JsRuntimeTypesNeed(this._map, this._rtiNeed); |
218 | 224 |
219 @override | 225 @override |
220 bool classNeedsRti(ClassEntity cls) { | 226 bool classNeedsRti(ClassEntity cls) { |
(...skipping 13 matching lines...) Expand all Loading... |
234 @override | 240 @override |
235 bool methodNeedsRti(FunctionEntity function) { | 241 bool methodNeedsRti(FunctionEntity function) { |
236 return _rtiNeed.methodNeedsRti(_map.toFrontendMember(function)); | 242 return _rtiNeed.methodNeedsRti(_map.toFrontendMember(function)); |
237 } | 243 } |
238 | 244 |
239 @override | 245 @override |
240 bool classNeedsRtiField(ClassEntity cls) { | 246 bool classNeedsRtiField(ClassEntity cls) { |
241 return _rtiNeed.classNeedsRtiField(_map.toFrontendClass(cls)); | 247 return _rtiNeed.classNeedsRtiField(_map.toFrontendClass(cls)); |
242 } | 248 } |
243 } | 249 } |
OLD | NEW |