OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.startup_emitter.model_emitter; | 5 part of dart2js.js_emitter.startup_emitter.model_emitter; |
6 | 6 |
7 /// The name of the property that stores the tear-off getter on a static | 7 /// The name of the property that stores the tear-off getter on a static |
8 /// function. | 8 /// function. |
9 /// | 9 /// |
10 /// This property is only used when isolates are used. | 10 /// This property is only used when isolates are used. |
(...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1296 "function(hash) { return !!#deferredInitialized[hash]; }", { | 1296 "function(hash) { return !!#deferredInitialized[hash]; }", { |
1297 'deferredInitialized': generateEmbeddedGlobalAccess(DEFERRED_INITIALIZED) | 1297 'deferredInitialized': generateEmbeddedGlobalAccess(DEFERRED_INITIALIZED) |
1298 }); | 1298 }); |
1299 globals.add(new js.Property( | 1299 globals.add(new js.Property( |
1300 js.string(IS_HUNK_INITIALIZED), isHunkInitializedFunction)); | 1300 js.string(IS_HUNK_INITIALIZED), isHunkInitializedFunction)); |
1301 | 1301 |
1302 /// See [emitEmbeddedGlobalsForDeferredLoading] for the format of the | 1302 /// See [emitEmbeddedGlobalsForDeferredLoading] for the format of the |
1303 /// deferred hunk. | 1303 /// deferred hunk. |
1304 js.Expression initializeLoadedHunkFunction = js.js(""" | 1304 js.Expression initializeLoadedHunkFunction = js.js(""" |
1305 function(hash) { | 1305 function(hash) { |
1306 initializeDeferredHunk($deferredGlobal[hash]); | 1306 var hunk = $deferredGlobal[hash]; |
| 1307 if (hunk == null) { |
| 1308 throw "DeferredLoading state error: code with hash '" + |
| 1309 hash + "' was not loaded"; |
| 1310 } |
| 1311 initializeDeferredHunk(hunk); |
1307 #deferredInitialized[hash] = true; | 1312 #deferredInitialized[hash] = true; |
1308 }""", { | 1313 }""", { |
1309 'deferredInitialized': generateEmbeddedGlobalAccess(DEFERRED_INITIALIZED) | 1314 'deferredInitialized': generateEmbeddedGlobalAccess(DEFERRED_INITIALIZED) |
1310 }); | 1315 }); |
1311 | 1316 |
1312 globals.add(new js.Property( | 1317 globals.add(new js.Property( |
1313 js.string(INITIALIZE_LOADED_HUNK), initializeLoadedHunkFunction)); | 1318 js.string(INITIALIZE_LOADED_HUNK), initializeLoadedHunkFunction)); |
1314 | 1319 |
1315 return globals; | 1320 return globals; |
1316 } | 1321 } |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1544 } | 1549 } |
1545 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);", | 1550 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);", |
1546 js.objectLiteral(interceptorsByTag))); | 1551 js.objectLiteral(interceptorsByTag))); |
1547 statements.add( | 1552 statements.add( |
1548 js.js.statement("setOrUpdateLeafTags(#);", js.objectLiteral(leafTags))); | 1553 js.js.statement("setOrUpdateLeafTags(#);", js.objectLiteral(leafTags))); |
1549 statements.addAll(subclassAssignments); | 1554 statements.addAll(subclassAssignments); |
1550 | 1555 |
1551 return wrapPhase('nativeSupport', statements); | 1556 return wrapPhase('nativeSupport', statements); |
1552 } | 1557 } |
1553 } | 1558 } |
OLD | NEW |