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

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

Issue 2815513007: Remove Compiler and JavaScriptBackend from main_call_stub_generator and runtime_type_generator (Closed)
Patch Set: Add getter Created 3 years, 8 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 | « no previous file | pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/main_call_stub_generator.dart
diff --git a/pkg/compiler/lib/src/js_emitter/main_call_stub_generator.dart b/pkg/compiler/lib/src/js_emitter/main_call_stub_generator.dart
index 18e5482e5860d97d7c0c601448b0395dd01cce92..69a62bcf3484a0de2da44c3a289b16a0eaa590d8 100644
--- a/pkg/compiler/lib/src/js_emitter/main_call_stub_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/main_call_stub_generator.dart
@@ -6,42 +6,44 @@ library dart2js.js_emitter.main_call_stub_generator;
import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames;
+import '../common_elements.dart';
import '../elements/entities.dart';
import '../js/js.dart' as jsAst;
import '../js/js.dart' show js;
-import '../js_backend/js_backend.dart' show JavaScriptBackend;
+import '../js_backend/backend_usage.dart' show BackendUsage;
-import 'code_emitter_task.dart' show CodeEmitterTask;
+import 'code_emitter_task.dart' show Emitter;
class MainCallStubGenerator {
- final JavaScriptBackend backend;
- final CodeEmitterTask emitterTask;
+ final CommonElements _commonElements;
+ final Emitter _emitter;
+ final BackendUsage _backendUsage;
- MainCallStubGenerator(this.backend, this.emitterTask);
+ MainCallStubGenerator(
+ this._commonElements, this._emitter, this._backendUsage);
/// Returns the code equivalent to:
/// `function(args) { $.startRootIsolate(X.main$closure(), args); }`
jsAst.Expression _buildIsolateSetupClosure(
FunctionEntity appMain, FunctionEntity isolateMain) {
- jsAst.Expression mainAccess =
- emitterTask.isolateStaticClosureAccess(appMain);
+ jsAst.Expression mainAccess = _emitter.isolateStaticClosureAccess(appMain);
// Since we pass the closurized version of the main method to
// the isolate method, we must make sure that it exists.
return js('function(a){ #(#, a); }',
- [emitterTask.staticFunctionAccess(isolateMain), mainAccess]);
+ [_emitter.staticFunctionAccess(isolateMain), mainAccess]);
}
jsAst.Statement generateInvokeMain(FunctionEntity main) {
jsAst.Expression mainCallClosure = null;
- if (backend.backendUsage.isIsolateInUse) {
- FunctionEntity isolateMain = backend.commonElements.startRootIsolate;
+ if (_backendUsage.isIsolateInUse) {
+ FunctionEntity isolateMain = _commonElements.startRootIsolate;
mainCallClosure = _buildIsolateSetupClosure(main, isolateMain);
} else {
- mainCallClosure = emitterTask.staticFunctionAccess(main);
+ mainCallClosure = _emitter.staticFunctionAccess(main);
}
jsAst.Expression currentScriptAccess =
- emitterTask.generateEmbeddedGlobalAccess(embeddedNames.CURRENT_SCRIPT);
+ _emitter.generateEmbeddedGlobalAccess(embeddedNames.CURRENT_SCRIPT);
// This code finds the currently executing script by listening to the
// onload event of all script tags and getting the first script which
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698