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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/main_call_stub_generator.dart

Issue 1803303002: Move all flags to CompilerOptions (first step to stop passing the compiler to (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 class MainCallStubGenerator { 7 class MainCallStubGenerator {
8 final Compiler compiler; 8 final Compiler compiler;
9 final JavaScriptBackend backend; 9 final JavaScriptBackend backend;
10 final CodeEmitterTask emitterTask; 10 final CodeEmitterTask emitterTask;
(...skipping 14 matching lines...) Expand all
25 [emitterTask.staticFunctionAccess(isolateMain), mainAccess]); 25 [emitterTask.staticFunctionAccess(isolateMain), mainAccess]);
26 } 26 }
27 27
28 jsAst.Statement generateInvokeMain() { 28 jsAst.Statement generateInvokeMain() {
29 Element main = compiler.mainFunction; 29 Element main = compiler.mainFunction;
30 jsAst.Expression mainCallClosure = null; 30 jsAst.Expression mainCallClosure = null;
31 if (compiler.hasIsolateSupport) { 31 if (compiler.hasIsolateSupport) {
32 Element isolateMain = 32 Element isolateMain =
33 helpers.isolateHelperLibrary.find(BackendHelpers.START_ROOT_ISOLATE); 33 helpers.isolateHelperLibrary.find(BackendHelpers.START_ROOT_ISOLATE);
34 mainCallClosure = _buildIsolateSetupClosure(main, isolateMain); 34 mainCallClosure = _buildIsolateSetupClosure(main, isolateMain);
35 } else if (compiler.hasIncrementalSupport) { 35 } else if (compiler.options.hasIncrementalSupport) {
36 mainCallClosure = js( 36 mainCallClosure = js(
37 'function() { return #(); }', 37 'function() { return #(); }',
38 emitterTask.staticFunctionAccess(main)); 38 emitterTask.staticFunctionAccess(main));
39 } else { 39 } else {
40 mainCallClosure = emitterTask.staticFunctionAccess(main); 40 mainCallClosure = emitterTask.staticFunctionAccess(main);
41 } 41 }
42 42
43 jsAst.Expression currentScriptAccess = 43 jsAst.Expression currentScriptAccess =
44 emitterTask.generateEmbeddedGlobalAccess(embeddedNames.CURRENT_SCRIPT); 44 emitterTask.generateEmbeddedGlobalAccess(embeddedNames.CURRENT_SCRIPT);
45 45
(...skipping 30 matching lines...) Expand all
76 if (typeof dartMainRunner === "function") { 76 if (typeof dartMainRunner === "function") {
77 dartMainRunner(#mainCallClosure, []); 77 dartMainRunner(#mainCallClosure, []);
78 } else { 78 } else {
79 #mainCallClosure([]); 79 #mainCallClosure([]);
80 } 80 }
81 })''', 81 })''',
82 {'currentScript': currentScriptAccess, 82 {'currentScript': currentScriptAccess,
83 'mainCallClosure': mainCallClosure}); 83 'mainCallClosure': mainCallClosure});
84 } 84 }
85 } 85 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698