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 | 4 |
5 import 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
6 | 6 |
7 import '../closure.dart'; | 7 import '../closure.dart'; |
8 import '../common.dart'; | 8 import '../common.dart'; |
9 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; | 9 import '../common/codegen.dart' show CodegenRegistry; |
10 import '../common/names.dart'; | 10 import '../common/names.dart'; |
11 import '../common/tasks.dart' show CompilerTask; | 11 import '../common/tasks.dart' show CompilerTask; |
12 import '../compiler.dart'; | 12 import '../compiler.dart'; |
13 import '../constants/values.dart' | 13 import '../constants/values.dart' |
14 show | 14 show |
15 ConstantValue, | 15 ConstantValue, |
16 InterceptorConstantValue, | 16 InterceptorConstantValue, |
17 StringConstantValue, | 17 StringConstantValue, |
18 TypeConstantValue; | 18 TypeConstantValue; |
19 import '../elements/elements.dart'; | 19 import '../elements/elements.dart'; |
20 import '../elements/entities.dart'; | 20 import '../elements/entities.dart'; |
21 import '../elements/resolution_types.dart'; | 21 import '../elements/resolution_types.dart'; |
22 import '../io/source_information.dart'; | 22 import '../io/source_information.dart'; |
23 import '../js/js.dart' as js; | 23 import '../js/js.dart' as js; |
24 import '../js_backend/backend.dart' show JavaScriptBackend; | 24 import '../js_backend/backend.dart' show JavaScriptBackend; |
| 25 import '../js_backend/element_strategy.dart' show ElementCodegenWorkItem; |
25 import '../kernel/kernel.dart'; | 26 import '../kernel/kernel.dart'; |
26 import '../native/native.dart' as native; | 27 import '../native/native.dart' as native; |
27 import '../resolution/tree_elements.dart'; | 28 import '../resolution/tree_elements.dart'; |
28 import '../tree/nodes.dart' show Node; | 29 import '../tree/nodes.dart' show Node; |
29 import '../types/masks.dart'; | 30 import '../types/masks.dart'; |
30 import '../universe/selector.dart'; | 31 import '../universe/selector.dart'; |
31 import '../universe/side_effects.dart' show SideEffects; | 32 import '../universe/side_effects.dart' show SideEffects; |
32 import '../universe/use.dart' show DynamicUse; | 33 import '../universe/use.dart' show DynamicUse; |
33 import '../world.dart'; | 34 import '../world.dart'; |
34 import 'graph_builder.dart'; | 35 import 'graph_builder.dart'; |
(...skipping 11 matching lines...) Expand all Loading... |
46 class SsaKernelBuilderTask extends CompilerTask { | 47 class SsaKernelBuilderTask extends CompilerTask { |
47 final JavaScriptBackend backend; | 48 final JavaScriptBackend backend; |
48 final SourceInformationStrategy sourceInformationFactory; | 49 final SourceInformationStrategy sourceInformationFactory; |
49 | 50 |
50 String get name => 'SSA kernel builder'; | 51 String get name => 'SSA kernel builder'; |
51 | 52 |
52 SsaKernelBuilderTask(JavaScriptBackend backend, this.sourceInformationFactory) | 53 SsaKernelBuilderTask(JavaScriptBackend backend, this.sourceInformationFactory) |
53 : backend = backend, | 54 : backend = backend, |
54 super(backend.compiler.measurer); | 55 super(backend.compiler.measurer); |
55 | 56 |
56 HGraph build(CodegenWorkItem work, ClosedWorld closedWorld) { | 57 HGraph build(ElementCodegenWorkItem work, ClosedWorld closedWorld) { |
57 return measure(() { | 58 return measure(() { |
58 MemberElement element = work.element.implementation; | 59 MemberElement element = work.element.implementation; |
59 Kernel kernel = backend.kernelTask.kernel; | 60 Kernel kernel = backend.kernelTask.kernel; |
60 KernelSsaBuilder builder = new KernelSsaBuilder( | 61 KernelSsaBuilder builder = new KernelSsaBuilder( |
61 element, | 62 element, |
62 work.resolvedAst, | 63 work.resolvedAst, |
63 backend.compiler, | 64 backend.compiler, |
64 closedWorld, | 65 closedWorld, |
65 work.registry, | 66 work.registry, |
66 sourceInformationFactory, | 67 sourceInformationFactory, |
(...skipping 3346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3413 enterBlock.setBlockFlow( | 3414 enterBlock.setBlockFlow( |
3414 new HTryBlockInformation( | 3415 new HTryBlockInformation( |
3415 kernelBuilder.wrapStatementGraph(bodyGraph), | 3416 kernelBuilder.wrapStatementGraph(bodyGraph), |
3416 exception, | 3417 exception, |
3417 kernelBuilder.wrapStatementGraph(catchGraph), | 3418 kernelBuilder.wrapStatementGraph(catchGraph), |
3418 kernelBuilder.wrapStatementGraph(finallyGraph)), | 3419 kernelBuilder.wrapStatementGraph(finallyGraph)), |
3419 exitBlock); | 3420 exitBlock); |
3420 kernelBuilder.inTryStatement = previouslyInTryStatement; | 3421 kernelBuilder.inTryStatement = previouslyInTryStatement; |
3421 } | 3422 } |
3422 } | 3423 } |
OLD | NEW |