From cb009807fe085552d1f2532d36d6b90d98eaea9e Mon Sep 17 00:00:00 2001 From: Jeremy Nguyen Date: Wed, 16 Sep 2026 19:46:43 -0700 Subject: [PATCH 01/10] Support async instantiation in Node.js --- src/postamble_minimal.js | 19 +++++++++++-------- src/preamble.js | 26 +++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/src/postamble_minimal.js b/src/postamble_minimal.js index a721f98a42259..94b6f121557e7 100644 --- a/src/postamble_minimal.js +++ b/src/postamble_minimal.js @@ -107,7 +107,7 @@ function run() { #else // Run a persistent (never-exiting) application starting at main(). _main({{{ argc_argv() }}}); -#endif +#endif #if STACK_OVERFLOW_CHECK checkStackCookie(); @@ -206,13 +206,16 @@ assert(WebAssembly.instantiateStreaming || Module['wasm'], 'Must load WebAssembl instantiatePromise = #endif (WebAssembly.instantiateStreaming -#if ENVIRONMENT_MAY_BE_NODE - // Avoid using instantiateStreaming() on Node.js since the `fetch()` API - // does not support `file://` URLs. - // See: https://github.com/emscripten-core/emscripten/pull/16917 - && !ENVIRONMENT_IS_NODE -#endif - ? WebAssembly.instantiateStreaming(fetch({{{ moduleUrl }}}), imports) + ? (ENVIRONMENT_IS_NODE + // Avoid using `fetch()` API on Node.js since it does not support `file://` + // URLs. Instead, provide a Response that wraps a fs read stream with the + // correct MIME type. + // See: https://github.com/emscripten-core/emscripten/pull/16917 + ? WebAssembly.instantiateStreaming( + new Response(require('node:fs').createReadStream({{{ nodeWasmPath }}}), { headers: { 'Content-Type': 'application/wasm' } }), + imports, + ) + : WebAssembly.instantiateStreaming(fetch({{{ moduleUrl }}}), imports)) : WebAssembly.instantiate(Module['wasm'], imports)).then((output) => { #else #if MODULARIZE || AUDIO_WORKLET diff --git a/src/preamble.js b/src/preamble.js index 54b537db5e8cc..b2c0b4f281feb 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -708,9 +708,8 @@ async function instantiateAsync(binary, binaryFile, imports) { && !isFileURI(binaryFile) #endif #if ENVIRONMENT_MAY_BE_NODE - // Avoid using instantiateStreaming() on Node.js since the `fetch()` API - // does not support `file://` URLs. - // See: https://github.com/emscripten-core/emscripten/pull/16917 + // Node.js is handled in its own branch below, since it can't use fetch() + // to stream a `file://` URL && !ENVIRONMENT_IS_NODE #endif #if ENVIRONMENT_MAY_BE_SHELL @@ -730,6 +729,27 @@ async function instantiateAsync(binary, binaryFile, imports) { // fall back of instantiateArrayBuffer below }; } +#if ENVIRONMENT_MAY_BE_NODE + else if (!binary && ENVIRONMENT_IS_NODE) { + // Avoid using `fetch()` API on Node.js since it does not support `file://` + // URLs. Instead, provide a Response that wraps a fs read stream with the + // correct MIME type. + // See: https://github.com/emscripten-core/emscripten/pull/16917 + try { + var url = require('node:url'); + // `binaryFile` may be a `file://` URL string here; fs.createReadStream() + // needs an actual URL object (or a plain path), not a URL string. + var nodeBinaryFile = isFileURI(binaryFile) ? url.fileURLToPath(binaryFile) : binaryFile; + var response = new Response(fs.createReadStream(nodeBinaryFile), { headers: { 'Content-Type': 'application/wasm' } }); + var instantiationResult = await WebAssembly.instantiateStreaming(response, imports); + return instantiationResult; + } catch (reason) { + err(`wasm streaming compile failed: ${reason}`); + err('falling back to ArrayBuffer instantiation'); + // fall back of instantiateArrayBuffer below + }; + } +#endif #endif // !SINGLE_FILE return instantiateArrayBuffer(binaryFile, imports); } From dea081e4e5b0c3995c1f3ed49ca9442280b34976 Mon Sep 17 00:00:00 2001 From: Jeremy Nguyen Date: Wed, 16 Sep 2026 20:47:31 -0700 Subject: [PATCH 02/10] Replace createReadStream with openAsBlob --- src/postamble_minimal.js | 8 +++++--- src/preamble.js | 7 ++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/postamble_minimal.js b/src/postamble_minimal.js index 94b6f121557e7..86c430c98a6fa 100644 --- a/src/postamble_minimal.js +++ b/src/postamble_minimal.js @@ -208,11 +208,13 @@ instantiatePromise = (WebAssembly.instantiateStreaming ? (ENVIRONMENT_IS_NODE // Avoid using `fetch()` API on Node.js since it does not support `file://` - // URLs. Instead, provide a Response that wraps a fs read stream with the - // correct MIME type. + // URLs. Instead, provide a Response that wraps a blob with the correct + // MIME type. // See: https://github.com/emscripten-core/emscripten/pull/16917 ? WebAssembly.instantiateStreaming( - new Response(require('node:fs').createReadStream({{{ nodeWasmPath }}}), { headers: { 'Content-Type': 'application/wasm' } }), + require('node:fs') + .openAsBlob({{{ nodeWasmPath }}}) + .then((blob) => new Response(blob, { headers: { 'Content-Type': 'application/wasm' } })), imports, ) : WebAssembly.instantiateStreaming(fetch({{{ moduleUrl }}}), imports)) diff --git a/src/preamble.js b/src/preamble.js index b2c0b4f281feb..f506ccdd8d78b 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -740,7 +740,12 @@ async function instantiateAsync(binary, binaryFile, imports) { // `binaryFile` may be a `file://` URL string here; fs.createReadStream() // needs an actual URL object (or a plain path), not a URL string. var nodeBinaryFile = isFileURI(binaryFile) ? url.fileURLToPath(binaryFile) : binaryFile; - var response = new Response(fs.createReadStream(nodeBinaryFile), { headers: { 'Content-Type': 'application/wasm' } }); + var response = fs.openAsBlob(nodeBinaryFile).then( + (blob) => + new Response(blob, { + headers: { 'Content-Type': 'application/wasm' }, + }), + ); var instantiationResult = await WebAssembly.instantiateStreaming(response, imports); return instantiationResult; } catch (reason) { From 0f935a75bcad1c4148fd2e73ad60fe1339499216 Mon Sep 17 00:00:00 2001 From: Jeremy Nguyen Date: Wed, 16 Sep 2026 23:07:45 -0700 Subject: [PATCH 03/10] Handle postamble_minimal.js Node.js path correctly --- src/postamble_minimal.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/postamble_minimal.js b/src/postamble_minimal.js index 86c430c98a6fa..86d7795c9acb4 100644 --- a/src/postamble_minimal.js +++ b/src/postamble_minimal.js @@ -189,10 +189,13 @@ var imports = { {{{ #if EXPORT_ES6 && !ENVIRONMENT_MAY_BE_AUDIO_WORKLET const moduleUrl = `new URL('${TARGET_BASENAME}.wasm', import.meta.url)`; +const nodeWasmPath = `require('node:url').fileURLToPath(${moduleUrl})`; #elif !EXPORT_ES6 || AUDIO_WORKLET const moduleUrl = `'${TARGET_BASENAME}.wasm'`; +const nodeWasmPath = `__dirname + '/${TARGET_BASENAME}.wasm'`; #else const moduleUrl = `ENVIRONMENT_IS_AUDIO_WORKLET ? '${TARGET_BASENAME}.wasm' : new URL('${TARGET_BASENAME}.wasm', import.meta.url)`; +const nodeWasmPath = `__dirname + '/${TARGET_BASENAME}.wasm'`; #endif }}} // https://caniuse.com/#feat=wasm and https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiateStreaming From 7355581359cc900a12c3ddd7bc9315822fcc289e Mon Sep 17 00:00:00 2001 From: Jeremy Nguyen Date: Wed, 16 Sep 2026 23:08:03 -0700 Subject: [PATCH 04/10] Add fs.openAsBlob function in closure Node.js externs --- src/closure-externs/node-externs.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/closure-externs/node-externs.js b/src/closure-externs/node-externs.js index 35c1d058dc19a..30cf9f0099a40 100644 --- a/src/closure-externs/node-externs.js +++ b/src/closure-externs/node-externs.js @@ -131,6 +131,14 @@ fs.Stats.prototype.ctimeMs; */ fs.Stats.prototype.blksize; +/** + * @param {string|!Buffer|!URL} path + * @param {{type: (string|undefined)}=} options + * @return {!Promise} + * @nosideeffects + */ +fs.openAsBlob = function (path, options) {}; + /** * @param {string} p * @return {boolean} From e76773973bc0f4a6fc56f51b27dd04bedfd8a4b9 Mon Sep 17 00:00:00 2001 From: Jeremy Nguyen Date: Thu, 17 Sep 2026 06:52:29 +0000 Subject: [PATCH 05/10] Update preamble --- src/preamble.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/preamble.js b/src/preamble.js index f506ccdd8d78b..40cd1dbe0d539 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -737,8 +737,6 @@ async function instantiateAsync(binary, binaryFile, imports) { // See: https://github.com/emscripten-core/emscripten/pull/16917 try { var url = require('node:url'); - // `binaryFile` may be a `file://` URL string here; fs.createReadStream() - // needs an actual URL object (or a plain path), not a URL string. var nodeBinaryFile = isFileURI(binaryFile) ? url.fileURLToPath(binaryFile) : binaryFile; var response = fs.openAsBlob(nodeBinaryFile).then( (blob) => From 0f63e6cf2ddf9e2b176a84776abd050f2207867f Mon Sep 17 00:00:00 2001 From: Jeremy Nguyen Date: Thu, 17 Sep 2026 06:52:52 +0000 Subject: [PATCH 06/10] Rebaseline tests --- test/codesize/test_codesize_cxx_ctors1.json | 8 ++--- test/codesize/test_codesize_cxx_ctors2.json | 8 ++--- test/codesize/test_codesize_cxx_except.json | 8 ++--- test/codesize/test_codesize_cxx_mangle.json | 8 ++--- test/codesize/test_codesize_cxx_noexcept.json | 8 ++--- test/codesize/test_codesize_cxx_wasmfs.json | 8 ++--- .../test_codesize_file_preload.expected.js | 21 ++++++++++++++ test/codesize/test_codesize_file_preload.json | 8 ++--- test/codesize/test_codesize_files_js_fs.json | 8 ++--- test/codesize/test_codesize_files_wasmfs.json | 8 ++--- test/codesize/test_codesize_hello_O0.json | 8 ++--- test/codesize/test_codesize_hello_O1.json | 8 ++--- test/codesize/test_codesize_hello_O2.json | 8 ++--- test/codesize/test_codesize_hello_O3.json | 8 ++--- test/codesize/test_codesize_hello_Os.json | 8 ++--- test/codesize/test_codesize_hello_Oz.json | 8 ++--- test/codesize/test_codesize_hello_dylink.json | 8 ++--- .../test_codesize_hello_dylink_all.json | 4 +-- .../test_codesize_hello_export_nothing.json | 8 ++--- test/codesize/test_codesize_hello_wasmfs.json | 8 ++--- .../test_codesize_libcxxabi_message_O3.json | 8 ++--- ...esize_libcxxabi_message_O3_standalone.json | 8 ++--- test/codesize/test_codesize_mem_O3.json | 8 ++--- test/codesize/test_codesize_mem_O3_grow.json | 8 ++--- .../test_codesize_minimal_O0.expected.js | 29 +++++++++++++++++-- test/codesize/test_codesize_minimal_O0.json | 8 ++--- test/codesize/test_codesize_minimal_O1.json | 8 ++--- test/codesize/test_codesize_minimal_O2.json | 8 ++--- test/codesize/test_codesize_minimal_O3.json | 8 ++--- test/codesize/test_codesize_minimal_Os.json | 8 ++--- .../test_codesize_minimal_Oz-ctors.json | 8 ++--- test/codesize/test_codesize_minimal_Oz.json | 8 ++--- test/codesize/test_codesize_minimal_esm.json | 8 ++--- .../test_codesize_minimal_pthreads.json | 8 ++--- .../test_codesize_minimal_wasmfs.json | 8 ++--- test/codesize/test_unoptimized_code_size.json | 16 +++++----- 36 files changed, 185 insertions(+), 141 deletions(-) diff --git a/test/codesize/test_codesize_cxx_ctors1.json b/test/codesize/test_codesize_cxx_ctors1.json index ef85ddc7054d5..73481eedb0259 100644 --- a/test/codesize/test_codesize_cxx_ctors1.json +++ b/test/codesize/test_codesize_cxx_ctors1.json @@ -1,10 +1,10 @@ { - "a.out.js": 19224, - "a.out.js.gz": 8124, + "a.out.js": 19537, + "a.out.js.gz": 8228, "a.out.nodebug.wasm": 133971, "a.out.nodebug.wasm.gz": 51271, - "total": 153195, - "total_gz": 59395, + "total": 153508, + "total_gz": 59499, "sent": [ "__cxa_throw", "_abort_js", diff --git a/test/codesize/test_codesize_cxx_ctors2.json b/test/codesize/test_codesize_cxx_ctors2.json index 9745a6316785d..84ef60890cab7 100644 --- a/test/codesize/test_codesize_cxx_ctors2.json +++ b/test/codesize/test_codesize_cxx_ctors2.json @@ -1,10 +1,10 @@ { - "a.out.js": 19201, - "a.out.js.gz": 8107, + "a.out.js": 19514, + "a.out.js.gz": 8211, "a.out.nodebug.wasm": 133403, "a.out.nodebug.wasm.gz": 50959, - "total": 152604, - "total_gz": 59066, + "total": 152917, + "total_gz": 59170, "sent": [ "__cxa_throw", "_abort_js", diff --git a/test/codesize/test_codesize_cxx_except.json b/test/codesize/test_codesize_cxx_except.json index 8e083d22ec62b..6e193e20aea54 100644 --- a/test/codesize/test_codesize_cxx_except.json +++ b/test/codesize/test_codesize_cxx_except.json @@ -1,10 +1,10 @@ { - "a.out.js": 22917, - "a.out.js.gz": 9082, + "a.out.js": 23229, + "a.out.js.gz": 9190, "a.out.nodebug.wasm": 176383, "a.out.nodebug.wasm.gz": 58776, - "total": 199300, - "total_gz": 67858, + "total": 199612, + "total_gz": 67966, "sent": [ "__cxa_begin_catch", "__cxa_end_catch", diff --git a/test/codesize/test_codesize_cxx_mangle.json b/test/codesize/test_codesize_cxx_mangle.json index a9df7ddb5796f..88b377df1b5e0 100644 --- a/test/codesize/test_codesize_cxx_mangle.json +++ b/test/codesize/test_codesize_cxx_mangle.json @@ -1,10 +1,10 @@ { - "a.out.js": 22967, - "a.out.js.gz": 9103, + "a.out.js": 23279, + "a.out.js.gz": 9210, "a.out.nodebug.wasm": 242663, "a.out.nodebug.wasm.gz": 81001, - "total": 265630, - "total_gz": 90104, + "total": 265942, + "total_gz": 90211, "sent": [ "__cxa_begin_catch", "__cxa_end_catch", diff --git a/test/codesize/test_codesize_cxx_noexcept.json b/test/codesize/test_codesize_cxx_noexcept.json index 608a59b681293..16ae5a73eefe8 100644 --- a/test/codesize/test_codesize_cxx_noexcept.json +++ b/test/codesize/test_codesize_cxx_noexcept.json @@ -1,10 +1,10 @@ { - "a.out.js": 19224, - "a.out.js.gz": 8124, + "a.out.js": 19537, + "a.out.js.gz": 8228, "a.out.nodebug.wasm": 135882, "a.out.nodebug.wasm.gz": 51885, - "total": 155106, - "total_gz": 60009, + "total": 155419, + "total_gz": 60113, "sent": [ "__cxa_throw", "_abort_js", diff --git a/test/codesize/test_codesize_cxx_wasmfs.json b/test/codesize/test_codesize_cxx_wasmfs.json index a50f193ba380b..eb11692da0d66 100644 --- a/test/codesize/test_codesize_cxx_wasmfs.json +++ b/test/codesize/test_codesize_cxx_wasmfs.json @@ -1,10 +1,10 @@ { - "a.out.js": 6604, - "a.out.js.gz": 3154, + "a.out.js": 6917, + "a.out.js.gz": 3266, "a.out.nodebug.wasm": 173607, "a.out.nodebug.wasm.gz": 64636, - "total": 180211, - "total_gz": 67790, + "total": 180524, + "total_gz": 67902, "sent": [ "__cxa_throw", "_abort_js", diff --git a/test/codesize/test_codesize_file_preload.expected.js b/test/codesize/test_codesize_file_preload.expected.js index 6999515586248..0c2b181af4815 100644 --- a/test/codesize/test_codesize_file_preload.expected.js +++ b/test/codesize/test_codesize_file_preload.expected.js @@ -428,6 +428,27 @@ async function instantiateAsync(binary, binaryFile, imports) { err(`wasm streaming compile failed: ${reason}`); err("falling back to ArrayBuffer instantiation"); } + } else if (!binary && ENVIRONMENT_IS_NODE) { + // Avoid using `fetch()` API on Node.js since it does not support `file://` + // URLs. Instead, provide a Response that wraps a fs read stream with the + // correct MIME type. + // See: https://github.com/emscripten-core/emscripten/pull/16917 + try { + var url = require("node:url"); + // `binaryFile` may be a `file://` URL string here; fs.createReadStream() + // needs an actual URL object (or a plain path), not a URL string. + var nodeBinaryFile = isFileURI(binaryFile) ? url.fileURLToPath(binaryFile) : binaryFile; + var response = fs.openAsBlob(nodeBinaryFile).then(blob => new Response(blob, { + headers: { + "Content-Type": "application/wasm" + } + })); + var instantiationResult = await WebAssembly.instantiateStreaming(response, imports); + return instantiationResult; + } catch (reason) { + err(`wasm streaming compile failed: ${reason}`); + err("falling back to ArrayBuffer instantiation"); + } } return instantiateArrayBuffer(binaryFile, imports); } diff --git a/test/codesize/test_codesize_file_preload.json b/test/codesize/test_codesize_file_preload.json index 8a288445877b2..43317ff697486 100644 --- a/test/codesize/test_codesize_file_preload.json +++ b/test/codesize/test_codesize_file_preload.json @@ -1,10 +1,10 @@ { - "a.out.js": 22203, - "a.out.js.gz": 9267, + "a.out.js": 22516, + "a.out.js.gz": 9367, "a.out.nodebug.wasm": 1198, "a.out.nodebug.wasm.gz": 730, - "total": 23401, - "total_gz": 9997, + "total": 23714, + "total_gz": 10097, "sent": [ "a (fd_write)" ], diff --git a/test/codesize/test_codesize_files_js_fs.json b/test/codesize/test_codesize_files_js_fs.json index 0c033a7242071..283102bf88ef1 100644 --- a/test/codesize/test_codesize_files_js_fs.json +++ b/test/codesize/test_codesize_files_js_fs.json @@ -1,10 +1,10 @@ { - "a.out.js": 17871, - "a.out.js.gz": 7460, + "a.out.js": 18184, + "a.out.js.gz": 7571, "a.out.nodebug.wasm": 381, "a.out.nodebug.wasm.gz": 258, - "total": 18252, - "total_gz": 7718, + "total": 18565, + "total_gz": 7829, "sent": [ "a (fd_write)", "b (fd_read)", diff --git a/test/codesize/test_codesize_files_wasmfs.json b/test/codesize/test_codesize_files_wasmfs.json index 5326a3c193b07..b13bf04e5d57c 100644 --- a/test/codesize/test_codesize_files_wasmfs.json +++ b/test/codesize/test_codesize_files_wasmfs.json @@ -1,10 +1,10 @@ { - "a.out.js": 4979, - "a.out.js.gz": 2409, + "a.out.js": 5292, + "a.out.js.gz": 2518, "a.out.nodebug.wasm": 58252, "a.out.nodebug.wasm.gz": 18292, - "total": 63231, - "total_gz": 20701, + "total": 63544, + "total_gz": 20810, "sent": [ "a (emscripten_date_now)", "b (emscripten_err)", diff --git a/test/codesize/test_codesize_hello_O0.json b/test/codesize/test_codesize_hello_O0.json index 0a131354a605f..1eeafbede4ea4 100644 --- a/test/codesize/test_codesize_hello_O0.json +++ b/test/codesize/test_codesize_hello_O0.json @@ -1,10 +1,10 @@ { - "a.out.js": 23596, - "a.out.js.gz": 8582, + "a.out.js": 23986, + "a.out.js.gz": 8693, "a.out.nodebug.wasm": 14279, "a.out.nodebug.wasm.gz": 7101, - "total": 37875, - "total_gz": 15683, + "total": 38265, + "total_gz": 15794, "sent": [ "fd_write" ], diff --git a/test/codesize/test_codesize_hello_O1.json b/test/codesize/test_codesize_hello_O1.json index e0f7a25ea23c8..250f3156133d0 100644 --- a/test/codesize/test_codesize_hello_O1.json +++ b/test/codesize/test_codesize_hello_O1.json @@ -1,10 +1,10 @@ { - "a.out.js": 5516, - "a.out.js.gz": 2242, + "a.out.js": 5906, + "a.out.js.gz": 2362, "a.out.nodebug.wasm": 2050, "a.out.nodebug.wasm.gz": 1231, - "total": 7566, - "total_gz": 3473, + "total": 7956, + "total_gz": 3593, "sent": [ "fd_write" ], diff --git a/test/codesize/test_codesize_hello_O2.json b/test/codesize/test_codesize_hello_O2.json index 5cc957a275f08..eec9003ffd44c 100644 --- a/test/codesize/test_codesize_hello_O2.json +++ b/test/codesize/test_codesize_hello_O2.json @@ -1,10 +1,10 @@ { - "a.out.js": 3855, - "a.out.js.gz": 1966, + "a.out.js": 4167, + "a.out.js.gz": 2074, "a.out.nodebug.wasm": 1444, "a.out.nodebug.wasm.gz": 922, - "total": 5299, - "total_gz": 2888, + "total": 5611, + "total_gz": 2996, "sent": [ "fd_write" ], diff --git a/test/codesize/test_codesize_hello_O3.json b/test/codesize/test_codesize_hello_O3.json index 832365a8f1c6b..031ad28c2a93a 100644 --- a/test/codesize/test_codesize_hello_O3.json +++ b/test/codesize/test_codesize_hello_O3.json @@ -1,10 +1,10 @@ { - "a.out.js": 3797, - "a.out.js.gz": 1925, + "a.out.js": 4109, + "a.out.js.gz": 2032, "a.out.nodebug.wasm": 1198, "a.out.nodebug.wasm.gz": 730, - "total": 4995, - "total_gz": 2655, + "total": 5307, + "total_gz": 2762, "sent": [ "a (fd_write)" ], diff --git a/test/codesize/test_codesize_hello_Os.json b/test/codesize/test_codesize_hello_Os.json index 55e52acdc3ab6..5ad549ec98057 100644 --- a/test/codesize/test_codesize_hello_Os.json +++ b/test/codesize/test_codesize_hello_Os.json @@ -1,10 +1,10 @@ { - "a.out.js": 3797, - "a.out.js.gz": 1925, + "a.out.js": 4109, + "a.out.js.gz": 2032, "a.out.nodebug.wasm": 1188, "a.out.nodebug.wasm.gz": 732, - "total": 4985, - "total_gz": 2657, + "total": 5297, + "total_gz": 2764, "sent": [ "a (fd_write)" ], diff --git a/test/codesize/test_codesize_hello_Oz.json b/test/codesize/test_codesize_hello_Oz.json index 1739d3afc7aaf..be0167c6799ff 100644 --- a/test/codesize/test_codesize_hello_Oz.json +++ b/test/codesize/test_codesize_hello_Oz.json @@ -1,10 +1,10 @@ { - "a.out.js": 3434, - "a.out.js.gz": 1729, + "a.out.js": 3747, + "a.out.js.gz": 1837, "a.out.nodebug.wasm": 1188, "a.out.nodebug.wasm.gz": 732, - "total": 4622, - "total_gz": 2461, + "total": 4935, + "total_gz": 2569, "sent": [ "a (fd_write)" ], diff --git a/test/codesize/test_codesize_hello_dylink.json b/test/codesize/test_codesize_hello_dylink.json index 27c28e6b09a79..426ce2dac2f69 100644 --- a/test/codesize/test_codesize_hello_dylink.json +++ b/test/codesize/test_codesize_hello_dylink.json @@ -1,10 +1,10 @@ { - "a.out.js": 26188, - "a.out.js.gz": 11168, + "a.out.js": 26502, + "a.out.js.gz": 11285, "a.out.nodebug.wasm": 16992, "a.out.nodebug.wasm.gz": 8679, - "total": 43180, - "total_gz": 19847, + "total": 43494, + "total_gz": 19964, "sent": [ "__syscall_stat64", "emscripten_resize_heap", diff --git a/test/codesize/test_codesize_hello_dylink_all.json b/test/codesize/test_codesize_hello_dylink_all.json index 2599da95e6573..36625fa688ace 100644 --- a/test/codesize/test_codesize_hello_dylink_all.json +++ b/test/codesize/test_codesize_hello_dylink_all.json @@ -1,7 +1,7 @@ { - "a.out.js": 270695, + "a.out.js": 271010, "a.out.nodebug.wasm": 588289, - "total": 858984, + "total": 859299, "sent": [ "IMG_Init", "IMG_Load", diff --git a/test/codesize/test_codesize_hello_export_nothing.json b/test/codesize/test_codesize_hello_export_nothing.json index c4012b3373c4f..b3551852c6610 100644 --- a/test/codesize/test_codesize_hello_export_nothing.json +++ b/test/codesize/test_codesize_hello_export_nothing.json @@ -1,10 +1,10 @@ { - "a.out.js": 2642, - "a.out.js.gz": 1290, + "a.out.js": 2955, + "a.out.js.gz": 1400, "a.out.nodebug.wasm": 43, "a.out.nodebug.wasm.gz": 59, - "total": 2685, - "total_gz": 1349, + "total": 2998, + "total_gz": 1459, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_hello_wasmfs.json b/test/codesize/test_codesize_hello_wasmfs.json index 832365a8f1c6b..031ad28c2a93a 100644 --- a/test/codesize/test_codesize_hello_wasmfs.json +++ b/test/codesize/test_codesize_hello_wasmfs.json @@ -1,10 +1,10 @@ { - "a.out.js": 3797, - "a.out.js.gz": 1925, + "a.out.js": 4109, + "a.out.js.gz": 2032, "a.out.nodebug.wasm": 1198, "a.out.nodebug.wasm.gz": 730, - "total": 4995, - "total_gz": 2655, + "total": 5307, + "total_gz": 2762, "sent": [ "a (fd_write)" ], diff --git a/test/codesize/test_codesize_libcxxabi_message_O3.json b/test/codesize/test_codesize_libcxxabi_message_O3.json index a3d564f5f2563..4b9aacec71a12 100644 --- a/test/codesize/test_codesize_libcxxabi_message_O3.json +++ b/test/codesize/test_codesize_libcxxabi_message_O3.json @@ -1,10 +1,10 @@ { - "a.out.js": 3010, - "a.out.js.gz": 1480, + "a.out.js": 3322, + "a.out.js.gz": 1587, "a.out.nodebug.wasm": 89, "a.out.nodebug.wasm.gz": 98, - "total": 3099, - "total_gz": 1578, + "total": 3411, + "total_gz": 1685, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_libcxxabi_message_O3_standalone.json b/test/codesize/test_codesize_libcxxabi_message_O3_standalone.json index 2cc7597db55ab..012e2b9b7959a 100644 --- a/test/codesize/test_codesize_libcxxabi_message_O3_standalone.json +++ b/test/codesize/test_codesize_libcxxabi_message_O3_standalone.json @@ -1,10 +1,10 @@ { - "a.out.js": 3093, - "a.out.js.gz": 1530, + "a.out.js": 3406, + "a.out.js.gz": 1644, "a.out.nodebug.wasm": 222, "a.out.nodebug.wasm.gz": 206, - "total": 3315, - "total_gz": 1736, + "total": 3628, + "total_gz": 1850, "sent": [ "proc_exit" ], diff --git a/test/codesize/test_codesize_mem_O3.json b/test/codesize/test_codesize_mem_O3.json index 886be4087c960..d175036894bac 100644 --- a/test/codesize/test_codesize_mem_O3.json +++ b/test/codesize/test_codesize_mem_O3.json @@ -1,10 +1,10 @@ { - "a.out.js": 3875, - "a.out.js.gz": 1925, + "a.out.js": 4187, + "a.out.js.gz": 2033, "a.out.nodebug.wasm": 5268, "a.out.nodebug.wasm.gz": 2433, - "total": 9143, - "total_gz": 4358, + "total": 9455, + "total_gz": 4466, "sent": [ "a (emscripten_resize_heap)" ], diff --git a/test/codesize/test_codesize_mem_O3_grow.json b/test/codesize/test_codesize_mem_O3_grow.json index 425b77043764f..9dd0600157add 100644 --- a/test/codesize/test_codesize_mem_O3_grow.json +++ b/test/codesize/test_codesize_mem_O3_grow.json @@ -1,10 +1,10 @@ { - "a.out.js": 4209, - "a.out.js.gz": 2101, + "a.out.js": 4522, + "a.out.js.gz": 2210, "a.out.nodebug.wasm": 5269, "a.out.nodebug.wasm.gz": 2433, - "total": 9478, - "total_gz": 4534, + "total": 9791, + "total_gz": 4643, "sent": [ "a (emscripten_resize_heap)" ], diff --git a/test/codesize/test_codesize_minimal_O0.expected.js b/test/codesize/test_codesize_minimal_O0.expected.js index 61b5952de1fd0..c078bba96b581 100644 --- a/test/codesize/test_codesize_minimal_O0.expected.js +++ b/test/codesize/test_codesize_minimal_O0.expected.js @@ -651,9 +651,8 @@ async function instantiateAsync(binary, binaryFile, imports) { if (!binary // Don't use streaming for file:// delivered objects in a webview, fetch them synchronously. && !isFileURI(binaryFile) - // Avoid using instantiateStreaming() on Node.js since the `fetch()` API - // does not support `file://` URLs. - // See: https://github.com/emscripten-core/emscripten/pull/16917 + // Node.js is handled in its own branch below, since it can't use fetch() + // to stream a `file://` URL && !ENVIRONMENT_IS_NODE ) { try { @@ -668,6 +667,30 @@ async function instantiateAsync(binary, binaryFile, imports) { // fall back of instantiateArrayBuffer below }; } + else if (!binary && ENVIRONMENT_IS_NODE) { + // Avoid using `fetch()` API on Node.js since it does not support `file://` + // URLs. Instead, provide a Response that wraps a fs read stream with the + // correct MIME type. + // See: https://github.com/emscripten-core/emscripten/pull/16917 + try { + var url = require('node:url'); + // `binaryFile` may be a `file://` URL string here; fs.createReadStream() + // needs an actual URL object (or a plain path), not a URL string. + var nodeBinaryFile = isFileURI(binaryFile) ? url.fileURLToPath(binaryFile) : binaryFile; + var response = fs.openAsBlob(nodeBinaryFile).then( + (blob) => + new Response(blob, { + headers: { 'Content-Type': 'application/wasm' }, + }), + ); + var instantiationResult = await WebAssembly.instantiateStreaming(response, imports); + return instantiationResult; + } catch (reason) { + err(`wasm streaming compile failed: ${reason}`); + err('falling back to ArrayBuffer instantiation'); + // fall back of instantiateArrayBuffer below + }; + } return instantiateArrayBuffer(binaryFile, imports); } diff --git a/test/codesize/test_codesize_minimal_O0.json b/test/codesize/test_codesize_minimal_O0.json index f960557acfdd1..148ef2413b57e 100644 --- a/test/codesize/test_codesize_minimal_O0.json +++ b/test/codesize/test_codesize_minimal_O0.json @@ -1,10 +1,10 @@ { - "a.out.js": 18801, - "a.out.js.gz": 6758, + "a.out.js": 19191, + "a.out.js.gz": 6875, "a.out.nodebug.wasm": 1071, "a.out.nodebug.wasm.gz": 636, - "total": 19872, - "total_gz": 7394, + "total": 20262, + "total_gz": 7511, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_minimal_O1.json b/test/codesize/test_codesize_minimal_O1.json index 19ff15d14dac8..8a88ecc99a40d 100644 --- a/test/codesize/test_codesize_minimal_O1.json +++ b/test/codesize/test_codesize_minimal_O1.json @@ -1,10 +1,10 @@ { - "a.out.js": 2670, - "a.out.js.gz": 1167, + "a.out.js": 3060, + "a.out.js.gz": 1286, "a.out.nodebug.wasm": 505, "a.out.nodebug.wasm.gz": 378, - "total": 3175, - "total_gz": 1545, + "total": 3565, + "total_gz": 1664, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_minimal_O2.json b/test/codesize/test_codesize_minimal_O2.json index bd4d07eef5864..f90a41a331e86 100644 --- a/test/codesize/test_codesize_minimal_O2.json +++ b/test/codesize/test_codesize_minimal_O2.json @@ -1,10 +1,10 @@ { - "a.out.js": 2052, - "a.out.js.gz": 1058, + "a.out.js": 2365, + "a.out.js.gz": 1165, "a.out.nodebug.wasm": 326, "a.out.nodebug.wasm.gz": 263, - "total": 2378, - "total_gz": 1321, + "total": 2691, + "total_gz": 1428, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_minimal_O3.json b/test/codesize/test_codesize_minimal_O3.json index 5fe4c0860fef6..5e5fe75ccddcb 100644 --- a/test/codesize/test_codesize_minimal_O3.json +++ b/test/codesize/test_codesize_minimal_O3.json @@ -1,10 +1,10 @@ { - "a.out.js": 1998, - "a.out.js.gz": 1027, + "a.out.js": 2311, + "a.out.js.gz": 1133, "a.out.nodebug.wasm": 75, "a.out.nodebug.wasm.gz": 87, - "total": 2073, - "total_gz": 1114, + "total": 2386, + "total_gz": 1220, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_minimal_Os.json b/test/codesize/test_codesize_minimal_Os.json index 5fe4c0860fef6..5e5fe75ccddcb 100644 --- a/test/codesize/test_codesize_minimal_Os.json +++ b/test/codesize/test_codesize_minimal_Os.json @@ -1,10 +1,10 @@ { - "a.out.js": 1998, - "a.out.js.gz": 1027, + "a.out.js": 2311, + "a.out.js.gz": 1133, "a.out.nodebug.wasm": 75, "a.out.nodebug.wasm.gz": 87, - "total": 2073, - "total_gz": 1114, + "total": 2386, + "total_gz": 1220, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_minimal_Oz-ctors.json b/test/codesize/test_codesize_minimal_Oz-ctors.json index 01649ef200d36..c25ce64652c4f 100644 --- a/test/codesize/test_codesize_minimal_Oz-ctors.json +++ b/test/codesize/test_codesize_minimal_Oz-ctors.json @@ -1,10 +1,10 @@ { - "a.out.js": 1980, - "a.out.js.gz": 1012, + "a.out.js": 2293, + "a.out.js.gz": 1120, "a.out.nodebug.wasm": 64, "a.out.nodebug.wasm.gz": 80, - "total": 2044, - "total_gz": 1092, + "total": 2357, + "total_gz": 1200, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_minimal_Oz.json b/test/codesize/test_codesize_minimal_Oz.json index 5fe4c0860fef6..5e5fe75ccddcb 100644 --- a/test/codesize/test_codesize_minimal_Oz.json +++ b/test/codesize/test_codesize_minimal_Oz.json @@ -1,10 +1,10 @@ { - "a.out.js": 1998, - "a.out.js.gz": 1027, + "a.out.js": 2311, + "a.out.js.gz": 1133, "a.out.nodebug.wasm": 75, "a.out.nodebug.wasm.gz": 87, - "total": 2073, - "total_gz": 1114, + "total": 2386, + "total_gz": 1220, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_minimal_esm.json b/test/codesize/test_codesize_minimal_esm.json index fe01e4510c897..792de2bbf2aa2 100644 --- a/test/codesize/test_codesize_minimal_esm.json +++ b/test/codesize/test_codesize_minimal_esm.json @@ -1,10 +1,10 @@ { - "a.out.js": 2137, - "a.out.js.gz": 1050, + "a.out.js": 2442, + "a.out.js.gz": 1147, "a.out.nodebug.wasm": 75, "a.out.nodebug.wasm.gz": 87, - "total": 2212, - "total_gz": 1137, + "total": 2517, + "total_gz": 1234, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_minimal_pthreads.json b/test/codesize/test_codesize_minimal_pthreads.json index f897ee3214106..006d4854f3e16 100644 --- a/test/codesize/test_codesize_minimal_pthreads.json +++ b/test/codesize/test_codesize_minimal_pthreads.json @@ -1,10 +1,10 @@ { - "a.out.js": 6900, - "a.out.js.gz": 3432, + "a.out.js": 7213, + "a.out.js.gz": 3542, "a.out.nodebug.wasm": 19147, "a.out.nodebug.wasm.gz": 8834, - "total": 26047, - "total_gz": 12266, + "total": 26360, + "total_gz": 12376, "sent": [ "a (memory)", "b (exit)", diff --git a/test/codesize/test_codesize_minimal_wasmfs.json b/test/codesize/test_codesize_minimal_wasmfs.json index 5fe4c0860fef6..5e5fe75ccddcb 100644 --- a/test/codesize/test_codesize_minimal_wasmfs.json +++ b/test/codesize/test_codesize_minimal_wasmfs.json @@ -1,10 +1,10 @@ { - "a.out.js": 1998, - "a.out.js.gz": 1027, + "a.out.js": 2311, + "a.out.js.gz": 1133, "a.out.nodebug.wasm": 75, "a.out.nodebug.wasm.gz": 87, - "total": 2073, - "total_gz": 1114, + "total": 2386, + "total_gz": 1220, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_unoptimized_code_size.json b/test/codesize/test_unoptimized_code_size.json index a6bc588a5bc49..f5bbcbec3f53f 100644 --- a/test/codesize/test_unoptimized_code_size.json +++ b/test/codesize/test_unoptimized_code_size.json @@ -1,16 +1,16 @@ { - "hello_world.js": 54705, - "hello_world.js.gz": 17355, + "hello_world.js": 55732, + "hello_world.js.gz": 17629, "hello_world.wasm": 14279, "hello_world.wasm.gz": 7101, - "no_asserts.js": 23596, - "no_asserts.js.gz": 8277, + "no_asserts.js": 24623, + "no_asserts.js.gz": 8543, "no_asserts.wasm": 11393, "no_asserts.wasm.gz": 5646, - "strict.js": 51856, - "strict.js.gz": 16348, + "strict.js": 52883, + "strict.js.gz": 16625, "strict.wasm": 14279, "strict.wasm.gz": 7098, - "total": 170108, - "total_gz": 61825 + "total": 173189, + "total_gz": 62642 } From 9e9fa3b896a7cf585adaaec9a57a5e0d6f3b174b Mon Sep 17 00:00:00 2001 From: Jeremy Nguyen Date: Thu, 17 Sep 2026 06:58:24 +0000 Subject: [PATCH 07/10] Automatic rebaseline of codesize expectations. NFC This is an automatic change generated by tools/maint/rebaseline_tests.py. The following (13) test expectation files were updated by running the tests with `--rebaseline`: ``` codesize/test_codesize_cxx_except_wasm.json: 168663 => 168976 [+313 bytes / +0.19%] codesize/test_codesize_cxx_except_wasm_legacy.json: 166523 => 166836 [+313 bytes / +0.19%] codesize/test_codesize_cxx_lto.json: 119632 => 119945 [+313 bytes / +0.26%] test/codesize/test_codesize_file_preload.expected.js updated codesize/test_codesize_mem_O3_grow_standalone.json: 9306 => 9619 [+313 bytes / +3.36%] codesize/test_codesize_mem_O3_standalone.json: 9140 => 9453 [+313 bytes / +3.42%] codesize/test_codesize_mem_O3_standalone_lib.json: 8334 => 8647 [+313 bytes / +3.76%] codesize/test_codesize_mem_O3_standalone_narg.json: 8455 => 8768 [+313 bytes / +3.70%] codesize/test_codesize_mem_O3_standalone_narg_flto.json: 7386 => 7699 [+313 bytes / +4.24%] codesize/test_codesize_minimal_64.json: 2439 => 2751 [+312 bytes / +12.79%] test/codesize/test_codesize_minimal_O0.expected.js updated codesize/test_codesize_minimal_pthreads_memgrowth.json: 26506 => 26819 [+313 bytes / +1.18%] codesize/test_unoptimized_code_size.json: 173189 => 172730 [-459 bytes / -0.27%] Average change: +2.98% (-0.27% - +12.79%) ``` --- test/codesize/test_codesize_cxx_except_wasm.json | 8 ++++---- .../test_codesize_cxx_except_wasm_legacy.json | 8 ++++---- test/codesize/test_codesize_cxx_lto.json | 8 ++++---- .../test_codesize_file_preload.expected.js | 2 -- .../test_codesize_mem_O3_grow_standalone.json | 8 ++++---- .../test_codesize_mem_O3_standalone.json | 8 ++++---- .../test_codesize_mem_O3_standalone_lib.json | 8 ++++---- .../test_codesize_mem_O3_standalone_narg.json | 8 ++++---- ...est_codesize_mem_O3_standalone_narg_flto.json | 8 ++++---- test/codesize/test_codesize_minimal_64.json | 8 ++++---- .../test_codesize_minimal_O0.expected.js | 2 -- ...test_codesize_minimal_pthreads_memgrowth.json | 8 ++++---- test/codesize/test_unoptimized_code_size.json | 16 ++++++++-------- 13 files changed, 48 insertions(+), 52 deletions(-) diff --git a/test/codesize/test_codesize_cxx_except_wasm.json b/test/codesize/test_codesize_cxx_except_wasm.json index acce5eb08a6f9..9e6ffd01ad2fe 100644 --- a/test/codesize/test_codesize_cxx_except_wasm.json +++ b/test/codesize/test_codesize_cxx_except_wasm.json @@ -1,10 +1,10 @@ { - "a.out.js": 19023, - "a.out.js.gz": 8039, + "a.out.js": 19336, + "a.out.js.gz": 8147, "a.out.nodebug.wasm": 149640, "a.out.nodebug.wasm.gz": 56311, - "total": 168663, - "total_gz": 64350, + "total": 168976, + "total_gz": 64458, "sent": [ "_abort_js", "_tzset_js", diff --git a/test/codesize/test_codesize_cxx_except_wasm_legacy.json b/test/codesize/test_codesize_cxx_except_wasm_legacy.json index 7d2e3ac6023e4..8bc122344fe75 100644 --- a/test/codesize/test_codesize_cxx_except_wasm_legacy.json +++ b/test/codesize/test_codesize_cxx_except_wasm_legacy.json @@ -1,10 +1,10 @@ { - "a.out.js": 19101, - "a.out.js.gz": 8065, + "a.out.js": 19414, + "a.out.js.gz": 8171, "a.out.nodebug.wasm": 147422, "a.out.nodebug.wasm.gz": 55982, - "total": 166523, - "total_gz": 64047, + "total": 166836, + "total_gz": 64153, "sent": [ "_abort_js", "_tzset_js", diff --git a/test/codesize/test_codesize_cxx_lto.json b/test/codesize/test_codesize_cxx_lto.json index 5bf114b165af0..50cc9541fe6f2 100644 --- a/test/codesize/test_codesize_cxx_lto.json +++ b/test/codesize/test_codesize_cxx_lto.json @@ -1,10 +1,10 @@ { - "a.out.js": 18568, - "a.out.js.gz": 7818, + "a.out.js": 18881, + "a.out.js.gz": 7926, "a.out.nodebug.wasm": 101064, "a.out.nodebug.wasm.gz": 38292, - "total": 119632, - "total_gz": 46110, + "total": 119945, + "total_gz": 46218, "sent": [ "a (emscripten_resize_heap)", "b (_setitimer_js)", diff --git a/test/codesize/test_codesize_file_preload.expected.js b/test/codesize/test_codesize_file_preload.expected.js index 0c2b181af4815..629409bd096c3 100644 --- a/test/codesize/test_codesize_file_preload.expected.js +++ b/test/codesize/test_codesize_file_preload.expected.js @@ -435,8 +435,6 @@ async function instantiateAsync(binary, binaryFile, imports) { // See: https://github.com/emscripten-core/emscripten/pull/16917 try { var url = require("node:url"); - // `binaryFile` may be a `file://` URL string here; fs.createReadStream() - // needs an actual URL object (or a plain path), not a URL string. var nodeBinaryFile = isFileURI(binaryFile) ? url.fileURLToPath(binaryFile) : binaryFile; var response = fs.openAsBlob(nodeBinaryFile).then(blob => new Response(blob, { headers: { diff --git a/test/codesize/test_codesize_mem_O3_grow_standalone.json b/test/codesize/test_codesize_mem_O3_grow_standalone.json index bbf629f321167..64a24e9362235 100644 --- a/test/codesize/test_codesize_mem_O3_grow_standalone.json +++ b/test/codesize/test_codesize_mem_O3_grow_standalone.json @@ -1,10 +1,10 @@ { - "a.out.js": 3657, - "a.out.js.gz": 1834, + "a.out.js": 3970, + "a.out.js.gz": 1941, "a.out.nodebug.wasm": 5649, "a.out.nodebug.wasm.gz": 2669, - "total": 9306, - "total_gz": 4503, + "total": 9619, + "total_gz": 4610, "sent": [ "args_get", "args_sizes_get", diff --git a/test/codesize/test_codesize_mem_O3_standalone.json b/test/codesize/test_codesize_mem_O3_standalone.json index 61f177858fad1..2164254ecc577 100644 --- a/test/codesize/test_codesize_mem_O3_standalone.json +++ b/test/codesize/test_codesize_mem_O3_standalone.json @@ -1,10 +1,10 @@ { - "a.out.js": 3567, - "a.out.js.gz": 1784, + "a.out.js": 3880, + "a.out.js.gz": 1894, "a.out.nodebug.wasm": 5573, "a.out.nodebug.wasm.gz": 2608, - "total": 9140, - "total_gz": 4392, + "total": 9453, + "total_gz": 4502, "sent": [ "args_get", "args_sizes_get", diff --git a/test/codesize/test_codesize_mem_O3_standalone_lib.json b/test/codesize/test_codesize_mem_O3_standalone_lib.json index c12751084994c..6ca0f8a5dd7bf 100644 --- a/test/codesize/test_codesize_mem_O3_standalone_lib.json +++ b/test/codesize/test_codesize_mem_O3_standalone_lib.json @@ -1,10 +1,10 @@ { - "a.out.js": 3086, - "a.out.js.gz": 1523, + "a.out.js": 3399, + "a.out.js.gz": 1633, "a.out.nodebug.wasm": 5248, "a.out.nodebug.wasm.gz": 2368, - "total": 8334, - "total_gz": 3891, + "total": 8647, + "total_gz": 4001, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_mem_O3_standalone_narg.json b/test/codesize/test_codesize_mem_O3_standalone_narg.json index 34167a05ea85c..554ab022e6667 100644 --- a/test/codesize/test_codesize_mem_O3_standalone_narg.json +++ b/test/codesize/test_codesize_mem_O3_standalone_narg.json @@ -1,10 +1,10 @@ { - "a.out.js": 3093, - "a.out.js.gz": 1530, + "a.out.js": 3406, + "a.out.js.gz": 1644, "a.out.nodebug.wasm": 5362, "a.out.nodebug.wasm.gz": 2451, - "total": 8455, - "total_gz": 3981, + "total": 8768, + "total_gz": 4095, "sent": [ "proc_exit" ], diff --git a/test/codesize/test_codesize_mem_O3_standalone_narg_flto.json b/test/codesize/test_codesize_mem_O3_standalone_narg_flto.json index d1c92228a1005..32b1e6b5bcd02 100644 --- a/test/codesize/test_codesize_mem_O3_standalone_narg_flto.json +++ b/test/codesize/test_codesize_mem_O3_standalone_narg_flto.json @@ -1,10 +1,10 @@ { - "a.out.js": 3093, - "a.out.js.gz": 1530, + "a.out.js": 3406, + "a.out.js.gz": 1644, "a.out.nodebug.wasm": 4293, "a.out.nodebug.wasm.gz": 2147, - "total": 7386, - "total_gz": 3677, + "total": 7699, + "total_gz": 3791, "sent": [ "proc_exit" ], diff --git a/test/codesize/test_codesize_minimal_64.json b/test/codesize/test_codesize_minimal_64.json index 22e523cfc996e..0a105146af61b 100644 --- a/test/codesize/test_codesize_minimal_64.json +++ b/test/codesize/test_codesize_minimal_64.json @@ -1,10 +1,10 @@ { - "a.out.js": 2364, - "a.out.js.gz": 1155, + "a.out.js": 2676, + "a.out.js.gz": 1263, "a.out.nodebug.wasm": 75, "a.out.nodebug.wasm.gz": 88, - "total": 2439, - "total_gz": 1243, + "total": 2751, + "total_gz": 1351, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_minimal_O0.expected.js b/test/codesize/test_codesize_minimal_O0.expected.js index c078bba96b581..5d26c53cdc15d 100644 --- a/test/codesize/test_codesize_minimal_O0.expected.js +++ b/test/codesize/test_codesize_minimal_O0.expected.js @@ -674,8 +674,6 @@ async function instantiateAsync(binary, binaryFile, imports) { // See: https://github.com/emscripten-core/emscripten/pull/16917 try { var url = require('node:url'); - // `binaryFile` may be a `file://` URL string here; fs.createReadStream() - // needs an actual URL object (or a plain path), not a URL string. var nodeBinaryFile = isFileURI(binaryFile) ? url.fileURLToPath(binaryFile) : binaryFile; var response = fs.openAsBlob(nodeBinaryFile).then( (blob) => diff --git a/test/codesize/test_codesize_minimal_pthreads_memgrowth.json b/test/codesize/test_codesize_minimal_pthreads_memgrowth.json index 5124575dc3ca5..8ba67ef03cbcd 100644 --- a/test/codesize/test_codesize_minimal_pthreads_memgrowth.json +++ b/test/codesize/test_codesize_minimal_pthreads_memgrowth.json @@ -1,10 +1,10 @@ { - "a.out.js": 7358, - "a.out.js.gz": 3648, + "a.out.js": 7671, + "a.out.js.gz": 3759, "a.out.nodebug.wasm": 19148, "a.out.nodebug.wasm.gz": 8835, - "total": 26506, - "total_gz": 12483, + "total": 26819, + "total_gz": 12594, "sent": [ "a (memory)", "b (exit)", diff --git a/test/codesize/test_unoptimized_code_size.json b/test/codesize/test_unoptimized_code_size.json index f5bbcbec3f53f..c04999c1e81f3 100644 --- a/test/codesize/test_unoptimized_code_size.json +++ b/test/codesize/test_unoptimized_code_size.json @@ -1,16 +1,16 @@ { - "hello_world.js": 55732, - "hello_world.js.gz": 17629, + "hello_world.js": 55579, + "hello_world.js.gz": 17578, "hello_world.wasm": 14279, "hello_world.wasm.gz": 7101, - "no_asserts.js": 24623, - "no_asserts.js.gz": 8543, + "no_asserts.js": 24470, + "no_asserts.js.gz": 8493, "no_asserts.wasm": 11393, "no_asserts.wasm.gz": 5646, - "strict.js": 52883, - "strict.js.gz": 16625, + "strict.js": 52730, + "strict.js.gz": 16576, "strict.wasm": 14279, "strict.wasm.gz": 7098, - "total": 173189, - "total_gz": 62642 + "total": 172730, + "total_gz": 62492 } From 8b6d8aed95a015ba4030e74879801142d4232116 Mon Sep 17 00:00:00 2001 From: Jeremy Nguyen Date: Thu, 17 Sep 2026 09:10:56 +0000 Subject: [PATCH 08/10] chore: add fix for Bun Blob FileRef async instantiation --- src/postamble_minimal.js | 2 +- src/preamble.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/postamble_minimal.js b/src/postamble_minimal.js index 86d7795c9acb4..7033a7a15c11b 100644 --- a/src/postamble_minimal.js +++ b/src/postamble_minimal.js @@ -217,7 +217,7 @@ instantiatePromise = ? WebAssembly.instantiateStreaming( require('node:fs') .openAsBlob({{{ nodeWasmPath }}}) - .then((blob) => new Response(blob, { headers: { 'Content-Type': 'application/wasm' } })), + .then((blob) => new Response(blob.stream(), { headers: { 'Content-Type': 'application/wasm' } })), imports, ) : WebAssembly.instantiateStreaming(fetch({{{ moduleUrl }}}), imports)) diff --git a/src/preamble.js b/src/preamble.js index 40cd1dbe0d539..84b53facded61 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -740,7 +740,7 @@ async function instantiateAsync(binary, binaryFile, imports) { var nodeBinaryFile = isFileURI(binaryFile) ? url.fileURLToPath(binaryFile) : binaryFile; var response = fs.openAsBlob(nodeBinaryFile).then( (blob) => - new Response(blob, { + new Response(blob.stream(), { headers: { 'Content-Type': 'application/wasm' }, }), ); From 2fde3e0caeb95f6631b9ea942003b3d6e220acee Mon Sep 17 00:00:00 2001 From: Jeremy Nguyen Date: Thu, 17 Sep 2026 09:15:53 +0000 Subject: [PATCH 09/10] Add Blob.prototype.stream() closure extern --- src/closure-externs/closure-externs.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/closure-externs/closure-externs.js b/src/closure-externs/closure-externs.js index 54484b15cca31..20f1126daa77d 100644 --- a/src/closure-externs/closure-externs.js +++ b/src/closure-externs/closure-externs.js @@ -214,3 +214,8 @@ ArrayBuffer.prototype.resizable; /** @type {boolean} */ SharedArrayBuffer.prototype.growable; + +/** + * @return {!ReadableStream} + */ +Blob.prototype.stream = function() {}; From c7e33501ae0f6a2f9bfba35f1ffe5a69569741f5 Mon Sep 17 00:00:00 2001 From: Jeremy Nguyen Date: Thu, 17 Sep 2026 09:17:55 +0000 Subject: [PATCH 10/10] Automatic rebaseline of codesize expectations. NFC This is an automatic change generated by tools/maint/rebaseline_tests.py. The following (46) test expectation files were updated by running the tests with `--rebaseline`: ``` codesize/test_codesize_cxx_ctors1.json: 153508 => 153517 [+9 bytes / +0.01%] codesize/test_codesize_cxx_ctors2.json: 152917 => 152926 [+9 bytes / +0.01%] codesize/test_codesize_cxx_except.json: 199612 => 199621 [+9 bytes / +0.00%] codesize/test_codesize_cxx_except_wasm.json: 168976 => 168985 [+9 bytes / +0.01%] codesize/test_codesize_cxx_except_wasm_legacy.json: 166836 => 166845 [+9 bytes / +0.01%] codesize/test_codesize_cxx_lto.json: 119945 => 119954 [+9 bytes / +0.01%] codesize/test_codesize_cxx_mangle.json: 265942 => 265951 [+9 bytes / +0.00%] codesize/test_codesize_cxx_noexcept.json: 155419 => 155428 [+9 bytes / +0.01%] codesize/test_codesize_cxx_wasmfs.json: 180524 => 180533 [+9 bytes / +0.00%] test/codesize/test_codesize_file_preload.expected.js updated codesize/test_codesize_file_preload.json: 23714 => 23723 [+9 bytes / +0.04%] codesize/test_codesize_files_js_fs.json: 18565 => 18574 [+9 bytes / +0.05%] codesize/test_codesize_files_wasmfs.json: 63544 => 63553 [+9 bytes / +0.01%] codesize/test_codesize_hello_O0.json: 38265 => 38274 [+9 bytes / +0.02%] codesize/test_codesize_hello_O1.json: 7956 => 7965 [+9 bytes / +0.11%] codesize/test_codesize_hello_O2.json: 5611 => 5620 [+9 bytes / +0.16%] codesize/test_codesize_hello_O3.json: 5307 => 5316 [+9 bytes / +0.17%] codesize/test_codesize_hello_Os.json: 5297 => 5306 [+9 bytes / +0.17%] codesize/test_codesize_hello_Oz.json: 4935 => 4944 [+9 bytes / +0.18%] codesize/test_codesize_hello_dylink.json: 43494 => 43503 [+9 bytes / +0.02%] codesize/test_codesize_hello_dylink_all.json: 859299 => 859308 [+9 bytes / +0.00%] codesize/test_codesize_hello_export_nothing.json: 2998 => 3007 [+9 bytes / +0.30%] codesize/test_codesize_hello_wasmfs.json: 5307 => 5316 [+9 bytes / +0.17%] codesize/test_codesize_libcxxabi_message_O3.json: 3411 => 3420 [+9 bytes / +0.26%] codesize/test_codesize_libcxxabi_message_O3_standalone.json: 3628 => 3637 [+9 bytes / +0.25%] codesize/test_codesize_mem_O3.json: 9455 => 9464 [+9 bytes / +0.10%] codesize/test_codesize_mem_O3_grow.json: 9791 => 9800 [+9 bytes / +0.09%] codesize/test_codesize_mem_O3_grow_standalone.json: 9619 => 9628 [+9 bytes / +0.09%] codesize/test_codesize_mem_O3_standalone.json: 9453 => 9462 [+9 bytes / +0.10%] codesize/test_codesize_mem_O3_standalone_lib.json: 8647 => 8656 [+9 bytes / +0.10%] codesize/test_codesize_mem_O3_standalone_narg.json: 8768 => 8777 [+9 bytes / +0.10%] codesize/test_codesize_mem_O3_standalone_narg_flto.json: 7699 => 7708 [+9 bytes / +0.12%] codesize/test_codesize_minimal_64.json: 2751 => 2760 [+9 bytes / +0.33%] test/codesize/test_codesize_minimal_O0.expected.js updated codesize/test_codesize_minimal_O0.json: 20262 => 20271 [+9 bytes / +0.04%] codesize/test_codesize_minimal_O1.json: 3565 => 3574 [+9 bytes / +0.25%] codesize/test_codesize_minimal_O2.json: 2691 => 2700 [+9 bytes / +0.33%] codesize/test_codesize_minimal_O3.json: 2386 => 2395 [+9 bytes / +0.38%] codesize/test_codesize_minimal_Os.json: 2386 => 2395 [+9 bytes / +0.38%] codesize/test_codesize_minimal_Oz-ctors.json: 2357 => 2366 [+9 bytes / +0.38%] codesize/test_codesize_minimal_Oz.json: 2386 => 2395 [+9 bytes / +0.38%] codesize/test_codesize_minimal_esm.json: 2517 => 2526 [+9 bytes / +0.36%] codesize/test_codesize_minimal_pthreads.json: 26360 => 26369 [+9 bytes / +0.03%] codesize/test_codesize_minimal_pthreads_memgrowth.json: 26819 => 26828 [+9 bytes / +0.03%] codesize/test_codesize_minimal_wasmfs.json: 2386 => 2395 [+9 bytes / +0.38%] codesize/test_unoptimized_code_size.json: 172730 => 172757 [+27 bytes / +0.02%] Average change: +0.14% (+0.00% - +0.38%) ``` --- test/codesize/test_codesize_cxx_ctors1.json | 8 ++++---- test/codesize/test_codesize_cxx_ctors2.json | 8 ++++---- test/codesize/test_codesize_cxx_except.json | 8 ++++---- test/codesize/test_codesize_cxx_except_wasm.json | 8 ++++---- .../test_codesize_cxx_except_wasm_legacy.json | 8 ++++---- test/codesize/test_codesize_cxx_lto.json | 8 ++++---- test/codesize/test_codesize_cxx_mangle.json | 8 ++++---- test/codesize/test_codesize_cxx_noexcept.json | 8 ++++---- test/codesize/test_codesize_cxx_wasmfs.json | 8 ++++---- .../test_codesize_file_preload.expected.js | 2 +- test/codesize/test_codesize_file_preload.json | 8 ++++---- test/codesize/test_codesize_files_js_fs.json | 8 ++++---- test/codesize/test_codesize_files_wasmfs.json | 8 ++++---- test/codesize/test_codesize_hello_O0.json | 8 ++++---- test/codesize/test_codesize_hello_O1.json | 8 ++++---- test/codesize/test_codesize_hello_O2.json | 8 ++++---- test/codesize/test_codesize_hello_O3.json | 8 ++++---- test/codesize/test_codesize_hello_Os.json | 8 ++++---- test/codesize/test_codesize_hello_Oz.json | 8 ++++---- test/codesize/test_codesize_hello_dylink.json | 8 ++++---- .../codesize/test_codesize_hello_dylink_all.json | 4 ++-- .../test_codesize_hello_export_nothing.json | 8 ++++---- test/codesize/test_codesize_hello_wasmfs.json | 8 ++++---- .../test_codesize_libcxxabi_message_O3.json | 8 ++++---- ...codesize_libcxxabi_message_O3_standalone.json | 8 ++++---- test/codesize/test_codesize_mem_O3.json | 8 ++++---- test/codesize/test_codesize_mem_O3_grow.json | 8 ++++---- .../test_codesize_mem_O3_grow_standalone.json | 8 ++++---- .../test_codesize_mem_O3_standalone.json | 8 ++++---- .../test_codesize_mem_O3_standalone_lib.json | 8 ++++---- .../test_codesize_mem_O3_standalone_narg.json | 8 ++++---- ...est_codesize_mem_O3_standalone_narg_flto.json | 8 ++++---- test/codesize/test_codesize_minimal_64.json | 8 ++++---- .../test_codesize_minimal_O0.expected.js | 2 +- test/codesize/test_codesize_minimal_O0.json | 8 ++++---- test/codesize/test_codesize_minimal_O1.json | 8 ++++---- test/codesize/test_codesize_minimal_O2.json | 8 ++++---- test/codesize/test_codesize_minimal_O3.json | 8 ++++---- test/codesize/test_codesize_minimal_Os.json | 8 ++++---- .../codesize/test_codesize_minimal_Oz-ctors.json | 8 ++++---- test/codesize/test_codesize_minimal_Oz.json | 8 ++++---- test/codesize/test_codesize_minimal_esm.json | 8 ++++---- .../codesize/test_codesize_minimal_pthreads.json | 8 ++++---- ...test_codesize_minimal_pthreads_memgrowth.json | 8 ++++---- test/codesize/test_codesize_minimal_wasmfs.json | 8 ++++---- test/codesize/test_unoptimized_code_size.json | 16 ++++++++-------- 46 files changed, 180 insertions(+), 180 deletions(-) diff --git a/test/codesize/test_codesize_cxx_ctors1.json b/test/codesize/test_codesize_cxx_ctors1.json index 73481eedb0259..536f31b502053 100644 --- a/test/codesize/test_codesize_cxx_ctors1.json +++ b/test/codesize/test_codesize_cxx_ctors1.json @@ -1,10 +1,10 @@ { - "a.out.js": 19537, - "a.out.js.gz": 8228, + "a.out.js": 19546, + "a.out.js.gz": 8232, "a.out.nodebug.wasm": 133971, "a.out.nodebug.wasm.gz": 51271, - "total": 153508, - "total_gz": 59499, + "total": 153517, + "total_gz": 59503, "sent": [ "__cxa_throw", "_abort_js", diff --git a/test/codesize/test_codesize_cxx_ctors2.json b/test/codesize/test_codesize_cxx_ctors2.json index 84ef60890cab7..d6256808f4015 100644 --- a/test/codesize/test_codesize_cxx_ctors2.json +++ b/test/codesize/test_codesize_cxx_ctors2.json @@ -1,10 +1,10 @@ { - "a.out.js": 19514, - "a.out.js.gz": 8211, + "a.out.js": 19523, + "a.out.js.gz": 8215, "a.out.nodebug.wasm": 133403, "a.out.nodebug.wasm.gz": 50959, - "total": 152917, - "total_gz": 59170, + "total": 152926, + "total_gz": 59174, "sent": [ "__cxa_throw", "_abort_js", diff --git a/test/codesize/test_codesize_cxx_except.json b/test/codesize/test_codesize_cxx_except.json index 6e193e20aea54..20cfd3e84d81c 100644 --- a/test/codesize/test_codesize_cxx_except.json +++ b/test/codesize/test_codesize_cxx_except.json @@ -1,10 +1,10 @@ { - "a.out.js": 23229, - "a.out.js.gz": 9190, + "a.out.js": 23238, + "a.out.js.gz": 9194, "a.out.nodebug.wasm": 176383, "a.out.nodebug.wasm.gz": 58776, - "total": 199612, - "total_gz": 67966, + "total": 199621, + "total_gz": 67970, "sent": [ "__cxa_begin_catch", "__cxa_end_catch", diff --git a/test/codesize/test_codesize_cxx_except_wasm.json b/test/codesize/test_codesize_cxx_except_wasm.json index 9e6ffd01ad2fe..8959a9ee486fb 100644 --- a/test/codesize/test_codesize_cxx_except_wasm.json +++ b/test/codesize/test_codesize_cxx_except_wasm.json @@ -1,10 +1,10 @@ { - "a.out.js": 19336, - "a.out.js.gz": 8147, + "a.out.js": 19345, + "a.out.js.gz": 8151, "a.out.nodebug.wasm": 149640, "a.out.nodebug.wasm.gz": 56311, - "total": 168976, - "total_gz": 64458, + "total": 168985, + "total_gz": 64462, "sent": [ "_abort_js", "_tzset_js", diff --git a/test/codesize/test_codesize_cxx_except_wasm_legacy.json b/test/codesize/test_codesize_cxx_except_wasm_legacy.json index 8bc122344fe75..a0bdc5ed08a98 100644 --- a/test/codesize/test_codesize_cxx_except_wasm_legacy.json +++ b/test/codesize/test_codesize_cxx_except_wasm_legacy.json @@ -1,10 +1,10 @@ { - "a.out.js": 19414, - "a.out.js.gz": 8171, + "a.out.js": 19423, + "a.out.js.gz": 8174, "a.out.nodebug.wasm": 147422, "a.out.nodebug.wasm.gz": 55982, - "total": 166836, - "total_gz": 64153, + "total": 166845, + "total_gz": 64156, "sent": [ "_abort_js", "_tzset_js", diff --git a/test/codesize/test_codesize_cxx_lto.json b/test/codesize/test_codesize_cxx_lto.json index 50cc9541fe6f2..ee0d9a34b1358 100644 --- a/test/codesize/test_codesize_cxx_lto.json +++ b/test/codesize/test_codesize_cxx_lto.json @@ -1,10 +1,10 @@ { - "a.out.js": 18881, - "a.out.js.gz": 7926, + "a.out.js": 18890, + "a.out.js.gz": 7931, "a.out.nodebug.wasm": 101064, "a.out.nodebug.wasm.gz": 38292, - "total": 119945, - "total_gz": 46218, + "total": 119954, + "total_gz": 46223, "sent": [ "a (emscripten_resize_heap)", "b (_setitimer_js)", diff --git a/test/codesize/test_codesize_cxx_mangle.json b/test/codesize/test_codesize_cxx_mangle.json index 88b377df1b5e0..545ac3d1d0e2e 100644 --- a/test/codesize/test_codesize_cxx_mangle.json +++ b/test/codesize/test_codesize_cxx_mangle.json @@ -1,10 +1,10 @@ { - "a.out.js": 23279, - "a.out.js.gz": 9210, + "a.out.js": 23288, + "a.out.js.gz": 9214, "a.out.nodebug.wasm": 242663, "a.out.nodebug.wasm.gz": 81001, - "total": 265942, - "total_gz": 90211, + "total": 265951, + "total_gz": 90215, "sent": [ "__cxa_begin_catch", "__cxa_end_catch", diff --git a/test/codesize/test_codesize_cxx_noexcept.json b/test/codesize/test_codesize_cxx_noexcept.json index 16ae5a73eefe8..6988c47d39d40 100644 --- a/test/codesize/test_codesize_cxx_noexcept.json +++ b/test/codesize/test_codesize_cxx_noexcept.json @@ -1,10 +1,10 @@ { - "a.out.js": 19537, - "a.out.js.gz": 8228, + "a.out.js": 19546, + "a.out.js.gz": 8232, "a.out.nodebug.wasm": 135882, "a.out.nodebug.wasm.gz": 51885, - "total": 155419, - "total_gz": 60113, + "total": 155428, + "total_gz": 60117, "sent": [ "__cxa_throw", "_abort_js", diff --git a/test/codesize/test_codesize_cxx_wasmfs.json b/test/codesize/test_codesize_cxx_wasmfs.json index eb11692da0d66..2af66e642002b 100644 --- a/test/codesize/test_codesize_cxx_wasmfs.json +++ b/test/codesize/test_codesize_cxx_wasmfs.json @@ -1,10 +1,10 @@ { - "a.out.js": 6917, - "a.out.js.gz": 3266, + "a.out.js": 6926, + "a.out.js.gz": 3270, "a.out.nodebug.wasm": 173607, "a.out.nodebug.wasm.gz": 64636, - "total": 180524, - "total_gz": 67902, + "total": 180533, + "total_gz": 67906, "sent": [ "__cxa_throw", "_abort_js", diff --git a/test/codesize/test_codesize_file_preload.expected.js b/test/codesize/test_codesize_file_preload.expected.js index 629409bd096c3..a2d2f87a194db 100644 --- a/test/codesize/test_codesize_file_preload.expected.js +++ b/test/codesize/test_codesize_file_preload.expected.js @@ -436,7 +436,7 @@ async function instantiateAsync(binary, binaryFile, imports) { try { var url = require("node:url"); var nodeBinaryFile = isFileURI(binaryFile) ? url.fileURLToPath(binaryFile) : binaryFile; - var response = fs.openAsBlob(nodeBinaryFile).then(blob => new Response(blob, { + var response = fs.openAsBlob(nodeBinaryFile).then(blob => new Response(blob.stream(), { headers: { "Content-Type": "application/wasm" } diff --git a/test/codesize/test_codesize_file_preload.json b/test/codesize/test_codesize_file_preload.json index 43317ff697486..ed326d938c155 100644 --- a/test/codesize/test_codesize_file_preload.json +++ b/test/codesize/test_codesize_file_preload.json @@ -1,10 +1,10 @@ { - "a.out.js": 22516, - "a.out.js.gz": 9367, + "a.out.js": 22525, + "a.out.js.gz": 9372, "a.out.nodebug.wasm": 1198, "a.out.nodebug.wasm.gz": 730, - "total": 23714, - "total_gz": 10097, + "total": 23723, + "total_gz": 10102, "sent": [ "a (fd_write)" ], diff --git a/test/codesize/test_codesize_files_js_fs.json b/test/codesize/test_codesize_files_js_fs.json index 283102bf88ef1..3317f62590734 100644 --- a/test/codesize/test_codesize_files_js_fs.json +++ b/test/codesize/test_codesize_files_js_fs.json @@ -1,10 +1,10 @@ { - "a.out.js": 18184, - "a.out.js.gz": 7571, + "a.out.js": 18193, + "a.out.js.gz": 7575, "a.out.nodebug.wasm": 381, "a.out.nodebug.wasm.gz": 258, - "total": 18565, - "total_gz": 7829, + "total": 18574, + "total_gz": 7833, "sent": [ "a (fd_write)", "b (fd_read)", diff --git a/test/codesize/test_codesize_files_wasmfs.json b/test/codesize/test_codesize_files_wasmfs.json index b13bf04e5d57c..cd7fb05aadf75 100644 --- a/test/codesize/test_codesize_files_wasmfs.json +++ b/test/codesize/test_codesize_files_wasmfs.json @@ -1,10 +1,10 @@ { - "a.out.js": 5292, - "a.out.js.gz": 2518, + "a.out.js": 5301, + "a.out.js.gz": 2523, "a.out.nodebug.wasm": 58252, "a.out.nodebug.wasm.gz": 18292, - "total": 63544, - "total_gz": 20810, + "total": 63553, + "total_gz": 20815, "sent": [ "a (emscripten_date_now)", "b (emscripten_err)", diff --git a/test/codesize/test_codesize_hello_O0.json b/test/codesize/test_codesize_hello_O0.json index 1eeafbede4ea4..8aacacc638840 100644 --- a/test/codesize/test_codesize_hello_O0.json +++ b/test/codesize/test_codesize_hello_O0.json @@ -1,10 +1,10 @@ { - "a.out.js": 23986, - "a.out.js.gz": 8693, + "a.out.js": 23995, + "a.out.js.gz": 8698, "a.out.nodebug.wasm": 14279, "a.out.nodebug.wasm.gz": 7101, - "total": 38265, - "total_gz": 15794, + "total": 38274, + "total_gz": 15799, "sent": [ "fd_write" ], diff --git a/test/codesize/test_codesize_hello_O1.json b/test/codesize/test_codesize_hello_O1.json index 250f3156133d0..78b35ab452bb9 100644 --- a/test/codesize/test_codesize_hello_O1.json +++ b/test/codesize/test_codesize_hello_O1.json @@ -1,10 +1,10 @@ { - "a.out.js": 5906, - "a.out.js.gz": 2362, + "a.out.js": 5915, + "a.out.js.gz": 2366, "a.out.nodebug.wasm": 2050, "a.out.nodebug.wasm.gz": 1231, - "total": 7956, - "total_gz": 3593, + "total": 7965, + "total_gz": 3597, "sent": [ "fd_write" ], diff --git a/test/codesize/test_codesize_hello_O2.json b/test/codesize/test_codesize_hello_O2.json index eec9003ffd44c..30e76b1f37351 100644 --- a/test/codesize/test_codesize_hello_O2.json +++ b/test/codesize/test_codesize_hello_O2.json @@ -1,10 +1,10 @@ { - "a.out.js": 4167, - "a.out.js.gz": 2074, + "a.out.js": 4176, + "a.out.js.gz": 2078, "a.out.nodebug.wasm": 1444, "a.out.nodebug.wasm.gz": 922, - "total": 5611, - "total_gz": 2996, + "total": 5620, + "total_gz": 3000, "sent": [ "fd_write" ], diff --git a/test/codesize/test_codesize_hello_O3.json b/test/codesize/test_codesize_hello_O3.json index 031ad28c2a93a..75778b81fe942 100644 --- a/test/codesize/test_codesize_hello_O3.json +++ b/test/codesize/test_codesize_hello_O3.json @@ -1,10 +1,10 @@ { - "a.out.js": 4109, - "a.out.js.gz": 2032, + "a.out.js": 4118, + "a.out.js.gz": 2036, "a.out.nodebug.wasm": 1198, "a.out.nodebug.wasm.gz": 730, - "total": 5307, - "total_gz": 2762, + "total": 5316, + "total_gz": 2766, "sent": [ "a (fd_write)" ], diff --git a/test/codesize/test_codesize_hello_Os.json b/test/codesize/test_codesize_hello_Os.json index 5ad549ec98057..7c5848683838b 100644 --- a/test/codesize/test_codesize_hello_Os.json +++ b/test/codesize/test_codesize_hello_Os.json @@ -1,10 +1,10 @@ { - "a.out.js": 4109, - "a.out.js.gz": 2032, + "a.out.js": 4118, + "a.out.js.gz": 2036, "a.out.nodebug.wasm": 1188, "a.out.nodebug.wasm.gz": 732, - "total": 5297, - "total_gz": 2764, + "total": 5306, + "total_gz": 2768, "sent": [ "a (fd_write)" ], diff --git a/test/codesize/test_codesize_hello_Oz.json b/test/codesize/test_codesize_hello_Oz.json index be0167c6799ff..e73679e7a4985 100644 --- a/test/codesize/test_codesize_hello_Oz.json +++ b/test/codesize/test_codesize_hello_Oz.json @@ -1,10 +1,10 @@ { - "a.out.js": 3747, - "a.out.js.gz": 1837, + "a.out.js": 3756, + "a.out.js.gz": 1842, "a.out.nodebug.wasm": 1188, "a.out.nodebug.wasm.gz": 732, - "total": 4935, - "total_gz": 2569, + "total": 4944, + "total_gz": 2574, "sent": [ "a (fd_write)" ], diff --git a/test/codesize/test_codesize_hello_dylink.json b/test/codesize/test_codesize_hello_dylink.json index 426ce2dac2f69..de302b2298d9e 100644 --- a/test/codesize/test_codesize_hello_dylink.json +++ b/test/codesize/test_codesize_hello_dylink.json @@ -1,10 +1,10 @@ { - "a.out.js": 26502, - "a.out.js.gz": 11285, + "a.out.js": 26511, + "a.out.js.gz": 11289, "a.out.nodebug.wasm": 16992, "a.out.nodebug.wasm.gz": 8679, - "total": 43494, - "total_gz": 19964, + "total": 43503, + "total_gz": 19968, "sent": [ "__syscall_stat64", "emscripten_resize_heap", diff --git a/test/codesize/test_codesize_hello_dylink_all.json b/test/codesize/test_codesize_hello_dylink_all.json index 36625fa688ace..1fa53754171a1 100644 --- a/test/codesize/test_codesize_hello_dylink_all.json +++ b/test/codesize/test_codesize_hello_dylink_all.json @@ -1,7 +1,7 @@ { - "a.out.js": 271010, + "a.out.js": 271019, "a.out.nodebug.wasm": 588289, - "total": 859299, + "total": 859308, "sent": [ "IMG_Init", "IMG_Load", diff --git a/test/codesize/test_codesize_hello_export_nothing.json b/test/codesize/test_codesize_hello_export_nothing.json index b3551852c6610..d8fd623e58cc8 100644 --- a/test/codesize/test_codesize_hello_export_nothing.json +++ b/test/codesize/test_codesize_hello_export_nothing.json @@ -1,10 +1,10 @@ { - "a.out.js": 2955, - "a.out.js.gz": 1400, + "a.out.js": 2964, + "a.out.js.gz": 1404, "a.out.nodebug.wasm": 43, "a.out.nodebug.wasm.gz": 59, - "total": 2998, - "total_gz": 1459, + "total": 3007, + "total_gz": 1463, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_hello_wasmfs.json b/test/codesize/test_codesize_hello_wasmfs.json index 031ad28c2a93a..75778b81fe942 100644 --- a/test/codesize/test_codesize_hello_wasmfs.json +++ b/test/codesize/test_codesize_hello_wasmfs.json @@ -1,10 +1,10 @@ { - "a.out.js": 4109, - "a.out.js.gz": 2032, + "a.out.js": 4118, + "a.out.js.gz": 2036, "a.out.nodebug.wasm": 1198, "a.out.nodebug.wasm.gz": 730, - "total": 5307, - "total_gz": 2762, + "total": 5316, + "total_gz": 2766, "sent": [ "a (fd_write)" ], diff --git a/test/codesize/test_codesize_libcxxabi_message_O3.json b/test/codesize/test_codesize_libcxxabi_message_O3.json index 4b9aacec71a12..ce50074a8c1e1 100644 --- a/test/codesize/test_codesize_libcxxabi_message_O3.json +++ b/test/codesize/test_codesize_libcxxabi_message_O3.json @@ -1,10 +1,10 @@ { - "a.out.js": 3322, - "a.out.js.gz": 1587, + "a.out.js": 3331, + "a.out.js.gz": 1591, "a.out.nodebug.wasm": 89, "a.out.nodebug.wasm.gz": 98, - "total": 3411, - "total_gz": 1685, + "total": 3420, + "total_gz": 1689, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_libcxxabi_message_O3_standalone.json b/test/codesize/test_codesize_libcxxabi_message_O3_standalone.json index 012e2b9b7959a..d25a95beeb928 100644 --- a/test/codesize/test_codesize_libcxxabi_message_O3_standalone.json +++ b/test/codesize/test_codesize_libcxxabi_message_O3_standalone.json @@ -1,10 +1,10 @@ { - "a.out.js": 3406, - "a.out.js.gz": 1644, + "a.out.js": 3415, + "a.out.js.gz": 1648, "a.out.nodebug.wasm": 222, "a.out.nodebug.wasm.gz": 206, - "total": 3628, - "total_gz": 1850, + "total": 3637, + "total_gz": 1854, "sent": [ "proc_exit" ], diff --git a/test/codesize/test_codesize_mem_O3.json b/test/codesize/test_codesize_mem_O3.json index d175036894bac..4ef3ea96eca4d 100644 --- a/test/codesize/test_codesize_mem_O3.json +++ b/test/codesize/test_codesize_mem_O3.json @@ -1,10 +1,10 @@ { - "a.out.js": 4187, - "a.out.js.gz": 2033, + "a.out.js": 4196, + "a.out.js.gz": 2038, "a.out.nodebug.wasm": 5268, "a.out.nodebug.wasm.gz": 2433, - "total": 9455, - "total_gz": 4466, + "total": 9464, + "total_gz": 4471, "sent": [ "a (emscripten_resize_heap)" ], diff --git a/test/codesize/test_codesize_mem_O3_grow.json b/test/codesize/test_codesize_mem_O3_grow.json index 9dd0600157add..b82aa14f6886b 100644 --- a/test/codesize/test_codesize_mem_O3_grow.json +++ b/test/codesize/test_codesize_mem_O3_grow.json @@ -1,10 +1,10 @@ { - "a.out.js": 4522, - "a.out.js.gz": 2210, + "a.out.js": 4531, + "a.out.js.gz": 2214, "a.out.nodebug.wasm": 5269, "a.out.nodebug.wasm.gz": 2433, - "total": 9791, - "total_gz": 4643, + "total": 9800, + "total_gz": 4647, "sent": [ "a (emscripten_resize_heap)" ], diff --git a/test/codesize/test_codesize_mem_O3_grow_standalone.json b/test/codesize/test_codesize_mem_O3_grow_standalone.json index 64a24e9362235..0f5433d8b37d1 100644 --- a/test/codesize/test_codesize_mem_O3_grow_standalone.json +++ b/test/codesize/test_codesize_mem_O3_grow_standalone.json @@ -1,10 +1,10 @@ { - "a.out.js": 3970, - "a.out.js.gz": 1941, + "a.out.js": 3979, + "a.out.js.gz": 1945, "a.out.nodebug.wasm": 5649, "a.out.nodebug.wasm.gz": 2669, - "total": 9619, - "total_gz": 4610, + "total": 9628, + "total_gz": 4614, "sent": [ "args_get", "args_sizes_get", diff --git a/test/codesize/test_codesize_mem_O3_standalone.json b/test/codesize/test_codesize_mem_O3_standalone.json index 2164254ecc577..507f6e1ec4671 100644 --- a/test/codesize/test_codesize_mem_O3_standalone.json +++ b/test/codesize/test_codesize_mem_O3_standalone.json @@ -1,10 +1,10 @@ { - "a.out.js": 3880, - "a.out.js.gz": 1894, + "a.out.js": 3889, + "a.out.js.gz": 1898, "a.out.nodebug.wasm": 5573, "a.out.nodebug.wasm.gz": 2608, - "total": 9453, - "total_gz": 4502, + "total": 9462, + "total_gz": 4506, "sent": [ "args_get", "args_sizes_get", diff --git a/test/codesize/test_codesize_mem_O3_standalone_lib.json b/test/codesize/test_codesize_mem_O3_standalone_lib.json index 6ca0f8a5dd7bf..1da1e504666bc 100644 --- a/test/codesize/test_codesize_mem_O3_standalone_lib.json +++ b/test/codesize/test_codesize_mem_O3_standalone_lib.json @@ -1,10 +1,10 @@ { - "a.out.js": 3399, - "a.out.js.gz": 1633, + "a.out.js": 3408, + "a.out.js.gz": 1637, "a.out.nodebug.wasm": 5248, "a.out.nodebug.wasm.gz": 2368, - "total": 8647, - "total_gz": 4001, + "total": 8656, + "total_gz": 4005, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_mem_O3_standalone_narg.json b/test/codesize/test_codesize_mem_O3_standalone_narg.json index 554ab022e6667..78c558d46ec36 100644 --- a/test/codesize/test_codesize_mem_O3_standalone_narg.json +++ b/test/codesize/test_codesize_mem_O3_standalone_narg.json @@ -1,10 +1,10 @@ { - "a.out.js": 3406, - "a.out.js.gz": 1644, + "a.out.js": 3415, + "a.out.js.gz": 1648, "a.out.nodebug.wasm": 5362, "a.out.nodebug.wasm.gz": 2451, - "total": 8768, - "total_gz": 4095, + "total": 8777, + "total_gz": 4099, "sent": [ "proc_exit" ], diff --git a/test/codesize/test_codesize_mem_O3_standalone_narg_flto.json b/test/codesize/test_codesize_mem_O3_standalone_narg_flto.json index 32b1e6b5bcd02..803ccbeb139ac 100644 --- a/test/codesize/test_codesize_mem_O3_standalone_narg_flto.json +++ b/test/codesize/test_codesize_mem_O3_standalone_narg_flto.json @@ -1,10 +1,10 @@ { - "a.out.js": 3406, - "a.out.js.gz": 1644, + "a.out.js": 3415, + "a.out.js.gz": 1648, "a.out.nodebug.wasm": 4293, "a.out.nodebug.wasm.gz": 2147, - "total": 7699, - "total_gz": 3791, + "total": 7708, + "total_gz": 3795, "sent": [ "proc_exit" ], diff --git a/test/codesize/test_codesize_minimal_64.json b/test/codesize/test_codesize_minimal_64.json index 0a105146af61b..d83b72d54d316 100644 --- a/test/codesize/test_codesize_minimal_64.json +++ b/test/codesize/test_codesize_minimal_64.json @@ -1,10 +1,10 @@ { - "a.out.js": 2676, - "a.out.js.gz": 1263, + "a.out.js": 2685, + "a.out.js.gz": 1267, "a.out.nodebug.wasm": 75, "a.out.nodebug.wasm.gz": 88, - "total": 2751, - "total_gz": 1351, + "total": 2760, + "total_gz": 1355, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_minimal_O0.expected.js b/test/codesize/test_codesize_minimal_O0.expected.js index 5d26c53cdc15d..d09fbd9b8b270 100644 --- a/test/codesize/test_codesize_minimal_O0.expected.js +++ b/test/codesize/test_codesize_minimal_O0.expected.js @@ -677,7 +677,7 @@ async function instantiateAsync(binary, binaryFile, imports) { var nodeBinaryFile = isFileURI(binaryFile) ? url.fileURLToPath(binaryFile) : binaryFile; var response = fs.openAsBlob(nodeBinaryFile).then( (blob) => - new Response(blob, { + new Response(blob.stream(), { headers: { 'Content-Type': 'application/wasm' }, }), ); diff --git a/test/codesize/test_codesize_minimal_O0.json b/test/codesize/test_codesize_minimal_O0.json index 148ef2413b57e..047d4d2550008 100644 --- a/test/codesize/test_codesize_minimal_O0.json +++ b/test/codesize/test_codesize_minimal_O0.json @@ -1,10 +1,10 @@ { - "a.out.js": 19191, - "a.out.js.gz": 6875, + "a.out.js": 19200, + "a.out.js.gz": 6879, "a.out.nodebug.wasm": 1071, "a.out.nodebug.wasm.gz": 636, - "total": 20262, - "total_gz": 7511, + "total": 20271, + "total_gz": 7515, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_minimal_O1.json b/test/codesize/test_codesize_minimal_O1.json index 8a88ecc99a40d..6bd0957a3902d 100644 --- a/test/codesize/test_codesize_minimal_O1.json +++ b/test/codesize/test_codesize_minimal_O1.json @@ -1,10 +1,10 @@ { - "a.out.js": 3060, - "a.out.js.gz": 1286, + "a.out.js": 3069, + "a.out.js.gz": 1290, "a.out.nodebug.wasm": 505, "a.out.nodebug.wasm.gz": 378, - "total": 3565, - "total_gz": 1664, + "total": 3574, + "total_gz": 1668, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_minimal_O2.json b/test/codesize/test_codesize_minimal_O2.json index f90a41a331e86..f2fa6d370d5ef 100644 --- a/test/codesize/test_codesize_minimal_O2.json +++ b/test/codesize/test_codesize_minimal_O2.json @@ -1,10 +1,10 @@ { - "a.out.js": 2365, - "a.out.js.gz": 1165, + "a.out.js": 2374, + "a.out.js.gz": 1169, "a.out.nodebug.wasm": 326, "a.out.nodebug.wasm.gz": 263, - "total": 2691, - "total_gz": 1428, + "total": 2700, + "total_gz": 1432, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_minimal_O3.json b/test/codesize/test_codesize_minimal_O3.json index 5e5fe75ccddcb..e329561280605 100644 --- a/test/codesize/test_codesize_minimal_O3.json +++ b/test/codesize/test_codesize_minimal_O3.json @@ -1,10 +1,10 @@ { - "a.out.js": 2311, - "a.out.js.gz": 1133, + "a.out.js": 2320, + "a.out.js.gz": 1137, "a.out.nodebug.wasm": 75, "a.out.nodebug.wasm.gz": 87, - "total": 2386, - "total_gz": 1220, + "total": 2395, + "total_gz": 1224, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_minimal_Os.json b/test/codesize/test_codesize_minimal_Os.json index 5e5fe75ccddcb..e329561280605 100644 --- a/test/codesize/test_codesize_minimal_Os.json +++ b/test/codesize/test_codesize_minimal_Os.json @@ -1,10 +1,10 @@ { - "a.out.js": 2311, - "a.out.js.gz": 1133, + "a.out.js": 2320, + "a.out.js.gz": 1137, "a.out.nodebug.wasm": 75, "a.out.nodebug.wasm.gz": 87, - "total": 2386, - "total_gz": 1220, + "total": 2395, + "total_gz": 1224, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_minimal_Oz-ctors.json b/test/codesize/test_codesize_minimal_Oz-ctors.json index c25ce64652c4f..86694f6d09ae9 100644 --- a/test/codesize/test_codesize_minimal_Oz-ctors.json +++ b/test/codesize/test_codesize_minimal_Oz-ctors.json @@ -1,10 +1,10 @@ { - "a.out.js": 2293, - "a.out.js.gz": 1120, + "a.out.js": 2302, + "a.out.js.gz": 1123, "a.out.nodebug.wasm": 64, "a.out.nodebug.wasm.gz": 80, - "total": 2357, - "total_gz": 1200, + "total": 2366, + "total_gz": 1203, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_minimal_Oz.json b/test/codesize/test_codesize_minimal_Oz.json index 5e5fe75ccddcb..e329561280605 100644 --- a/test/codesize/test_codesize_minimal_Oz.json +++ b/test/codesize/test_codesize_minimal_Oz.json @@ -1,10 +1,10 @@ { - "a.out.js": 2311, - "a.out.js.gz": 1133, + "a.out.js": 2320, + "a.out.js.gz": 1137, "a.out.nodebug.wasm": 75, "a.out.nodebug.wasm.gz": 87, - "total": 2386, - "total_gz": 1220, + "total": 2395, + "total_gz": 1224, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_minimal_esm.json b/test/codesize/test_codesize_minimal_esm.json index 792de2bbf2aa2..7655c3cfb9c26 100644 --- a/test/codesize/test_codesize_minimal_esm.json +++ b/test/codesize/test_codesize_minimal_esm.json @@ -1,10 +1,10 @@ { - "a.out.js": 2442, - "a.out.js.gz": 1147, + "a.out.js": 2451, + "a.out.js.gz": 1152, "a.out.nodebug.wasm": 75, "a.out.nodebug.wasm.gz": 87, - "total": 2517, - "total_gz": 1234, + "total": 2526, + "total_gz": 1239, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_codesize_minimal_pthreads.json b/test/codesize/test_codesize_minimal_pthreads.json index 006d4854f3e16..0b3cc7a28e3c1 100644 --- a/test/codesize/test_codesize_minimal_pthreads.json +++ b/test/codesize/test_codesize_minimal_pthreads.json @@ -1,10 +1,10 @@ { - "a.out.js": 7213, - "a.out.js.gz": 3542, + "a.out.js": 7222, + "a.out.js.gz": 3546, "a.out.nodebug.wasm": 19147, "a.out.nodebug.wasm.gz": 8834, - "total": 26360, - "total_gz": 12376, + "total": 26369, + "total_gz": 12380, "sent": [ "a (memory)", "b (exit)", diff --git a/test/codesize/test_codesize_minimal_pthreads_memgrowth.json b/test/codesize/test_codesize_minimal_pthreads_memgrowth.json index 8ba67ef03cbcd..2b837d800b28b 100644 --- a/test/codesize/test_codesize_minimal_pthreads_memgrowth.json +++ b/test/codesize/test_codesize_minimal_pthreads_memgrowth.json @@ -1,10 +1,10 @@ { - "a.out.js": 7671, - "a.out.js.gz": 3759, + "a.out.js": 7680, + "a.out.js.gz": 3763, "a.out.nodebug.wasm": 19148, "a.out.nodebug.wasm.gz": 8835, - "total": 26819, - "total_gz": 12594, + "total": 26828, + "total_gz": 12598, "sent": [ "a (memory)", "b (exit)", diff --git a/test/codesize/test_codesize_minimal_wasmfs.json b/test/codesize/test_codesize_minimal_wasmfs.json index 5e5fe75ccddcb..e329561280605 100644 --- a/test/codesize/test_codesize_minimal_wasmfs.json +++ b/test/codesize/test_codesize_minimal_wasmfs.json @@ -1,10 +1,10 @@ { - "a.out.js": 2311, - "a.out.js.gz": 1133, + "a.out.js": 2320, + "a.out.js.gz": 1137, "a.out.nodebug.wasm": 75, "a.out.nodebug.wasm.gz": 87, - "total": 2386, - "total_gz": 1220, + "total": 2395, + "total_gz": 1224, "sent": [], "imports": [], "exports": [ diff --git a/test/codesize/test_unoptimized_code_size.json b/test/codesize/test_unoptimized_code_size.json index c04999c1e81f3..b70b6a4ac3fb9 100644 --- a/test/codesize/test_unoptimized_code_size.json +++ b/test/codesize/test_unoptimized_code_size.json @@ -1,16 +1,16 @@ { - "hello_world.js": 55579, - "hello_world.js.gz": 17578, + "hello_world.js": 55588, + "hello_world.js.gz": 17582, "hello_world.wasm": 14279, "hello_world.wasm.gz": 7101, - "no_asserts.js": 24470, - "no_asserts.js.gz": 8493, + "no_asserts.js": 24479, + "no_asserts.js.gz": 8497, "no_asserts.wasm": 11393, "no_asserts.wasm.gz": 5646, - "strict.js": 52730, - "strict.js.gz": 16576, + "strict.js": 52739, + "strict.js.gz": 16580, "strict.wasm": 14279, "strict.wasm.gz": 7098, - "total": 172730, - "total_gz": 62492 + "total": 172757, + "total_gz": 62504 }