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; |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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: [commonElements.symbolClass], | 303 instantiatedClasses: [commonElements.symbolClass], |
304 staticUses: [commonElements.symbolConstructor.declaration]); | 304 staticUses: [commonElements.symbolConstructor.declaration]); |
305 } | 305 } |
306 return _constSymbol; | 306 return _constSymbol; |
307 } | 307 } |
308 | 308 |
309 BackendImpact _incDecOperation; | |
310 | |
311 BackendImpact get incDecOperation { | |
312 if (_incDecOperation == null) { | |
313 _incDecOperation = | |
314 _needsInt('Needed for the `+ 1` or `- 1` operation of ++/--.'); | |
315 } | |
316 return _incDecOperation; | |
317 } | |
318 | |
319 /// Helper for registering that `int` is needed. | 309 /// Helper for registering that `int` is needed. |
320 BackendImpact _needsInt(String reason) { | 310 BackendImpact _needsInt(String reason) { |
321 // TODO(johnniwinther): Register [reason] for use in dump-info. | 311 // TODO(johnniwinther): Register [reason] for use in dump-info. |
322 return intValues; | 312 return intValues; |
323 } | 313 } |
324 | 314 |
325 /// Helper for registering that `List` is needed. | 315 /// Helper for registering that `List` is needed. |
326 BackendImpact _needsList(String reason) { | 316 BackendImpact _needsList(String reason) { |
327 // TODO(johnniwinther): Register [reason] for use in dump-info. | 317 // TODO(johnniwinther): Register [reason] for use in dump-info. |
328 return listValues; | 318 return listValues; |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 BackendImpact _closure; | 587 BackendImpact _closure; |
598 | 588 |
599 BackendImpact get closure { | 589 BackendImpact get closure { |
600 if (_closure == null) { | 590 if (_closure == null) { |
601 _closure = new BackendImpact( | 591 _closure = new BackendImpact( |
602 instantiatedClasses: [commonElements.functionClass]); | 592 instantiatedClasses: [commonElements.functionClass]); |
603 } | 593 } |
604 return _closure; | 594 return _closure; |
605 } | 595 } |
606 } | 596 } |
OLD | NEW |