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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 EMPTY_VALUE, | 225 EMPTY_VALUE, |
226 TYPEVARIABLE_REFERENCE, // Reference to a type in reflection data. | 226 TYPEVARIABLE_REFERENCE, // Reference to a type in reflection data. |
227 NAME | 227 NAME |
228 } | 228 } |
229 | 229 |
230 class JavaScriptBackend extends Backend { | 230 class JavaScriptBackend extends Backend { |
231 String get patchVersion => emitter.patchVersion; | 231 String get patchVersion => emitter.patchVersion; |
232 | 232 |
233 bool get supportsReflection => emitter.emitter.supportsReflection; | 233 bool get supportsReflection => emitter.emitter.supportsReflection; |
234 | 234 |
235 bool get supportsAsyncAwait => true; | |
236 | |
237 final Annotations annotations; | 235 final Annotations annotations; |
238 | 236 |
239 /// Set of classes that need to be considered for reflection although not | 237 /// Set of classes that need to be considered for reflection although not |
240 /// otherwise visible during resolution. | 238 /// otherwise visible during resolution. |
241 Iterable<ClassElement> get classesRequiredForReflection { | 239 Iterable<ClassElement> get classesRequiredForReflection { |
242 // TODO(herhut): Clean this up when classes needed for rti are tracked. | 240 // TODO(herhut): Clean this up when classes needed for rti are tracked. |
243 return [helpers.closureClass, helpers.jsIndexableClass]; | 241 return [helpers.closureClass, helpers.jsIndexableClass]; |
244 } | 242 } |
245 | 243 |
246 FunctionCompiler functionCompiler; | 244 FunctionCompiler functionCompiler; |
(...skipping 2887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3134 | 3132 |
3135 @override | 3133 @override |
3136 void onImpactUsed(ImpactUseCase impactUse) { | 3134 void onImpactUsed(ImpactUseCase impactUse) { |
3137 if (impactUse == DeferredLoadTask.IMPACT_USE && !supportSerialization) { | 3135 if (impactUse == DeferredLoadTask.IMPACT_USE && !supportSerialization) { |
3138 // TODO(johnniwinther): Allow emptying when serialization has been | 3136 // TODO(johnniwinther): Allow emptying when serialization has been |
3139 // performed. | 3137 // performed. |
3140 resolution.emptyCache(); | 3138 resolution.emptyCache(); |
3141 } | 3139 } |
3142 } | 3140 } |
3143 } | 3141 } |
OLD | NEW |