Index: sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart |
=================================================================== |
--- sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart (revision 16156) |
+++ sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart (working copy) |
@@ -1856,42 +1856,21 @@ |
Element isolateMain) { |
String mainAccess = "${namer.isolateAccess(appMain)}"; |
String currentIsolate = "${namer.CURRENT_ISOLATE}"; |
- String mainEnsureGetter = ''; |
// Since we pass the closurized version of the main method to |
// the isolate method, we must make sure that it exists. |
if (!compiler.codegenWorld.staticFunctionsNeedingGetter.contains(appMain)) { |
Selector selector = new Selector.callClosure(0); |
String invocationName = "${namer.closureInvocationName(selector)}"; |
- mainEnsureGetter = "$mainAccess.$invocationName = $mainAccess"; |
+ buffer.add("$mainAccess.$invocationName = $mainAccess"); |
} |
- // TODO(ngeoffray): These globals are currently required by the isolate |
- // library. They should be removed. |
- buffer.add(""" |
-var \$globalThis = $currentIsolate; |
-var \$globalState; |
-var \$globals; |
-var \$isWorker = false; |
-var \$supportsWorkers = false; |
-var \$thisScriptUrl; |
-function \$static_init(){}; |
- |
-function \$initGlobals(context) { |
- context.isolateStatics = new ${namer.isolateName}(); |
-} |
-function \$setGlobals(context) { |
- $currentIsolate = context.isolateStatics; |
- \$globalThis = $currentIsolate; |
-} |
-$mainEnsureGetter |
-"""); |
- return "${namer.isolateAccess(isolateMain)}($mainAccess)"; |
+ return "${namer.isolateAccess(isolateMain)}($mainAccess)"; |
} |
emitMain(CodeBuffer buffer) { |
if (compiler.isMockCompilation) return; |
Element main = compiler.mainApp.find(Compiler.MAIN); |
String mainCall = null; |
- if (compiler.isolateHelperLibrary != null) { |
+ if (compiler.hasIsolateSupport()) { |
Element isolateMain = |
compiler.isolateHelperLibrary.find(Compiler.START_ROOT_ISOLATE); |
mainCall = buildIsolateSetup(buffer, main, isolateMain); |