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 dart_backend; | 5 part of dart_backend; |
6 | 6 |
7 // TODO(ahe): This class is simply wrong. This backend should use | 7 // TODO(ahe): This class is simply wrong. This backend should use |
8 // elements when it can, not AST nodes. Perhaps a [Map<Element, | 8 // elements when it can, not AST nodes. Perhaps a [Map<Element, |
9 // TreeElements>] is what is needed. | 9 // TreeElements>] is what is needed. |
10 class ElementAst { | 10 class ElementAst { |
11 final Node ast; | 11 final Node ast; |
12 final TreeElements treeElements; | 12 final TreeElements treeElements; |
13 | 13 |
14 ElementAst(this.ast, this.treeElements); | 14 ElementAst(this.ast, this.treeElements); |
15 } | 15 } |
16 | 16 |
17 class DartBackend extends Backend { | 17 class DartBackend extends Backend { |
18 final List<CompilerTask> tasks; | 18 final List<CompilerTask> tasks; |
19 final bool stripAsserts; | 19 final bool stripAsserts; |
20 | 20 |
21 bool get supportsReflection => true; | 21 bool get supportsReflection => true; |
22 | 22 |
23 bool get supportsAsyncAwait => true; | |
24 | |
25 // TODO(zarah) Maybe change this to a command-line option. | 23 // TODO(zarah) Maybe change this to a command-line option. |
26 // Right now, it is set by the tests. | 24 // Right now, it is set by the tests. |
27 bool useMirrorHelperLibrary = false; | 25 bool useMirrorHelperLibrary = false; |
28 | 26 |
29 /// Updated to a [MirrorRenamerImpl] instance if the [useMirrorHelperLibrary] | 27 /// Updated to a [MirrorRenamerImpl] instance if the [useMirrorHelperLibrary] |
30 /// field is set and mirror are needed. | 28 /// field is set and mirror are needed. |
31 MirrorRenamer mirrorRenamer = const MirrorRenamer(); | 29 MirrorRenamer mirrorRenamer = const MirrorRenamer(); |
32 | 30 |
33 final DartOutputter outputter; | 31 final DartOutputter outputter; |
34 | 32 |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 void copyConstantValues(DartConstantTask task) { | 537 void copyConstantValues(DartConstantTask task) { |
540 constantCompiler.constantValueMap | 538 constantCompiler.constantValueMap |
541 .addAll(task.constantCompiler.constantValueMap); | 539 .addAll(task.constantCompiler.constantValueMap); |
542 } | 540 } |
543 | 541 |
544 @override | 542 @override |
545 void registerLazyStatic(FieldElement element) { | 543 void registerLazyStatic(FieldElement element) { |
546 // Do nothing. | 544 // Do nothing. |
547 } | 545 } |
548 } | 546 } |
OLD | NEW |