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

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

Issue 646083002: dart2js: Fast fix for deferred globals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More comments. Created 6 years, 2 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 | tests/compiler/dart2js/dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart
index 04117a33e3b5c18f52dea576d94b8f7ce0e98373..e85e3eed90836b8368f43f386171341f8e7dd5d7 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/emitter.dart
@@ -1748,7 +1748,8 @@ class OldEmitter implements Emitter {
// Function for initializing a loaded hunk, given its hash.
buffer.write(jsAst.prettyPrint(
js('# = function(hunkHash) {'
- ' $deferredInitializers[hunkHash]($globalsHolder)'
+ ' $deferredInitializers[hunkHash]('
+ '$globalsHolder, ${namer.currentIsolate})'
'}',
generateEmbeddedGlobalAccess(
embeddedNames.INITIALIZE_LOADED_HUNK)),
@@ -1858,6 +1859,16 @@ class OldEmitter implements Emitter {
classesCollector = oldClassesCollector;
+ // Set the currentIsolate variable to the current isolate (which is
+ // provided as second argument).
+ // We need to do this, because we use the same variable for setting up
+ // the isolate-properties and for storing the current isolate. During
+ // the setup (the code above this lines) we must set the variable to
+ // the isolate-properties.
+ // After we have done the setup (finishing with `finishClasses`) it must
+ // point to the current Isolate. Otherwise all methods/functions
+ // accessing isolate variables will access the wrong object.
+ outputBuffer.write("${namer.currentIsolate}$_=${_}arguments[1]$N");
typeTestEmitter.emitRuntimeTypeSupport(outputBuffer, outputUnit);
emitCompileTimeConstants(outputBuffer, outputUnit);
« no previous file with comments | « no previous file | tests/compiler/dart2js/dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698