Index: pkg/compiler/lib/src/kernel/kernel_strategy.dart |
diff --git a/pkg/compiler/lib/src/kernel/kernel_strategy.dart b/pkg/compiler/lib/src/kernel/kernel_strategy.dart |
index 457f89639024eade683d564dc1719f2ffdd22de6..8176c97ea018a119ae6e8aeab64ba95fbf6fcf9a 100644 |
--- a/pkg/compiler/lib/src/kernel/kernel_strategy.dart |
+++ b/pkg/compiler/lib/src/kernel/kernel_strategy.dart |
@@ -31,10 +31,12 @@ import '../js_backend/native_data.dart'; |
import '../js_backend/no_such_method_registry.dart'; |
import '../js_backend/runtime_types.dart'; |
import '../js_emitter/sorter.dart'; |
+import '../kernel/element_map.dart'; |
import '../library_loader.dart'; |
import '../native/resolver.dart'; |
import '../serialization/task.dart'; |
import '../ssa/builder_kernel.dart'; |
+import '../ssa/nodes.dart'; |
import '../ssa/ssa.dart'; |
import '../patch_parser.dart'; |
import '../resolved_uri_translator.dart'; |
@@ -283,7 +285,7 @@ class KernelBackendStrategy implements BackendStrategy { |
@override |
SsaBuilderTask createSsaBuilderTask(JavaScriptBackend backend, |
SourceInformationStrategy sourceInformationStrategy) { |
- return new KernelSsaBuilderTask(backend.compiler.measurer); |
+ return new KernelSsaBuilderTask(backend.compiler); |
} |
} |
@@ -326,3 +328,28 @@ class KernelCodegenWorkItem extends CodegenWorkItem { |
return _backend.codegen(this, _closedWorld); |
} |
} |
+ |
+/// Task for building SSA from kernel IR loaded from .dill. |
+class KernelSsaBuilderTask extends CompilerTask implements SsaBuilderTask { |
+ final Compiler _compiler; |
+ |
+ KernelSsaBuilderTask(this._compiler) : super(_compiler.measurer); |
+ |
+ KernelToElementMap get _elementMap { |
+ KernelFrontEndStrategy frontEndStrategy = _compiler.frontEndStrategy; |
+ return frontEndStrategy.elementMap; |
+ } |
+ |
+ @override |
+ HGraph build(CodegenWorkItem work, ClosedWorld closedWorld) { |
+ KernelSsaBuilder builder = new KernelSsaBuilder( |
+ work.element, |
+ _compiler, |
+ _elementMap, |
+ closedWorld, |
+ work.registry, |
+ const SourceInformationBuilder(), |
+ null); |
+ return builder.build(); |
+ } |
+} |