Chromium Code Reviews| 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 '../compiler.dart' show Compiler; | 7 import '../compiler.dart' show Compiler; |
| 8 import '../core_types.dart' show CommonElements; | 8 import '../core_types.dart' show CommonElements; |
| 9 import '../dart_types.dart' show InterfaceType; | 9 import '../dart_types.dart' show InterfaceType; |
| 10 import '../elements/elements.dart' show ClassElement, Element; | 10 import '../elements/elements.dart' show ClassElement, Element; |
| 11 import 'backend_helpers.dart'; | 11 import 'backend_helpers.dart'; |
| 12 import 'constant_system_javascript.dart'; | 12 import 'constant_system_javascript.dart'; |
| 13 import 'js_backend.dart'; | 13 import 'js_backend.dart'; |
| 14 | 14 |
| 15 /// A set of JavaScript backend dependencies. | 15 /// A set of JavaScript backend dependencies. |
| 16 class BackendImpact { | 16 class BackendImpact { |
| 17 final List<Element> staticUses; | 17 final List<Element> staticUses; |
| 18 final List<InterfaceType> instantiatedTypes; | 18 final List<InterfaceType> instantiatedTypes; |
| 19 final List<ClassElement> instantiatedClasses; | 19 final List<ClassElement> instantiatedClasses; |
| 20 final List<BackendImpact> otherImpacts; | 20 final List<BackendImpact> otherImpacts; |
| 21 | 21 |
| 22 BackendImpact( | 22 const BackendImpact( |
| 23 {this.staticUses: const <Element>[], | 23 {this.staticUses: const <Element>[], |
| 24 this.instantiatedTypes: const <InterfaceType>[], | 24 this.instantiatedTypes: const <InterfaceType>[], |
| 25 this.instantiatedClasses: const <ClassElement>[], | 25 this.instantiatedClasses: const <ClassElement>[], |
| 26 this.otherImpacts: const <BackendImpact>[]}); | 26 this.otherImpacts: const <BackendImpact>[]}); |
| 27 } | 27 } |
| 28 | 28 |
| 29 /// The JavaScript backend dependencies for various features. | 29 /// The JavaScript backend dependencies for various features. |
| 30 class BackendImpacts { | 30 class BackendImpacts { |
| 31 final Compiler compiler; | 31 final Compiler compiler; |
| 32 | 32 |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 596 | 596 |
| 597 BackendImpact _closure; | 597 BackendImpact _closure; |
| 598 | 598 |
| 599 BackendImpact get closure { | 599 BackendImpact get closure { |
| 600 if (_closure == null) { | 600 if (_closure == null) { |
| 601 _closure = new BackendImpact( | 601 _closure = new BackendImpact( |
| 602 instantiatedClasses: [commonElements.functionClass]); | 602 instantiatedClasses: [commonElements.functionClass]); |
| 603 } | 603 } |
| 604 return _closure; | 604 return _closure; |
| 605 } | 605 } |
| 606 | |
| 607 BackendImpact _interceptorUse; | |
| 608 | |
| 609 BackendImpact get interceptorUse { | |
|
Harry Terkelsen
2016/09/19 21:17:52
consider doing:
_interceptorUse ??= ...
instead
| |
| 610 if (_interceptorUse == null) { | |
| 611 _interceptorUse = new BackendImpact(staticUses: [ | |
| 612 helpers.getNativeInterceptorMethod | |
| 613 ], instantiatedClasses: [ | |
| 614 helpers.jsJavaScriptObjectClass, | |
| 615 helpers.jsPlainJavaScriptObjectClass, | |
| 616 helpers.jsJavaScriptFunctionClass | |
| 617 ]); | |
| 618 } | |
| 619 return _interceptorUse; | |
| 620 } | |
| 606 } | 621 } |
| OLD | NEW |