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 2407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2418 void onQueueClosed() { | 2418 void onQueueClosed() { |
2419 lookupMapAnalysis.onQueueClosed(); | 2419 lookupMapAnalysis.onQueueClosed(); |
2420 jsInteropAnalysis.onQueueClosed(); | 2420 jsInteropAnalysis.onQueueClosed(); |
2421 } | 2421 } |
2422 | 2422 |
2423 void onCodegenStart() { | 2423 void onCodegenStart() { |
2424 lookupMapAnalysis.onCodegenStart(); | 2424 lookupMapAnalysis.onCodegenStart(); |
2425 } | 2425 } |
2426 | 2426 |
2427 void onElementResolved(Element element, TreeElements elements) { | 2427 void onElementResolved(Element element, TreeElements elements) { |
| 2428 if (element.isMalformed) { |
| 2429 // Elements that are marker as malformed during parsing or resolution |
| 2430 // might be registered here. These should just be ignored. |
| 2431 return; |
| 2432 } |
| 2433 |
2428 if ((element.isFunction || element.isConstructor) && | 2434 if ((element.isFunction || element.isConstructor) && |
2429 annotations.noInline(element)) { | 2435 annotations.noInline(element)) { |
2430 inlineCache.markAsNonInlinable(element); | 2436 inlineCache.markAsNonInlinable(element); |
2431 } | 2437 } |
2432 | 2438 |
2433 LibraryElement library = element.library; | 2439 LibraryElement library = element.library; |
2434 if (!library.isPlatformLibrary && !canLibraryUseNative(library)) return; | 2440 if (!library.isPlatformLibrary && !canLibraryUseNative(library)) return; |
2435 bool hasNoInline = false; | 2441 bool hasNoInline = false; |
2436 bool hasForceInline = false; | 2442 bool hasForceInline = false; |
2437 bool hasNoThrows = false; | 2443 bool hasNoThrows = false; |
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3158 } | 3164 } |
3159 } | 3165 } |
3160 | 3166 |
3161 @override | 3167 @override |
3162 void onImpactUsed(ImpactUseCase impactUse) { | 3168 void onImpactUsed(ImpactUseCase impactUse) { |
3163 if (impactUse == DeferredLoadTask.IMPACT_USE) { | 3169 if (impactUse == DeferredLoadTask.IMPACT_USE) { |
3164 resolution.emptyCache(); | 3170 resolution.emptyCache(); |
3165 } | 3171 } |
3166 } | 3172 } |
3167 } | 3173 } |
OLD | NEW |