Chromium Code Reviews| 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 /// Use only from the old dart backend. Use [ElementAst.internal] instead. | |
| 15 @deprecated | |
| 14 ElementAst(AstElement element) | 16 ElementAst(AstElement element) |
| 15 : this.internal(element.resolvedAst.node, element.resolvedAst.elements); | 17 : this.internal(element.resolvedAst.node, element.resolvedAst.elements); |
| 16 | 18 |
| 17 ElementAst.internal(this.ast, this.treeElements); | 19 ElementAst.internal(this.ast, this.treeElements); |
|
sigurdm
2014/12/08 13:02:29
Maybe we can find a better name than internal if t
Johnni Winther
2014/12/10 08:47:53
Remove the no-name constructor and made this the n
| |
| 18 } | 20 } |
| 19 | 21 |
| 20 class DartBackend extends Backend { | 22 class DartBackend extends Backend { |
| 21 final List<CompilerTask> tasks; | 23 final List<CompilerTask> tasks; |
| 22 final bool stripAsserts; | 24 final bool stripAsserts; |
| 23 | 25 |
| 24 // TODO(zarah) Maybe change this to a command-line option. | 26 // TODO(zarah) Maybe change this to a command-line option. |
| 25 // Right now, it is set by the tests. | 27 // Right now, it is set by the tests. |
| 26 bool useMirrorHelperLibrary = false; | 28 bool useMirrorHelperLibrary = false; |
| 27 | 29 |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 518 } | 520 } |
| 519 | 521 |
| 520 ConstantExpression compileMetadata(MetadataAnnotation metadata, | 522 ConstantExpression compileMetadata(MetadataAnnotation metadata, |
| 521 Node node, | 523 Node node, |
| 522 TreeElements elements) { | 524 TreeElements elements) { |
| 523 return measure(() { | 525 return measure(() { |
| 524 return constantCompiler.compileMetadata(metadata, node, elements); | 526 return constantCompiler.compileMetadata(metadata, node, elements); |
| 525 }); | 527 }); |
| 526 } | 528 } |
| 527 } | 529 } |
| OLD | NEW |