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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart

Issue 11574030: Revert r16155: unit tests of the dart2js compiler fail. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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: sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart (revision 16155)
+++ sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart (working copy)
@@ -1856,21 +1856,42 @@
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)}";
- buffer.add("$mainAccess.$invocationName = $mainAccess");
+ mainEnsureGetter = "$mainAccess.$invocationName = $mainAccess";
}
- return "${namer.isolateAccess(isolateMain)}($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)";
}
emitMain(CodeBuffer buffer) {
if (compiler.isMockCompilation) return;
Element main = compiler.mainApp.find(Compiler.MAIN);
String mainCall = null;
- if (compiler.hasIsolateSupport()) {
+ if (compiler.isolateHelperLibrary != null) {
Element isolateMain =
compiler.isolateHelperLibrary.find(Compiler.START_ROOT_ISOLATE);
mainCall = buildIsolateSetup(buffer, main, isolateMain);

Powered by Google App Engine
This is Rietveld 408576698