| 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 'package:kernel/ast.dart' as ir; | 7 import 'package:kernel/ast.dart' as ir; |
| 8 | 8 |
| 9 import '../closure.dart' show ClosureConversionTask; | 9 import '../closure.dart' show ClosureConversionTask; |
| 10 import '../common.dart'; | 10 import '../common.dart'; |
| 11 import '../common/tasks.dart'; | 11 import '../common/tasks.dart'; |
| 12 import '../common_elements.dart'; | 12 import '../common_elements.dart'; |
| 13 import '../compiler.dart'; | 13 import '../compiler.dart'; |
| 14 import '../constants/constant_system.dart'; | 14 import '../constants/constant_system.dart'; |
| 15 import '../elements/entities.dart'; | 15 import '../elements/entities.dart'; |
| 16 import '../elements/types.dart'; | 16 import '../elements/types.dart'; |
| 17 import '../enqueue.dart'; | 17 import '../enqueue.dart'; |
| 18 import '../io/source_information.dart'; | 18 import '../io/source_information.dart'; |
| 19 import '../inferrer/kernel_inferrer_engine.dart'; |
| 19 import '../js_emitter/sorter.dart'; | 20 import '../js_emitter/sorter.dart'; |
| 20 import '../js/js_source_mapping.dart'; | 21 import '../js/js_source_mapping.dart'; |
| 21 import '../js_backend/backend.dart'; | 22 import '../js_backend/backend.dart'; |
| 22 import '../js_backend/backend_usage.dart'; | 23 import '../js_backend/backend_usage.dart'; |
| 23 import '../js_backend/constant_system_javascript.dart'; | 24 import '../js_backend/constant_system_javascript.dart'; |
| 24 import '../js_backend/interceptor_data.dart'; | 25 import '../js_backend/interceptor_data.dart'; |
| 25 import '../js_backend/native_data.dart'; | 26 import '../js_backend/native_data.dart'; |
| 26 import '../js_backend/runtime_types.dart'; | 27 import '../js_backend/runtime_types.dart'; |
| 27 import '../kernel/element_map.dart'; | 28 import '../kernel/element_map.dart'; |
| 28 import '../kernel/element_map_impl.dart'; | 29 import '../kernel/element_map_impl.dart'; |
| 29 import '../kernel/kernel_backend_strategy.dart'; | 30 import '../kernel/kernel_backend_strategy.dart'; |
| 30 import '../kernel/kernel_strategy.dart'; | 31 import '../kernel/kernel_strategy.dart'; |
| 31 import '../native/behavior.dart'; | 32 import '../native/behavior.dart'; |
| 32 import '../ssa/ssa.dart'; | 33 import '../ssa/ssa.dart'; |
| 34 import '../types/types.dart'; |
| 33 import '../universe/class_set.dart'; | 35 import '../universe/class_set.dart'; |
| 34 import '../universe/world_builder.dart'; | 36 import '../universe/world_builder.dart'; |
| 35 import '../util/emptyset.dart'; | 37 import '../util/emptyset.dart'; |
| 36 import '../world.dart'; | 38 import '../world.dart'; |
| 37 import 'closure.dart'; | 39 import 'closure.dart'; |
| 38 import 'elements.dart'; | 40 import 'elements.dart'; |
| 39 import 'locals.dart'; | 41 import 'locals.dart'; |
| 40 | 42 |
| 41 class JsBackendStrategy implements KernelBackendStrategy { | 43 class JsBackendStrategy implements KernelBackendStrategy { |
| 42 final Compiler _compiler; | 44 final Compiler _compiler; |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 closedWorld.elementEnvironment, | 341 closedWorld.elementEnvironment, |
| 340 nativeBasicData, | 342 nativeBasicData, |
| 341 closedWorld, | 343 closedWorld, |
| 342 selectorConstraintsStrategy); | 344 selectorConstraintsStrategy); |
| 343 } | 345 } |
| 344 | 346 |
| 345 @override | 347 @override |
| 346 SourceSpan spanFromSpannable(Spannable spannable, Entity currentElement) { | 348 SourceSpan spanFromSpannable(Spannable spannable, Entity currentElement) { |
| 347 return _elementMap.getSourceSpan(spannable, currentElement); | 349 return _elementMap.getSourceSpan(spannable, currentElement); |
| 348 } | 350 } |
| 351 |
| 352 @override |
| 353 GlobalTypeInferenceResults createTypesInferrerResults( |
| 354 TypesInferrer typesInferrer, ClosedWorld closedWorld) { |
| 355 return new KernelGlobalTypeInferenceResults(typesInferrer, closedWorld); |
| 356 } |
| 357 |
| 358 @override |
| 359 TypesInferrer createTypesInferrer(ClosedWorldRefiner closedWorldRefiner, |
| 360 {bool disableTypeInference: false}) { |
| 361 return new KernelTypeGraphInferrer( |
| 362 _compiler, closedWorldRefiner.closedWorld, closedWorldRefiner, |
| 363 disableTypeInference: disableTypeInference); |
| 364 } |
| 349 } | 365 } |
| 350 | 366 |
| 351 class JsClosedWorld extends ClosedWorldBase with KernelClosedWorldMixin { | 367 class JsClosedWorld extends ClosedWorldBase with KernelClosedWorldMixin { |
| 352 final JsKernelToElementMap elementMap; | 368 final JsKernelToElementMap elementMap; |
| 353 final RuntimeTypesNeed rtiNeed; | 369 final RuntimeTypesNeed rtiNeed; |
| 354 | 370 |
| 355 JsClosedWorld(this.elementMap, | 371 JsClosedWorld(this.elementMap, |
| 356 {ElementEnvironment elementEnvironment, | 372 {ElementEnvironment elementEnvironment, |
| 357 DartTypes dartTypes, | 373 DartTypes dartTypes, |
| 358 CommonElements commonElements, | 374 CommonElements commonElements, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 node.isDirectlyInstantiated = true; | 440 node.isDirectlyInstantiated = true; |
| 425 | 441 |
| 426 return cls; | 442 return cls; |
| 427 } | 443 } |
| 428 | 444 |
| 429 @override | 445 @override |
| 430 void registerClosureClass(ClassEntity cls) { | 446 void registerClosureClass(ClassEntity cls) { |
| 431 throw new UnsupportedError('JsClosedWorld.registerClosureClass'); | 447 throw new UnsupportedError('JsClosedWorld.registerClosureClass'); |
| 432 } | 448 } |
| 433 } | 449 } |
| OLD | NEW |