- // instantiate the .wasm file either by streaming it or first loading and then instantiate it
- // https://github.com/emscripten-core/emscripten/blob/master/tests/manual_wasm_instantiate.html#L170
- loadWasmAsync: function(exeName) {
- if (EngineLoader.stream_wasm && (typeof WebAssembly.instantiateStreaming === "function")) {
- EngineLoader.setupWasmStreamAsync(exeName + ".wasm", 10, 50);
- EngineLoader.loadAndRunScriptAsync(exeName + '_wasm.js', EngineLoader.wasmjs_size, 0, 10);
- }
- else {
- EngineLoader.loadAndInstantiateWasmAsync(exeName + ".wasm", 0, 40, function() {
- EngineLoader.loadAndRunScriptAsync(exeName + '_wasm.js', EngineLoader.wasmjs_size, 40, 50);
- });
- }
- },
-
- loadAsmJsAsync: function(exeName) {
- EngineLoader.loadAndRunScriptAsync(exeName + '_asmjs.js', EngineLoader.asmjs_size, 0, 50);
- },
-
- // load and start engine script (asm.js or wasm.js)
- loadAndRunScriptAsync: function(src, estimatedSize, fromProgress, toProgress) {
This file has been truncated. show original