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 /** | 5 /** |
| 6 * Visitor to gather conservative estimate of functions which | 6 * Visitor to gather conservative estimate of functions which |
| 7 * can be invoked and classes which can be instantiated. | 7 * can be invoked and classes which can be instantiated. |
| 8 */ | 8 */ |
| 9 class ReachabilityVisitor implements Visitor { | 9 class ReachabilityVisitor implements Visitor { |
| 10 visitBlock(Block node) {} | 10 visitBlock(Block node) {} |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 class DartBackend extends Backend { | 84 class DartBackend extends Backend { |
| 85 final ReachabilityVisitor reachabilityVisitor; | 85 final ReachabilityVisitor reachabilityVisitor; |
| 86 final List<CompilerTask> tasks = const <CompilerTask>[]; | 86 final List<CompilerTask> tasks = const <CompilerTask>[]; |
| 87 | 87 |
| 88 DartBackend(Compiler compiler) | 88 DartBackend(Compiler compiler) |
| 89 : reachabilityVisitor = new ReachabilityVisitor(), | 89 : reachabilityVisitor = new ReachabilityVisitor(), |
| 90 super(compiler); | 90 super(compiler); |
| 91 | 91 |
| 92 String codegen(WorkItem work) { | 92 String codegen(WorkItem work) { |
| 93 // Traverse AST to populate sets of reachable classes and functions. | 93 // Traverse AST to populate sets of reachable classes and functions. |
| 94 compiler.log('codegen(${work.element})'); | |
|
Roman
2012/06/06 15:01:25
Did you want to use your new method "log" here?
Sh
Anton Muhin
2012/06/06 15:03:42
Of course I do, thanks a lot for spotting.
It loo
Roman
2012/06/06 15:05:30
Well, that is not good. Comments are also not popu
| |
| 94 FunctionExpression function = work.element.parseNode(compiler); | 95 FunctionExpression function = work.element.parseNode(compiler); |
| 95 function.body.accept(new TraversingVisitor(reachabilityVisitor)); | 96 function.body.accept(new TraversingVisitor(reachabilityVisitor)); |
| 96 } | 97 } |
| 97 | 98 |
| 98 void processNativeClasses(world, libraries) {} | 99 void processNativeClasses(world, libraries) {} |
| 99 void assembleProgram() { | 100 void assembleProgram() { |
| 100 compiler.assembledCode = ''; | 101 compiler.assembledCode = ''; |
| 101 } | 102 } |
| 103 | |
| 104 log(String message) => compiler.log('[DartBackend] $message'); | |
| 102 } | 105 } |
| OLD | NEW |