| 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 final Compiler compiler; | 10 final Compiler compiler; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 internalError(String reason) { | 89 internalError(String reason) { |
| 90 throw new CompilerCancelledException('internal error: $reason'); | 90 throw new CompilerCancelledException('internal error: $reason'); |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 | 93 |
| 94 class DartBackend extends Backend { | 94 class DartBackend extends Backend { |
| 95 final List<CompilerTask> tasks = const <CompilerTask>[]; | 95 final List<CompilerTask> tasks = const <CompilerTask>[]; |
| 96 | 96 |
| 97 DartBackend(Compiler compiler) : super(compiler); | 97 DartBackend(Compiler compiler) : super(compiler); |
| 98 | 98 |
| 99 void enqueueHelpers(Enqueuer world) { |
| 100 // TODO(antonm): Implement this method, if needed. |
| 101 } |
| 102 |
| 99 String codegen(WorkItem work) { | 103 String codegen(WorkItem work) { |
| 100 // Traverse AST to populate sets of reachable classes and functions. | 104 // Traverse AST to populate sets of reachable classes and functions. |
| 101 log('codegen(${work.element})'); | 105 log('codegen(${work.element})'); |
| 102 FunctionExpression function = work.element.parseNode(compiler); | 106 FunctionExpression function = work.element.parseNode(compiler); |
| 103 function.body.accept(new TraversingVisitor( | 107 function.body.accept(new TraversingVisitor( |
| 104 new ReachabilityVisitor(compiler, work.resolutionTree))); | 108 new ReachabilityVisitor(compiler, work.resolutionTree))); |
| 105 } | 109 } |
| 106 | 110 |
| 107 void processNativeClasses(world, libraries) {} | 111 void processNativeClasses(world, libraries) {} |
| 108 void assembleProgram() { | 112 void assembleProgram() { |
| 109 compiler.assembledCode = ''; | 113 compiler.assembledCode = ''; |
| 110 } | 114 } |
| 111 | 115 |
| 112 log(String message) => compiler.log('[DartBackend] $message'); | 116 log(String message) => compiler.log('[DartBackend] $message'); |
| 113 } | 117 } |
| OLD | NEW |