OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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_helpers.impact; | 5 library dart2js.js_helpers.impact; |
6 | 6 |
| 7 import '../common/names.dart'; |
7 import '../compiler.dart' show Compiler; | 8 import '../compiler.dart' show Compiler; |
8 import '../core_types.dart' show CommonElements; | 9 import '../core_types.dart' show CommonElements; |
9 import '../dart_types.dart' show InterfaceType; | 10 import '../dart_types.dart' show InterfaceType; |
10 import '../elements/elements.dart' show ClassElement, Element; | 11 import '../elements/elements.dart' show ClassElement, Element; |
| 12 import '../universe/selector.dart'; |
11 import 'backend_helpers.dart'; | 13 import 'backend_helpers.dart'; |
12 import 'constant_system_javascript.dart'; | 14 import 'constant_system_javascript.dart'; |
13 import 'js_backend.dart'; | 15 import 'js_backend.dart'; |
14 | 16 |
15 /// A set of JavaScript backend dependencies. | 17 /// A set of JavaScript backend dependencies. |
16 class BackendImpact { | 18 class BackendImpact { |
17 final List<Element> staticUses; | 19 final List<Element> staticUses; |
| 20 final List<Selector> dynamicUses; |
18 final List<InterfaceType> instantiatedTypes; | 21 final List<InterfaceType> instantiatedTypes; |
19 final List<ClassElement> instantiatedClasses; | 22 final List<ClassElement> instantiatedClasses; |
20 final List<BackendImpact> otherImpacts; | 23 final List<BackendImpact> otherImpacts; |
21 | 24 |
22 BackendImpact( | 25 BackendImpact( |
23 {this.staticUses: const <Element>[], | 26 {this.staticUses: const <Element>[], |
| 27 this.dynamicUses: const <Selector>[], |
24 this.instantiatedTypes: const <InterfaceType>[], | 28 this.instantiatedTypes: const <InterfaceType>[], |
25 this.instantiatedClasses: const <ClassElement>[], | 29 this.instantiatedClasses: const <ClassElement>[], |
26 this.otherImpacts: const <BackendImpact>[]}); | 30 this.otherImpacts: const <BackendImpact>[]}); |
27 } | 31 } |
28 | 32 |
29 /// The JavaScript backend dependencies for various features. | 33 /// The JavaScript backend dependencies for various features. |
30 class BackendImpacts { | 34 class BackendImpacts { |
31 final Compiler compiler; | 35 final Compiler compiler; |
32 | 36 |
33 BackendImpacts(this.compiler); | 37 BackendImpacts(this.compiler); |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 new BackendImpact(staticUses: [helpers.streamIteratorConstructor]); | 356 new BackendImpact(staticUses: [helpers.streamIteratorConstructor]); |
353 } | 357 } |
354 return _asyncForIn; | 358 return _asyncForIn; |
355 } | 359 } |
356 | 360 |
357 BackendImpact _stringInterpolation; | 361 BackendImpact _stringInterpolation; |
358 | 362 |
359 BackendImpact get stringInterpolation { | 363 BackendImpact get stringInterpolation { |
360 if (_stringInterpolation == null) { | 364 if (_stringInterpolation == null) { |
361 _stringInterpolation = new BackendImpact( | 365 _stringInterpolation = new BackendImpact( |
| 366 dynamicUses: [Selectors.toString_], |
362 staticUses: [helpers.stringInterpolationHelper], | 367 staticUses: [helpers.stringInterpolationHelper], |
363 otherImpacts: [_needsString('Strings are created.')]); | 368 otherImpacts: [_needsString('Strings are created.')]); |
364 } | 369 } |
365 return _stringInterpolation; | 370 return _stringInterpolation; |
366 } | 371 } |
367 | 372 |
368 BackendImpact _stringJuxtaposition; | 373 BackendImpact _stringJuxtaposition; |
369 | 374 |
370 BackendImpact get stringJuxtaposition { | 375 BackendImpact get stringJuxtaposition { |
371 if (_stringJuxtaposition == null) { | 376 if (_stringJuxtaposition == null) { |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 BackendImpact _closure; | 592 BackendImpact _closure; |
588 | 593 |
589 BackendImpact get closure { | 594 BackendImpact get closure { |
590 if (_closure == null) { | 595 if (_closure == null) { |
591 _closure = new BackendImpact( | 596 _closure = new BackendImpact( |
592 instantiatedClasses: [commonElements.functionClass]); | 597 instantiatedClasses: [commonElements.functionClass]); |
593 } | 598 } |
594 return _closure; | 599 return _closure; |
595 } | 600 } |
596 } | 601 } |
OLD | NEW |