| 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 | 8 import '../compiler.dart' show |
| 9 Compiler; | 9 Compiler; |
| 10 import '../constants/values.dart' show | 10 import '../constants/values.dart' show |
| 11 ConstantValue; | 11 ConstantValue; |
| 12 import '../dart_types.dart' show | 12 import '../dart_types.dart' show |
| 13 DartType, | 13 DartType, |
| 14 InterfaceType; | 14 InterfaceType; |
| 15 import '../elements/elements.dart' show | 15 import '../elements/elements.dart' show |
| 16 AstElement, | 16 AstElement, |
| 17 ClassElement, | 17 ClassElement, |
| 18 Element, | 18 Element, |
| 19 FunctionElement, | 19 FunctionElement, |
| 20 LocalFunctionElement; | 20 LocalFunctionElement; |
| 21 import '../enqueue.dart' show | 21 import '../enqueue.dart' show |
| 22 CodegenEnqueuer; | 22 CodegenEnqueuer; |
| 23 import '../resolution/tree_elements.dart' show | 23 import '../resolution/tree_elements.dart' show |
| 24 TreeElements; | 24 TreeElements; |
| 25 import '../universe/use.dart' show | 25 import '../universe/use.dart' show |
| 26 DynamicUse, | 26 DynamicUse, |
| 27 StaticUse; | 27 StaticUse, |
| 28 TypeUse; |
| 28 import '../universe/world_impact.dart' show | 29 import '../universe/world_impact.dart' show |
| 29 WorldImpact, | 30 WorldImpact, |
| 30 WorldImpactBuilder; | 31 WorldImpactBuilder; |
| 31 import '../util/util.dart' show | 32 import '../util/util.dart' show |
| 32 Pair, | 33 Pair, |
| 33 Setlet; | 34 Setlet; |
| 34 import 'registry.dart' show | 35 import 'registry.dart' show |
| 35 Registry, | 36 Registry, |
| 36 EagerRegistry; | 37 EagerRegistry; |
| 37 import 'work.dart' show | 38 import 'work.dart' show |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 183 |
| 183 void registerStaticUse(StaticUse staticUse) { | 184 void registerStaticUse(StaticUse staticUse) { |
| 184 worldImpact.registerStaticUse(staticUse); | 185 worldImpact.registerStaticUse(staticUse); |
| 185 } | 186 } |
| 186 | 187 |
| 187 void registerDynamicUse(DynamicUse dynamicUse) { | 188 void registerDynamicUse(DynamicUse dynamicUse) { |
| 188 worldImpact.registerDynamicUse(dynamicUse); | 189 worldImpact.registerDynamicUse(dynamicUse); |
| 189 compiler.dumpInfoTask.elementUsesSelector(currentElement, dynamicUse); | 190 compiler.dumpInfoTask.elementUsesSelector(currentElement, dynamicUse); |
| 190 } | 191 } |
| 191 | 192 |
| 192 void registerIsCheck(DartType type) { | 193 void registerTypeUse(TypeUse typeUse) { |
| 193 worldImpact.registerIsCheck(type); | 194 worldImpact.registerTypeUse(typeUse); |
| 194 } | 195 } |
| 195 | 196 |
| 196 void registerCompileTimeConstant(ConstantValue constant) { | 197 void registerCompileTimeConstant(ConstantValue constant) { |
| 197 worldImpact.registerCompileTimeConstant(constant); | 198 worldImpact.registerCompileTimeConstant(constant); |
| 198 } | 199 } |
| 199 | 200 |
| 200 void registerTypeVariableBoundsSubtypeCheck(DartType subtype, | 201 void registerTypeVariableBoundsSubtypeCheck(DartType subtype, |
| 201 DartType supertype) { | 202 DartType supertype) { |
| 202 worldImpact.registerTypeVariableBoundsSubtypeCheck(subtype, supertype); | 203 worldImpact.registerTypeVariableBoundsSubtypeCheck(subtype, supertype); |
| 203 } | 204 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 216 | 217 |
| 217 void registerUseInterceptor() { | 218 void registerUseInterceptor() { |
| 218 worldImpact.registerUseInterceptor(); | 219 worldImpact.registerUseInterceptor(); |
| 219 } | 220 } |
| 220 | 221 |
| 221 void registerTypeConstant(ClassElement element) { | 222 void registerTypeConstant(ClassElement element) { |
| 222 worldImpact.registerTypeConstant(element); | 223 worldImpact.registerTypeConstant(element); |
| 223 } | 224 } |
| 224 | 225 |
| 225 void registerInstantiation(InterfaceType type) { | 226 void registerInstantiation(InterfaceType type) { |
| 226 worldImpact.registerInstantiatedType(type); | 227 registerTypeUse(new TypeUse.instantiation(type)); |
| 227 } | 228 } |
| 228 | 229 |
| 229 void registerAsyncMarker(FunctionElement element) { | 230 void registerAsyncMarker(FunctionElement element) { |
| 230 worldImpact.registerAsyncMarker(element); | 231 worldImpact.registerAsyncMarker(element); |
| 231 } | 232 } |
| 232 } | 233 } |
| 233 | 234 |
| 234 /// [WorkItem] used exclusively by the [CodegenEnqueuer]. | 235 /// [WorkItem] used exclusively by the [CodegenEnqueuer]. |
| 235 class CodegenWorkItem extends WorkItem { | 236 class CodegenWorkItem extends WorkItem { |
| 236 CodegenRegistry registry; | 237 CodegenRegistry registry; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 258 | 259 |
| 259 TreeElements get resolutionTree => element.resolvedAst.elements; | 260 TreeElements get resolutionTree => element.resolvedAst.elements; |
| 260 | 261 |
| 261 WorldImpact run(Compiler compiler, CodegenEnqueuer world) { | 262 WorldImpact run(Compiler compiler, CodegenEnqueuer world) { |
| 262 if (world.isProcessed(element)) return const WorldImpact(); | 263 if (world.isProcessed(element)) return const WorldImpact(); |
| 263 | 264 |
| 264 registry = new CodegenRegistry(compiler, element); | 265 registry = new CodegenRegistry(compiler, element); |
| 265 return compiler.codegen(this, world); | 266 return compiler.codegen(this, world); |
| 266 } | 267 } |
| 267 } | 268 } |
| OLD | NEW |