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

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

Issue 716823002: Set up a stub pipline for using the new cps-based ir to generate js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move IrEnabled to compiler Created 6 years, 1 month 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/js_backend/js_backend.dart ('k') | pkg/compiler/lib/src/ssa/optimize.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index abd5e29594869b5486b149f52854b583ddcb859b..f63e1e8a3461b99c992d6ec73225bc2c6471f48b 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -4,6 +4,29 @@
part of ssa;
+class SsaFunctionCompiler implements FunctionCompiler {
+ SsaCodeGeneratorTask generator;
+ SsaBuilderTask builder;
+ SsaOptimizerTask optimizer;
+
+ SsaFunctionCompiler(JavaScriptBackend backend)
+ : generator = new SsaCodeGeneratorTask(backend),
+ builder = new SsaBuilderTask(backend),
+ optimizer = new SsaOptimizerTask(backend);
+
+ /// Generates JavaScript code for `work.element`.
+ /// Using the ssa builder, optimizer and codegenerator.
+ js.Fun compile(CodegenWorkItem work) {
+ HGraph graph = builder.build(work);
+ optimizer.optimize(work, graph);
+ return generator.generateCode(work, graph);
+ }
+
+ Iterable<CompilerTask> get tasks {
+ return <CompilerTask>[builder, optimizer, generator];
+ }
+}
+
/// A synthetic local variable only used with the SSA graph.
///
/// For instance used for holding return value of function or the exception of a
« no previous file with comments | « pkg/compiler/lib/src/js_backend/js_backend.dart ('k') | pkg/compiler/lib/src/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698