Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: pkg/compiler/lib/src/ssa/ssa.dart

Issue 2896853002: Create SsaBuilderTask stub for KernelBackendStrategy (Closed)
Patch Set: Rebased Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | tests/compiler/dart2js/exit_code_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | tests/compiler/dart2js/exit_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698