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; |
11 import '../elements/elements.dart' | 11 import '../elements/elements.dart' |
12 show | 12 show |
13 AstElement, | 13 AstElement, |
14 ClassElement, | 14 ClassElement, |
15 Element, | 15 Element, |
16 FunctionElement, | 16 FunctionElement, |
17 LocalFunctionElement, | 17 LocalFunctionElement, |
18 ResolvedAst; | 18 ResolvedAst; |
19 import '../enqueue.dart' show CodegenEnqueuer; | 19 import '../enqueue.dart' show Enqueuer; |
20 import '../universe/use.dart' show DynamicUse, StaticUse, TypeUse; | 20 import '../universe/use.dart' show DynamicUse, StaticUse, TypeUse; |
21 import '../universe/world_impact.dart' | 21 import '../universe/world_impact.dart' |
22 show WorldImpact, WorldImpactBuilder, WorldImpactVisitor; | 22 show WorldImpact, WorldImpactBuilder, WorldImpactVisitor; |
23 import '../util/util.dart' show Pair, Setlet; | 23 import '../util/util.dart' show Pair, Setlet; |
24 import 'registry.dart' show Registry, EagerRegistry; | 24 import 'registry.dart' show Registry, EagerRegistry; |
25 import 'work.dart' show ItemCompilationContext, WorkItem; | 25 import 'work.dart' show ItemCompilationContext, WorkItem; |
26 | 26 |
27 class CodegenImpact extends WorldImpact { | 27 class CodegenImpact extends WorldImpact { |
28 const CodegenImpact(); | 28 const CodegenImpact(); |
29 | 29 |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 message: "$element has no resolved ast.")); | 237 message: "$element has no resolved ast.")); |
238 ResolvedAst resolvedAst = element.resolvedAst; | 238 ResolvedAst resolvedAst = element.resolvedAst; |
239 return new CodegenWorkItem.internal(resolvedAst, compilationContext); | 239 return new CodegenWorkItem.internal(resolvedAst, compilationContext); |
240 } | 240 } |
241 | 241 |
242 CodegenWorkItem.internal( | 242 CodegenWorkItem.internal( |
243 ResolvedAst resolvedAst, ItemCompilationContext compilationContext) | 243 ResolvedAst resolvedAst, ItemCompilationContext compilationContext) |
244 : this.resolvedAst = resolvedAst, | 244 : this.resolvedAst = resolvedAst, |
245 super(resolvedAst.element, compilationContext); | 245 super(resolvedAst.element, compilationContext); |
246 | 246 |
247 WorldImpact run(Compiler compiler, CodegenEnqueuer world) { | 247 WorldImpact run(Compiler compiler, Enqueuer world) { |
248 if (world.isProcessed(element)) return const WorldImpact(); | 248 if (world.isProcessed(element)) return const WorldImpact(); |
249 | 249 |
250 registry = new CodegenRegistry(compiler, element); | 250 registry = new CodegenRegistry(compiler, element); |
251 return compiler.codegen(this, world); | 251 return compiler.codegen(this, world); |
252 } | 252 } |
253 | 253 |
254 String toString() => 'CodegenWorkItem(${resolvedAst.element})'; | 254 String toString() => 'CodegenWorkItem(${resolvedAst.element})'; |
255 } | 255 } |
OLD | NEW |