| 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 { |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 final elementAsts = new Map<Element, ElementAst>(); | 229 final elementAsts = new Map<Element, ElementAst>(); |
| 230 | 230 |
| 231 ElementAst parse(Element element, TreeElements treeElements) { | 231 ElementAst parse(Element element, TreeElements treeElements) { |
| 232 Node node; | 232 Node node; |
| 233 if (!compiler.irBuilder.hasIr(element)) { | 233 if (!compiler.irBuilder.hasIr(element)) { |
| 234 node = element.parseNode(compiler); | 234 node = element.parseNode(compiler); |
| 235 } else { | 235 } else { |
| 236 ir.FunctionDefinition function = compiler.irBuilder.getIr(element); | 236 ir.FunctionDefinition function = compiler.irBuilder.getIr(element); |
| 237 tree.Builder builder = new tree.Builder(compiler); | 237 tree.Builder builder = new tree.Builder(compiler); |
| 238 tree.FunctionDefinition definition = builder.build(function); | 238 tree.FunctionDefinition definition = builder.build(function); |
| 239 compiler.tracer.traceCompilation(element.name, null, compiler); |
| 239 compiler.tracer.traceGraph('Tree builder', definition); | 240 compiler.tracer.traceGraph('Tree builder', definition); |
| 240 treeElements = new TreeElementMapping(element); | 241 treeElements = new TreeElementMapping(element); |
| 241 tree.Unnamer unnamer = new tree.Unnamer(); | 242 tree.Unnamer unnamer = new tree.Unnamer(); |
| 242 unnamer.unname(definition); | 243 unnamer.unname(definition); |
| 243 compiler.tracer.traceGraph('Unnamer', definition); | 244 compiler.tracer.traceGraph('Unnamer', definition); |
| 244 tree.Emitter emitter = new tree.Emitter(); | 245 tree.Emitter emitter = new tree.Emitter(); |
| 245 node = emitter.emit(element, treeElements, definition); | 246 node = emitter.emit(element, treeElements, definition); |
| 246 } | 247 } |
| 247 return new ElementAst(node, treeElements); | 248 return new ElementAst(node, treeElements); |
| 248 } | 249 } |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 } | 639 } |
| 639 | 640 |
| 640 Constant compileMetadata(MetadataAnnotation metadata, | 641 Constant compileMetadata(MetadataAnnotation metadata, |
| 641 Node node, | 642 Node node, |
| 642 TreeElements elements) { | 643 TreeElements elements) { |
| 643 return measure(() { | 644 return measure(() { |
| 644 return constantCompiler.compileMetadata(metadata, node, elements); | 645 return constantCompiler.compileMetadata(metadata, node, elements); |
| 645 }); | 646 }); |
| 646 } | 647 } |
| 647 } | 648 } |
| OLD | NEW |