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 2489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2500 JSFrontendAccess(this.compiler); | 2500 JSFrontendAccess(this.compiler); |
2501 | 2501 |
2502 Resolution get resolution => compiler.resolution; | 2502 Resolution get resolution => compiler.resolution; |
2503 | 2503 |
2504 @override | 2504 @override |
2505 ResolutionImpact getResolutionImpact(Element element) { | 2505 ResolutionImpact getResolutionImpact(Element element) { |
2506 return resolution.getResolutionImpact(element); | 2506 return resolution.getResolutionImpact(element); |
2507 } | 2507 } |
2508 | 2508 |
2509 @override | 2509 @override |
2510 bool hasResolvedAst(Element element) { | 2510 bool hasResolvedAst(ExecutableElement element) { |
2511 if (element is SynthesizedCallMethodElementX) { | 2511 if (element is SynthesizedCallMethodElementX) { |
2512 return true; | 2512 return true; |
2513 } else if (element is ConstructorBodyElementX) { | 2513 } else if (element is ConstructorBodyElementX) { |
2514 return true; | 2514 return true; |
2515 } else if (element is FieldElementX) { | 2515 } else if (element is FieldElementX) { |
2516 return true; | 2516 return true; |
| 2517 } else if (element is DeferredLoaderGetterElementX) { |
| 2518 return true; |
2517 } else { | 2519 } else { |
2518 return resolution.hasResolvedAst(element); | 2520 return resolution.hasResolvedAst(element); |
2519 } | 2521 } |
2520 } | 2522 } |
2521 | 2523 |
2522 @override | 2524 @override |
2523 ResolvedAst getResolvedAst(Element element) { | 2525 ResolvedAst getResolvedAst(ExecutableElement element) { |
2524 if (element is SynthesizedCallMethodElementX) { | 2526 if (element is SynthesizedCallMethodElementX) { |
2525 return element.resolvedAst; | 2527 return element.resolvedAst; |
2526 } else if (element is ConstructorBodyElementX) { | 2528 } else if (element is ConstructorBodyElementX) { |
2527 return element.resolvedAst; | 2529 return element.resolvedAst; |
| 2530 } else if (element is DeferredLoaderGetterElementX) { |
| 2531 return element.resolvedAst; |
2528 } else if (element is FieldElementX) { | 2532 } else if (element is FieldElementX) { |
2529 // TODO(johnniwinther): Find a good invariant for resolution of fields. | 2533 // TODO(johnniwinther): Find a good invariant for resolution of fields. |
2530 // Currently some but not all are resolved (maybe it has to do with | 2534 // Currently some but not all are resolved (maybe it has to do with |
2531 // initializers?) | 2535 // initializers?) |
2532 return element.resolvedAst; | 2536 return element.resolvedAst; |
2533 } else { | 2537 } else { |
2534 assert(invariant(element, resolution.hasResolvedAst(element.declaration), | 2538 assert(invariant(element, resolution.hasResolvedAst(element.declaration), |
2535 message: 'No ResolvedAst for $element')); | 2539 message: 'No ResolvedAst for $element')); |
2536 return resolution.getResolvedAst(element.declaration); | 2540 return resolution.getResolvedAst(element.declaration); |
2537 } | 2541 } |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3039 | 3043 |
3040 @override | 3044 @override |
3041 void onImpactUsed(ImpactUseCase impactUse) { | 3045 void onImpactUsed(ImpactUseCase impactUse) { |
3042 if (impactUse == DeferredLoadTask.IMPACT_USE && !supportSerialization) { | 3046 if (impactUse == DeferredLoadTask.IMPACT_USE && !supportSerialization) { |
3043 // TODO(johnniwinther): Allow emptying when serialization has been | 3047 // TODO(johnniwinther): Allow emptying when serialization has been |
3044 // performed. | 3048 // performed. |
3045 resolution.emptyCache(); | 3049 resolution.emptyCache(); |
3046 } | 3050 } |
3047 } | 3051 } |
3048 } | 3052 } |
OLD | NEW |