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

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

Issue 1317053003: Parameterize backend (Closed) Base URL: https://chromium.googlesource.com/external/github.com/dart-lang/sdk.git@_temporary_fletch_patches
Patch Set: Created 5 years, 4 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/apiimpl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compiler.dart
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index f6353790b591b93f3bebbb4a9327f03e6910937b..3594098f6d5574902b789e8cfd0180734c9c5771 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -549,6 +549,8 @@ abstract class Backend {
void registerAsyncMarker(FunctionElement element,
Enqueuer enqueuer,
Registry registry) {}
+
+ EnqueueTask makeEnqueuer() => new EnqueueTask(compiler);
}
/// Backend callbacks function specific to the resolution phase.
@@ -1066,7 +1068,8 @@ abstract class Compiler implements DiagnosticListener {
this.generateCodeWithCompileTimeErrors: false,
this.testMode: false,
api.CompilerOutput outputProvider,
- List<String> strips: const []})
+ List<String> strips: const [],
+ Backend makeBackend(Compiler compiler)})
: this.disableTypeInferenceFlag =
disableTypeInferenceFlag || !emitJavaScript,
this.analyzeOnly =
@@ -1098,7 +1101,9 @@ abstract class Compiler implements DiagnosticListener {
globalDependencies =
new CodegenRegistry(this, new TreeElementMapping(null));
- if (emitJavaScript) {
+ if (makeBackend != null) {
+ backend = makeBackend(this);
+ } else if (emitJavaScript) {
js_backend.JavaScriptBackend jsBackend =
new js_backend.JavaScriptBackend(
this, generateSourceMap: generateSourceMap,
@@ -1127,7 +1132,7 @@ abstract class Compiler implements DiagnosticListener {
constants = backend.constantCompilerTask,
deferredLoadTask = new DeferredLoadTask(this),
mirrorUsageAnalyzerTask = new MirrorUsageAnalyzerTask(this),
- enqueuer = new EnqueueTask(this),
+ enqueuer = backend.makeEnqueuer(),
dumpInfoTask = new DumpInfoTask(this),
reuseLibraryTask = new GenericTask('Reuse library', this),
];
« no previous file with comments | « pkg/compiler/lib/src/apiimpl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698