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 library dart2js.common.codegen; | 5 library dart2js.common.codegen; |
6 | 6 |
7 import '../compiler.dart' show | 7 import '../compiler.dart' show |
8 Compiler; | 8 Compiler; |
9 import '../constants/values.dart' show | 9 import '../constants/values.dart' show |
10 ConstantValue; | 10 ConstantValue; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 class CodegenRegistry extends Registry { | 42 class CodegenRegistry extends Registry { |
43 final Compiler compiler; | 43 final Compiler compiler; |
44 final TreeElements treeElements; | 44 final TreeElements treeElements; |
45 | 45 |
46 CodegenRegistry(this.compiler, this.treeElements); | 46 CodegenRegistry(this.compiler, this.treeElements); |
47 | 47 |
48 bool get isForResolution => false; | 48 bool get isForResolution => false; |
49 | 49 |
50 Element get currentElement => treeElements.analyzedElement; | 50 Element get currentElement => treeElements.analyzedElement; |
51 | 51 |
| 52 String toString() => 'CodegenRegistry for $currentElement'; |
| 53 |
52 // TODO(johnniwinther): Remove this getter when [Registry] creates a | 54 // TODO(johnniwinther): Remove this getter when [Registry] creates a |
53 // dependency node. | 55 // dependency node. |
54 Setlet<Element> get otherDependencies => treeElements.otherDependencies; | 56 Setlet<Element> get otherDependencies => treeElements.otherDependencies; |
55 | 57 |
56 CodegenEnqueuer get world => compiler.enqueuer.codegen; | 58 CodegenEnqueuer get world => compiler.enqueuer.codegen; |
57 JavaScriptBackend get backend => compiler.backend; | 59 JavaScriptBackend get backend => compiler.backend; |
58 | 60 |
59 void registerDependency(Element element) { | 61 void registerDependency(Element element) { |
60 treeElements.registerDependency(element); | 62 treeElements.registerDependency(element); |
61 } | 63 } |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 199 |
198 TreeElements get resolutionTree => element.resolvedAst.elements; | 200 TreeElements get resolutionTree => element.resolvedAst.elements; |
199 | 201 |
200 WorldImpact run(Compiler compiler, CodegenEnqueuer world) { | 202 WorldImpact run(Compiler compiler, CodegenEnqueuer world) { |
201 if (world.isProcessed(element)) return const WorldImpact(); | 203 if (world.isProcessed(element)) return const WorldImpact(); |
202 | 204 |
203 registry = new CodegenRegistry(compiler, resolutionTree); | 205 registry = new CodegenRegistry(compiler, resolutionTree); |
204 return compiler.codegen(this, world); | 206 return compiler.codegen(this, world); |
205 } | 207 } |
206 } | 208 } |
OLD | NEW |