Chromium Code Reviews| Index: pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart |
| diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart |
| index 95ea5d973d6a6062230a42196ffc443c6c052dfd..62ea9ea2b7c93882a7f565b7c9f34559be944362 100644 |
| --- a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart |
| +++ b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart |
| @@ -157,6 +157,8 @@ class OldEmitter implements Emitter { |
| String get lazyInitializerName |
| => '${namer.isolateName}.${lazyInitializerProperty}'; |
| String get initName => 'init'; |
| + String get deferredInitializedName => 'deferredInitialized'; |
| + |
| String get makeConstListProperty |
| => namer.getMappedInstanceName('makeConstantList'); |
| @@ -1828,21 +1830,30 @@ function(originalDescriptor, name, holder, isStatic, globalFunctionsAccess) { |
| Map<OutputUnit, String> deferredLoadHashes) { |
| // Function for checking if a hunk is loaded given its hash. |
| buffer.write(jsAst.prettyPrint( |
|
floitsch
2015/01/07 13:04:31
Put all these statements together into one string.
sigurdm
2015/01/07 13:37:13
Done.
|
| - js('# = function(hunkHash) {' |
| + js.statement('# = function(hunkHash) {' |
| ' return !!$deferredInitializers[hunkHash];' |
| - '}', generateEmbeddedGlobalAccess(embeddedNames.IS_HUNK_LOADED)), |
| + '};', generateEmbeddedGlobalAccess(embeddedNames.IS_HUNK_LOADED)), |
| + compiler, monitor: compiler.dumpInfoTask)); |
| + buffer.write(jsAst.prettyPrint( |
| + js.statement('$initName.$deferredInitializedName = new Object(null);'), |
|
floitsch
2015/01/07 13:04:31
this looks like a bad "initName" of an embedded gl
sigurdm
2015/01/07 13:37:13
Changed it to an embedded global.
|
| + compiler, monitor: compiler.dumpInfoTask)); |
| + // Function for checking if a hunk is initialized given its hash. |
| + buffer.write(jsAst.prettyPrint( |
| + js.statement('# = function(hunkHash) {' |
| + 'return $initName.$deferredInitializedName[hunkHash];' |
| + '};', |
| + generateEmbeddedGlobalAccess(embeddedNames.IS_HUNK_INITIALIZED)), |
| compiler, monitor: compiler.dumpInfoTask)); |
| - buffer.write('$N'); |
| // Function for initializing a loaded hunk, given its hash. |
| buffer.write(jsAst.prettyPrint( |
| - js('# = function(hunkHash) {' |
| - ' $deferredInitializers[hunkHash](' |
| - '$globalsHolder, ${namer.currentIsolate})' |
| - '}', |
| + js.statement('# = function(hunkHash) {' |
| + '$deferredInitializers[hunkHash](' |
| + '$globalsHolder, ${namer.currentIsolate});' |
| + '$initName.deferredInitialized[hunkHash] = true;' |
| + '};', |
| generateEmbeddedGlobalAccess( |
| embeddedNames.INITIALIZE_LOADED_HUNK)), |
| compiler, monitor: compiler.dumpInfoTask)); |
| - buffer.write('$N'); |
| // Write a javascript mapping from Deferred import load ids (derrived |
| // from the import prefix.) to a list of lists of uris of hunks to load, |
| // and a corresponding mapping to a list of hashes used by |