| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of js_backend; | 5 part of js_backend; |
| 6 | 6 |
| 7 const VERBOSE_OPTIMIZER_HINTS = false; | 7 const VERBOSE_OPTIMIZER_HINTS = false; |
| 8 | 8 |
| 9 class JavaScriptItemCompilationContext extends ItemCompilationContext { | 9 class JavaScriptItemCompilationContext extends ItemCompilationContext { |
| 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); | 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 element == helpers.mapLiteralClass || | 653 element == helpers.mapLiteralClass || |
| 654 element == coreClasses.functionClass || | 654 element == coreClasses.functionClass || |
| 655 element == coreClasses.stringClass) { | 655 element == coreClasses.stringClass) { |
| 656 // TODO(johnniwinther): Avoid these. | 656 // TODO(johnniwinther): Avoid these. |
| 657 return true; | 657 return true; |
| 658 } | 658 } |
| 659 return false; | 659 return false; |
| 660 } | 660 } |
| 661 | 661 |
| 662 bool usedByBackend(Element element) { | 662 bool usedByBackend(Element element) { |
| 663 if (element.isParameter || | 663 if (element.isRegularParameter || |
| 664 element.isInitializingFormal || | 664 element.isInitializingFormal || |
| 665 element.isField) { | 665 element.isField) { |
| 666 if (usedByBackend(element.enclosingElement)) return true; | 666 if (usedByBackend(element.enclosingElement)) return true; |
| 667 } | 667 } |
| 668 return helpersUsed.contains(element.declaration); | 668 return helpersUsed.contains(element.declaration); |
| 669 } | 669 } |
| 670 | 670 |
| 671 bool invokedReflectively(Element element) { | 671 bool invokedReflectively(Element element) { |
| 672 if (element.isParameter || element.isInitializingFormal) { | 672 if (element.isRegularParameter || element.isInitializingFormal) { |
| 673 ParameterElement parameter = element; | 673 ParameterElement parameter = element; |
| 674 if (invokedReflectively(parameter.functionDeclaration)) return true; | 674 if (invokedReflectively(parameter.functionDeclaration)) return true; |
| 675 } | 675 } |
| 676 | 676 |
| 677 if (element.isField) { | 677 if (element.isField) { |
| 678 if (Elements.isStaticOrTopLevel(element) && | 678 if (Elements.isStaticOrTopLevel(element) && |
| 679 (element.isFinal || element.isConst)) { | 679 (element.isFinal || element.isConst)) { |
| 680 return false; | 680 return false; |
| 681 } | 681 } |
| 682 } | 682 } |
| (...skipping 2451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3134 | 3134 |
| 3135 @override | 3135 @override |
| 3136 void onImpactUsed(ImpactUseCase impactUse) { | 3136 void onImpactUsed(ImpactUseCase impactUse) { |
| 3137 if (impactUse == DeferredLoadTask.IMPACT_USE && !supportSerialization) { | 3137 if (impactUse == DeferredLoadTask.IMPACT_USE && !supportSerialization) { |
| 3138 // TODO(johnniwinther): Allow emptying when serialization has been | 3138 // TODO(johnniwinther): Allow emptying when serialization has been |
| 3139 // performed. | 3139 // performed. |
| 3140 resolution.emptyCache(); | 3140 resolution.emptyCache(); |
| 3141 } | 3141 } |
| 3142 } | 3142 } |
| 3143 } | 3143 } |
| OLD | NEW |