| 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 CoreClasses; | 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; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 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 |
| 33 BackendImpacts(this.compiler); | 33 BackendImpacts(this.compiler); |
| 34 | 34 |
| 35 JavaScriptBackend get backend => compiler.backend; | 35 JavaScriptBackend get backend => compiler.backend; |
| 36 | 36 |
| 37 BackendHelpers get helpers => backend.helpers; | 37 BackendHelpers get helpers => backend.helpers; |
| 38 | 38 |
| 39 CoreClasses get coreClasses => compiler.coreClasses; | 39 CommonElements get commonElements => compiler.commonElements; |
| 40 | 40 |
| 41 BackendImpact _getRuntimeTypeArgument; | 41 BackendImpact _getRuntimeTypeArgument; |
| 42 | 42 |
| 43 BackendImpact get getRuntimeTypeArgument { | 43 BackendImpact get getRuntimeTypeArgument { |
| 44 if (_getRuntimeTypeArgument == null) { | 44 if (_getRuntimeTypeArgument == null) { |
| 45 _getRuntimeTypeArgument = new BackendImpact(staticUses: [ | 45 _getRuntimeTypeArgument = new BackendImpact(staticUses: [ |
| 46 helpers.getRuntimeTypeArgument, | 46 helpers.getRuntimeTypeArgument, |
| 47 helpers.getTypeArgumentByIndex, | 47 helpers.getTypeArgumentByIndex, |
| 48 ]); | 48 ]); |
| 49 } | 49 } |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 new BackendImpact(staticUses: [helpers.symbolValidatedConstructor]); | 293 new BackendImpact(staticUses: [helpers.symbolValidatedConstructor]); |
| 294 } | 294 } |
| 295 return _symbolConstructor; | 295 return _symbolConstructor; |
| 296 } | 296 } |
| 297 | 297 |
| 298 BackendImpact _constSymbol; | 298 BackendImpact _constSymbol; |
| 299 | 299 |
| 300 BackendImpact get constSymbol { | 300 BackendImpact get constSymbol { |
| 301 if (_constSymbol == null) { | 301 if (_constSymbol == null) { |
| 302 _constSymbol = new BackendImpact( | 302 _constSymbol = new BackendImpact( |
| 303 instantiatedClasses: [coreClasses.symbolClass], | 303 instantiatedClasses: [commonElements.symbolClass], |
| 304 staticUses: [compiler.symbolConstructor.declaration]); | 304 staticUses: [commonElements.symbolConstructor.declaration]); |
| 305 } | 305 } |
| 306 return _constSymbol; | 306 return _constSymbol; |
| 307 } | 307 } |
| 308 | 308 |
| 309 BackendImpact _incDecOperation; | 309 BackendImpact _incDecOperation; |
| 310 | 310 |
| 311 BackendImpact get incDecOperation { | 311 BackendImpact get incDecOperation { |
| 312 if (_incDecOperation == null) { | 312 if (_incDecOperation == null) { |
| 313 _incDecOperation = | 313 _incDecOperation = |
| 314 _needsInt('Needed for the `+ 1` or `- 1` operation of ++/--.'); | 314 _needsInt('Needed for the `+ 1` or `- 1` operation of ++/--.'); |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 helpers.defineProperty | 591 helpers.defineProperty |
| 592 ]); | 592 ]); |
| 593 } | 593 } |
| 594 return _nativeTypeCheck; | 594 return _nativeTypeCheck; |
| 595 } | 595 } |
| 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 = | 601 _closure = new BackendImpact( |
| 602 new BackendImpact(instantiatedClasses: [coreClasses.functionClass]); | 602 instantiatedClasses: [commonElements.functionClass]); |
| 603 } | 603 } |
| 604 return _closure; | 604 return _closure; |
| 605 } | 605 } |
| 606 } | 606 } |
| OLD | NEW |