Index: pkg/compiler/lib/src/ssa/ssa.dart |
diff --git a/pkg/compiler/lib/src/ssa/ssa.dart b/pkg/compiler/lib/src/ssa/ssa.dart |
index b1bbb484bf3c4c05d920abf1a2ea158f152a27d7..ddaf2ee7ed45cbe135858a4ebc28acdce8650374 100644 |
--- a/pkg/compiler/lib/src/ssa/ssa.dart |
+++ b/pkg/compiler/lib/src/ssa/ssa.dart |
@@ -5,16 +5,14 @@ |
library ssa; |
import '../common/codegen.dart' show CodegenWorkItem; |
-import '../common/tasks.dart' show CompilerTask; |
-import '../elements/elements.dart' show Element, FunctionElement; |
+import '../common/tasks.dart' show CompilerTask, Measurer; |
+import '../elements/elements.dart' show MethodElement; |
+import '../elements/entities.dart' show MemberEntity; |
import '../io/source_information.dart'; |
import '../js/js.dart' as js; |
import '../js_backend/backend.dart' show JavaScriptBackend, FunctionCompiler; |
-import '../js_backend/element_strategy.dart' show ElementCodegenWorkItem; |
import '../world.dart' show ClosedWorld; |
-import 'builder.dart'; |
-import 'builder_kernel.dart'; |
import 'codegen.dart'; |
import 'nodes.dart'; |
import 'optimize.dart'; |
@@ -25,24 +23,23 @@ class SsaFunctionCompiler implements FunctionCompiler { |
final SsaOptimizerTask optimizer; |
final JavaScriptBackend backend; |
- SsaFunctionCompiler(JavaScriptBackend backend, |
- SourceInformationStrategy sourceInformationFactory, bool useKernel) |
+ SsaFunctionCompiler(JavaScriptBackend backend, Measurer measurer, |
+ SourceInformationStrategy sourceInformationFactory) |
: generator = new SsaCodeGeneratorTask(backend, sourceInformationFactory), |
- _builder = useKernel |
- ? new SsaKernelBuilderTask(backend, sourceInformationFactory) |
- : new SsaAstBuilderTask(backend, sourceInformationFactory), |
+ _builder = backend.compiler.backendStrategy |
+ .createSsaBuilderTask(backend, sourceInformationFactory), |
optimizer = new SsaOptimizerTask(backend), |
backend = backend; |
/// Generates JavaScript code for `work.element`. |
/// Using the ssa builder, optimizer and codegenerator. |
- js.Fun compile(ElementCodegenWorkItem work, ClosedWorld closedWorld) { |
+ js.Fun compile(CodegenWorkItem work, ClosedWorld closedWorld) { |
HGraph graph = _builder.build(work, closedWorld); |
if (graph == null) return null; |
optimizer.optimize(work, graph, closedWorld); |
- Element element = work.element; |
+ MemberEntity element = work.element; |
js.Expression result = generator.generateCode(work, graph, closedWorld); |
- if (element is FunctionElement) { |
+ if (element is MethodElement) { |
// TODO(sigmund): replace by kernel transformer when `useKernel` is true. |
result = backend.rewriteAsync(element, result); |
} |