OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import '../elements/elements.dart'; | 4 import '../elements/elements.dart'; |
5 import '../io/source_information.dart'; | 5 import '../io/source_information.dart'; |
6 import '../js_backend/backend.dart' show JavaScriptBackend; | 6 import '../js_backend/backend.dart' show JavaScriptBackend; |
7 import '../js_backend/element_strategy.dart' show ElementCodegenWorkItem; | 7 import '../js_backend/element_strategy.dart' show ElementCodegenWorkItem; |
8 import '../kernel/kernel.dart'; | 8 import '../kernel/kernel.dart'; |
9 import '../world.dart'; | 9 import '../world.dart'; |
10 import 'builder.dart'; | 10 import 'builder.dart'; |
11 import 'kernel_ast_adapter.dart'; | 11 import 'kernel_ast_adapter.dart'; |
12 import 'nodes.dart'; | 12 import 'nodes.dart'; |
13 import 'builder_kernel.dart'; | 13 import 'builder_kernel.dart'; |
14 | 14 |
15 /// Task for building SSA kernel IR generated from rasta. | 15 /// Task for building SSA kernel IR generated from rasta. |
16 class RastaSsaBuilderTask extends SsaAstBuilderBase { | 16 class RastaSsaBuilderTask extends SsaAstBuilderBase { |
17 final SourceInformationStrategy sourceInformationFactory; | 17 final SourceInformationStrategy sourceInformationFactory; |
18 | 18 |
19 String get name => 'SSA kernel builder'; | 19 String get name => 'SSA kernel builder'; |
20 | 20 |
21 RastaSsaBuilderTask(JavaScriptBackend backend, this.sourceInformationFactory) | 21 RastaSsaBuilderTask(JavaScriptBackend backend, this.sourceInformationFactory) |
22 : super(backend); | 22 : super(backend); |
23 | 23 |
24 HGraph build(ElementCodegenWorkItem work, ClosedWorld closedWorld) { | 24 HGraph build(ElementCodegenWorkItem work, ClosedWorld closedWorld) { |
25 return measure(() { | 25 return measure(() { |
26 if (handleConstantField(work.element, work.registry, closedWorld)) { | 26 if (handleConstantField(work, closedWorld)) { |
27 // No code is generated for `work.element`. | 27 // No code is generated for `work.element`. |
28 return null; | 28 return null; |
29 } | 29 } |
30 MemberElement element = work.element.implementation; | 30 MemberElement element = work.element.implementation; |
31 ResolvedAst resolvedAst = work.resolvedAst; | 31 ResolvedAst resolvedAst = work.resolvedAst; |
32 Kernel kernel = backend.kernelTask.kernel; | 32 Kernel kernel = backend.kernelTask.kernel; |
33 KernelAstAdapter astAdapter = new KernelAstAdapter(kernel, backend, | 33 KernelAstAdapter astAdapter = new KernelAstAdapter(kernel, backend, |
34 work.resolvedAst, kernel.nodeToAst, kernel.nodeToElement); | 34 work.resolvedAst, kernel.nodeToAst, kernel.nodeToElement); |
35 KernelAstTypeInferenceMap typeInferenceMap = | 35 KernelAstTypeInferenceMap typeInferenceMap = |
36 new KernelAstTypeInferenceMap(astAdapter); | 36 new KernelAstTypeInferenceMap(astAdapter); |
(...skipping 27 matching lines...) Expand all Loading... |
64 name = "${element.name}"; | 64 name = "${element.name}"; |
65 } | 65 } |
66 backend.tracer.traceCompilation(name); | 66 backend.tracer.traceCompilation(name); |
67 backend.tracer.traceGraph('builder', graph); | 67 backend.tracer.traceGraph('builder', graph); |
68 } | 68 } |
69 | 69 |
70 return graph; | 70 return graph; |
71 }); | 71 }); |
72 } | 72 } |
73 } | 73 } |
OLD | NEW |