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

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

Issue 2937203002: Add J-elements (Closed)
Patch Set: Updated cf. comments Created 3 years, 6 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
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 ba197d12af9873c12ad2612799e0473dfeb92b79..947ea6ef29c496b9aea228e38f2e4384c925c49b 100644
--- a/pkg/compiler/lib/src/ssa/ssa.dart
+++ b/pkg/compiler/lib/src/ssa/ssa.dart
@@ -26,11 +26,14 @@ class SsaFunctionCompiler implements FunctionCompiler {
SsaFunctionCompiler(JavaScriptBackend backend, Measurer measurer,
SourceInformationStrategy sourceInformationFactory)
: generator = new SsaCodeGeneratorTask(backend, sourceInformationFactory),
- _builder = backend.compiler.backendStrategy
- .createSsaBuilderTask(backend, sourceInformationFactory),
+ _builder = new SsaBuilderTask(backend, sourceInformationFactory),
optimizer = new SsaOptimizerTask(backend),
backend = backend;
+ void onCodegenStart() {
+ _builder.onCodegenStart();
+ }
+
/// Generates JavaScript code for `work.element`.
/// Using the ssa builder, optimizer and codegenerator.
js.Fun compile(CodegenWorkItem work, ClosedWorld closedWorld) {
@@ -52,8 +55,28 @@ class SsaFunctionCompiler implements FunctionCompiler {
}
}
-abstract class SsaBuilderTask implements CompilerTask {
+abstract class SsaBuilder {
/// Creates the [HGraph] for [work] or returns `null` if no code is needed
/// for [work].
HGraph build(CodegenWorkItem work, ClosedWorld closedWorld);
}
+
+class SsaBuilderTask extends CompilerTask {
+ final JavaScriptBackend _backend;
+ final SourceInformationStrategy _sourceInformationFactory;
+ SsaBuilder _builder;
+
+ SsaBuilderTask(this._backend, this._sourceInformationFactory)
+ : super(_backend.compiler.measurer);
+
+ void onCodegenStart() {
+ _builder = _backend.compiler.backendStrategy
+ .createSsaBuilder(this, _backend, _sourceInformationFactory);
+ }
+
+ /// Creates the [HGraph] for [work] or returns `null` if no code is needed
+ /// for [work].
+ HGraph build(CodegenWorkItem work, ClosedWorld closedWorld) {
+ return _builder.build(work, closedWorld);
+ }
+}
« no previous file with comments | « pkg/compiler/lib/src/ssa/rasta_ssa_builder_task.dart ('k') | tests/compiler/dart2js/js_model/model_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698