| 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; |
| 22 |
| 21 // TODO(zarah) Maybe change this to a command-line option. | 23 // TODO(zarah) Maybe change this to a command-line option. |
| 22 // Right now, it is set by the tests. | 24 // Right now, it is set by the tests. |
| 23 bool useMirrorHelperLibrary = false; | 25 bool useMirrorHelperLibrary = false; |
| 24 | 26 |
| 25 /// Updated to a [MirrorRenamerImpl] instance if the [useMirrorHelperLibrary] | 27 /// Updated to a [MirrorRenamerImpl] instance if the [useMirrorHelperLibrary] |
| 26 /// field is set and mirror are needed. | 28 /// field is set and mirror are needed. |
| 27 MirrorRenamer mirrorRenamer = const MirrorRenamer(); | 29 MirrorRenamer mirrorRenamer = const MirrorRenamer(); |
| 28 | 30 |
| 29 final DartOutputter outputter; | 31 final DartOutputter outputter; |
| 30 | 32 |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 } | 510 } |
| 509 | 511 |
| 510 // TODO(johnniwinther): Remove this when values are computed from the | 512 // TODO(johnniwinther): Remove this when values are computed from the |
| 511 // expressions. | 513 // expressions. |
| 512 @override | 514 @override |
| 513 void copyConstantValues(DartConstantTask task) { | 515 void copyConstantValues(DartConstantTask task) { |
| 514 constantCompiler.constantValueMap.addAll( | 516 constantCompiler.constantValueMap.addAll( |
| 515 task.constantCompiler.constantValueMap); | 517 task.constantCompiler.constantValueMap); |
| 516 } | 518 } |
| 517 } | 519 } |
| OLD | NEW |