| 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 '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../compiler.dart' show Compiler; | 8 import '../compiler.dart' show Compiler; |
| 9 import '../constants/values.dart' show ConstantValue; | 9 import '../constants/values.dart' show ConstantValue; |
| 10 import '../dart_types.dart' show DartType, InterfaceType; | 10 import '../dart_types.dart' show DartType, InterfaceType; |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 152 |
| 153 CodegenRegistry(Compiler compiler, AstElement currentElement) | 153 CodegenRegistry(Compiler compiler, AstElement currentElement) |
| 154 : this.compiler = compiler, | 154 : this.compiler = compiler, |
| 155 this.currentElement = currentElement, | 155 this.currentElement = currentElement, |
| 156 this.worldImpact = new _CodegenImpact(); | 156 this.worldImpact = new _CodegenImpact(); |
| 157 | 157 |
| 158 bool get isForResolution => false; | 158 bool get isForResolution => false; |
| 159 | 159 |
| 160 String toString() => 'CodegenRegistry for $currentElement'; | 160 String toString() => 'CodegenRegistry for $currentElement'; |
| 161 | 161 |
| 162 /// Add the uses in [impact] to the impact of this registry. |
| 163 void addImpact(WorldImpact impact) { |
| 164 worldImpact.addImpact(impact); |
| 165 } |
| 166 |
| 162 @deprecated | 167 @deprecated |
| 163 void registerInstantiatedClass(ClassElement element) { | 168 void registerInstantiatedClass(ClassElement element) { |
| 164 registerInstantiation(element.rawType); | 169 registerInstantiation(element.rawType); |
| 165 } | 170 } |
| 166 | 171 |
| 167 void registerStaticUse(StaticUse staticUse) { | 172 void registerStaticUse(StaticUse staticUse) { |
| 168 worldImpact.registerStaticUse(staticUse); | 173 worldImpact.registerStaticUse(staticUse); |
| 169 } | 174 } |
| 170 | 175 |
| 171 void registerDynamicUse(DynamicUse dynamicUse) { | 176 void registerDynamicUse(DynamicUse dynamicUse) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 | 241 |
| 237 WorldImpact run(Compiler compiler, Enqueuer world) { | 242 WorldImpact run(Compiler compiler, Enqueuer world) { |
| 238 if (world.isProcessed(element)) return const WorldImpact(); | 243 if (world.isProcessed(element)) return const WorldImpact(); |
| 239 | 244 |
| 240 registry = new CodegenRegistry(compiler, element); | 245 registry = new CodegenRegistry(compiler, element); |
| 241 return compiler.codegen(this, world); | 246 return compiler.codegen(this, world); |
| 242 } | 247 } |
| 243 | 248 |
| 244 String toString() => 'CodegenWorkItem(${resolvedAst.element})'; | 249 String toString() => 'CodegenWorkItem(${resolvedAst.element})'; |
| 245 } | 250 } |
| OLD | NEW |