From 94a4eb743a508e5ab0db8a16ce0d50eb72a0233a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Mon, 22 Sep 2025 19:30:43 +0300 Subject: [PATCH 1/6] Building with -sTEXTDECODER=2 when targeting -sAUDIO_WORKLET is not catastrophic since the user might very likely never attempt to interop any strings between JS and Wasm from the Audio Worklet thread. So leaving UTF8Decoder to be null there will be fine. --- src/lib/libstrings.js | 6 +++++- src/lib/libwebaudio.js | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib/libstrings.js b/src/lib/libstrings.js index 6f3f42546012c..717bea7bfeb44 100644 --- a/src/lib/libstrings.js +++ b/src/lib/libstrings.js @@ -9,9 +9,13 @@ #endif addToLibrary({ + // In -sAUDIO_WORKLET builds, TextDecoder will not exist in AudioWorkletGlobalScope, + // so we cannot try to unconditionally initialize it in that build mode. +#if TEXTDECODER == 2 && !AUDIO_WORKLET // TextDecoder constructor defaults to UTF-8 -#if TEXTDECODER == 2 $UTF8Decoder: "new TextDecoder()", +#elif SUPPORTS_GLOBALTHIS + $UTF8Decoder: "globalThis.TextDecoder && new TextDecoder()", #else $UTF8Decoder: "globalThis.TextDecoder ? new TextDecoder() : undefined", #endif diff --git a/src/lib/libwebaudio.js b/src/lib/libwebaudio.js index 5574ee7baedbc..fe61d1c0fffc4 100644 --- a/src/lib/libwebaudio.js +++ b/src/lib/libwebaudio.js @@ -1,8 +1,8 @@ #if AUDIO_WORKLET && !WASM_WORKERS -#error "Building with -sAUDIO_WORKLET also requires enabling -sWASM_WORKERS!" +#error "Building with -sAUDIO_WORKLET also requires enabling -sWASM_WORKERS" #endif #if AUDIO_WORKLET && TEXTDECODER == 2 -#error "-sAUDIO_WORKLET does not support -sTEXTDECODER=2 since TextDecoder is not available in AudioWorkletGlobalScope! Use e.g. -sTEXTDECODER=1 when building with -sAUDIO_WORKLET" +#warning "-sAUDIO_WORKLET does not support -sTEXTDECODER=2 since TextDecoder is not available in AudioWorkletGlobalScope. Text decoding will be unavailable in Audio Worklets. If you need string marshalling in Audio Worklets, build with -sTEXTDECODER=1." #endif #if AUDIO_WORKLET && SINGLE_FILE #error "-sAUDIO_WORKLET does not support -sSINGLE_FILE" From c379a1e7425fd8797b97e4bba790e4a57b812e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Wed, 1 Oct 2025 14:42:01 +0300 Subject: [PATCH 2/6] Merge --- src/lib/libstrings.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/libstrings.js b/src/lib/libstrings.js index 717bea7bfeb44..82152e2c89438 100644 --- a/src/lib/libstrings.js +++ b/src/lib/libstrings.js @@ -14,10 +14,8 @@ addToLibrary({ #if TEXTDECODER == 2 && !AUDIO_WORKLET // TextDecoder constructor defaults to UTF-8 $UTF8Decoder: "new TextDecoder()", -#elif SUPPORTS_GLOBALTHIS - $UTF8Decoder: "globalThis.TextDecoder && new TextDecoder()", #else - $UTF8Decoder: "globalThis.TextDecoder ? new TextDecoder() : undefined", + $UTF8Decoder: "globalThis.TextDecoder && new TextDecoder()", #endif $findStringEnd: (heapOrArray, idx, maxBytesToRead, ignoreNul) => { From aaddfa7eaa9f19f6b5da0e91653469bfa769444b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Wed, 1 Oct 2025 18:54:35 +0300 Subject: [PATCH 3/6] Automatic rebaseline of codesize expectations. NFC This is an automatic change generated by tools/maint/rebaseline_tests.py. The following (25) test expectation files were updated by running the tests with `--rebaseline`: ``` test/codesize/audio_worklet_wasm.expected.js updated codesize/test_codesize_cxx_ctors1.json: 149185 => 149179 [-6 bytes / -0.00%] codesize/test_codesize_cxx_ctors2.json: 148589 => 148583 [-6 bytes / -0.00%] codesize/test_codesize_cxx_except.json: 194602 => 194596 [-6 bytes / -0.00%] codesize/test_codesize_cxx_except_wasm.json: 164191 => 164185 [-6 bytes / -0.00%] codesize/test_codesize_cxx_except_wasm_legacy.json: 161780 => 161774 [-6 bytes / -0.00%] codesize/test_codesize_cxx_mangle.json: 258693 => 258687 [-6 bytes / -0.00%] codesize/test_codesize_cxx_noexcept.json: 151602 => 151596 [-6 bytes / -0.00%] codesize/test_codesize_cxx_wasmfs.json: 176862 => 176856 [-6 bytes / -0.00%] test/codesize/test_codesize_file_preload.expected.js updated codesize/test_codesize_file_preload.json: 24160 => 24154 [-6 bytes / -0.02%] codesize/test_codesize_files_js_fs.json: 18660 => 18654 [-6 bytes / -0.03%] codesize/test_codesize_files_wasmfs.json: 55706 => 55696 [-10 bytes / -0.02%] codesize/test_codesize_hello_O0.json: 38333 => 38325 [-8 bytes / -0.02%] codesize/test_codesize_hello_O1.json: 9028 => 9020 [-8 bytes / -0.09%] codesize/test_codesize_hello_O2.json: 6252 => 6246 [-6 bytes / -0.10%] codesize/test_codesize_hello_O3.json: 5948 => 5942 [-6 bytes / -0.10%] codesize/test_codesize_hello_Os.json: 5938 => 5932 [-6 bytes / -0.10%] codesize/test_codesize_hello_dylink.json: 45504 => 45498 [-6 bytes / -0.01%] codesize/test_codesize_hello_dylink_all.json: 843603 => 843605 [+2 bytes / +0.00%] codesize/test_codesize_hello_single_file.json: 6503 => 6497 [-6 bytes / -0.09%] codesize/test_codesize_hello_wasmfs.json: 5948 => 5942 [-6 bytes / -0.10%] codesize/test_minimal_runtime_code_size_audio_worklet.json: 5686 => 5680 [-6 bytes / -0.11%] codesize/test_small_js_flags.json: 2732 => 2726 [-6 bytes / -0.22%] codesize/test_unoptimized_code_size.json: 177911 => 177878 [-33 bytes / -0.02%] Average change: -0.05% (-0.22% - +0.00%) ``` --- test/codesize/audio_worklet_wasm.expected.js | 2 +- 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_mangle.json | 10 +++++----- 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 | 12 ++++++------ 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_dylink.json | 8 ++++---- .../codesize/test_codesize_hello_dylink_all.json | 6 +++--- .../test_codesize_hello_single_file.json | 4 ++-- test/codesize/test_codesize_hello_wasmfs.json | 8 ++++---- ..._minimal_runtime_code_size_audio_worklet.json | 8 ++++---- test/codesize/test_small_js_flags.json | 2 +- test/codesize/test_unoptimized_code_size.json | 16 ++++++++-------- 25 files changed, 95 insertions(+), 95 deletions(-) diff --git a/test/codesize/audio_worklet_wasm.expected.js b/test/codesize/audio_worklet_wasm.expected.js index c9cb7d9562844..5b259813ef2ae 100644 --- a/test/codesize/audio_worklet_wasm.expected.js +++ b/test/codesize/audio_worklet_wasm.expected.js @@ -111,7 +111,7 @@ var L = [], M = a => { }, Q = (a, b, e, d) => { b = P[b]; P[a].connect(b.destination || b, e, d); -}, P = {}, R = 0, S = globalThis.TextDecoder ? new TextDecoder : void 0, T = (a = 0) => { +}, P = {}, R = 0, S = globalThis.TextDecoder && new TextDecoder, T = (a = 0) => { for (var b = J, e = a, d = e + void 0; b[e] && !(e >= d); ) ++e; if (16 < e - a && b.buffer && S) return S.decode(b.slice(a, e)); for (d = ""; a < e; ) { diff --git a/test/codesize/test_codesize_cxx_ctors1.json b/test/codesize/test_codesize_cxx_ctors1.json index 158bf08138da9..31b088ae7c7c8 100644 --- a/test/codesize/test_codesize_cxx_ctors1.json +++ b/test/codesize/test_codesize_cxx_ctors1.json @@ -1,10 +1,10 @@ { - "a.out.js": 19676, - "a.out.js.gz": 8151, + "a.out.js": 19670, + "a.out.js.gz": 8152, "a.out.nodebug.wasm": 129509, "a.out.nodebug.wasm.gz": 49243, - "total": 149185, - "total_gz": 57394, + "total": 149179, + "total_gz": 57395, "sent": [ "__cxa_throw", "_abort_js", diff --git a/test/codesize/test_codesize_cxx_ctors2.json b/test/codesize/test_codesize_cxx_ctors2.json index 69395e2c8d2fe..8c881d7873a96 100644 --- a/test/codesize/test_codesize_cxx_ctors2.json +++ b/test/codesize/test_codesize_cxx_ctors2.json @@ -1,10 +1,10 @@ { - "a.out.js": 19653, - "a.out.js.gz": 8138, + "a.out.js": 19647, + "a.out.js.gz": 8139, "a.out.nodebug.wasm": 128936, "a.out.nodebug.wasm.gz": 48884, - "total": 148589, - "total_gz": 57022, + "total": 148583, + "total_gz": 57023, "sent": [ "__cxa_throw", "_abort_js", diff --git a/test/codesize/test_codesize_cxx_except.json b/test/codesize/test_codesize_cxx_except.json index 8059d11df30d9..3cf50e085bf85 100644 --- a/test/codesize/test_codesize_cxx_except.json +++ b/test/codesize/test_codesize_cxx_except.json @@ -1,10 +1,10 @@ { - "a.out.js": 23331, - "a.out.js.gz": 9129, + "a.out.js": 23325, + "a.out.js.gz": 9128, "a.out.nodebug.wasm": 171271, "a.out.nodebug.wasm.gz": 57338, - "total": 194602, - "total_gz": 66467, + "total": 194596, + "total_gz": 66466, "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 9ef392b38466c..6ac496e63b2eb 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": 19561, - "a.out.js.gz": 8098, + "a.out.js": 19555, + "a.out.js.gz": 8099, "a.out.nodebug.wasm": 144630, "a.out.nodebug.wasm.gz": 54894, - "total": 164191, - "total_gz": 62992, + "total": 164185, + "total_gz": 62993, "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 cc4a766009cda..1b7e054223d79 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": 19561, - "a.out.js.gz": 8098, + "a.out.js": 19555, + "a.out.js.gz": 8099, "a.out.nodebug.wasm": 142219, "a.out.nodebug.wasm.gz": 54358, - "total": 161780, - "total_gz": 62456, + "total": 161774, + "total_gz": 62457, "sent": [ "_abort_js", "_tzset_js", diff --git a/test/codesize/test_codesize_cxx_mangle.json b/test/codesize/test_codesize_cxx_mangle.json index 1c8daacf91df0..b7daaf9232560 100644 --- a/test/codesize/test_codesize_cxx_mangle.json +++ b/test/codesize/test_codesize_cxx_mangle.json @@ -1,10 +1,10 @@ { - "a.out.js": 23381, - "a.out.js.gz": 9149, + "a.out.js": 23375, + "a.out.js.gz": 9148, "a.out.nodebug.wasm": 235312, - "a.out.nodebug.wasm.gz": 78933, - "total": 258693, - "total_gz": 88082, + "a.out.nodebug.wasm.gz": 78935, + "total": 258687, + "total_gz": 88083, "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 935cbae71797f..4a0e197e931a5 100644 --- a/test/codesize/test_codesize_cxx_noexcept.json +++ b/test/codesize/test_codesize_cxx_noexcept.json @@ -1,10 +1,10 @@ { - "a.out.js": 19676, - "a.out.js.gz": 8151, + "a.out.js": 19670, + "a.out.js.gz": 8152, "a.out.nodebug.wasm": 131926, "a.out.nodebug.wasm.gz": 50238, - "total": 151602, - "total_gz": 58389, + "total": 151596, + "total_gz": 58390, "sent": [ "__cxa_throw", "_abort_js", diff --git a/test/codesize/test_codesize_cxx_wasmfs.json b/test/codesize/test_codesize_cxx_wasmfs.json index 9facc4405eea9..7e77d1ac35dba 100644 --- a/test/codesize/test_codesize_cxx_wasmfs.json +++ b/test/codesize/test_codesize_cxx_wasmfs.json @@ -1,10 +1,10 @@ { - "a.out.js": 7065, - "a.out.js.gz": 3329, + "a.out.js": 7059, + "a.out.js.gz": 3330, "a.out.nodebug.wasm": 169797, "a.out.nodebug.wasm.gz": 63087, - "total": 176862, - "total_gz": 66416, + "total": 176856, + "total_gz": 66417, "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 5cee8cc358835..26f7b514301a3 100644 --- a/test/codesize/test_codesize_file_preload.expected.js +++ b/test/codesize/test_codesize_file_preload.expected.js @@ -666,7 +666,7 @@ var PATH_FS = { } }; -var UTF8Decoder = globalThis.TextDecoder ? new TextDecoder : undefined; +var UTF8Decoder = globalThis.TextDecoder && new TextDecoder; var findStringEnd = (heapOrArray, idx, maxBytesToRead, ignoreNul) => { var maxIdx = idx + maxBytesToRead; diff --git a/test/codesize/test_codesize_file_preload.json b/test/codesize/test_codesize_file_preload.json index 7ef313b66368f..9e84e556b8f61 100644 --- a/test/codesize/test_codesize_file_preload.json +++ b/test/codesize/test_codesize_file_preload.json @@ -1,10 +1,10 @@ { - "a.out.js": 22479, - "a.out.js.gz": 9348, + "a.out.js": 22473, + "a.out.js.gz": 9349, "a.out.nodebug.wasm": 1681, "a.out.nodebug.wasm.gz": 960, - "total": 24160, - "total_gz": 10308, + "total": 24154, + "total_gz": 10309, "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 e876b23a80945..1e6532c6790b5 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": 18279, - "a.out.js.gz": 7466, + "a.out.js": 18273, + "a.out.js.gz": 7462, "a.out.nodebug.wasm": 381, "a.out.nodebug.wasm.gz": 260, - "total": 18660, - "total_gz": 7726, + "total": 18654, + "total_gz": 7722, "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 7bdae3939e735..c49fa4dfa8d66 100644 --- a/test/codesize/test_codesize_files_wasmfs.json +++ b/test/codesize/test_codesize_files_wasmfs.json @@ -1,10 +1,10 @@ { - "a.out.js": 5471, - "a.out.js.gz": 2579, - "a.out.nodebug.wasm": 50235, - "a.out.nodebug.wasm.gz": 18098, - "total": 55706, - "total_gz": 20677, + "a.out.js": 5465, + "a.out.js.gz": 2576, + "a.out.nodebug.wasm": 50231, + "a.out.nodebug.wasm.gz": 18094, + "total": 55696, + "total_gz": 20670, "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 b268eaeaba1cd..c82d335d1d30e 100644 --- a/test/codesize/test_codesize_hello_O0.json +++ b/test/codesize/test_codesize_hello_O0.json @@ -1,10 +1,10 @@ { - "a.out.js": 23206, - "a.out.js.gz": 8525, + "a.out.js": 23198, + "a.out.js.gz": 8524, "a.out.nodebug.wasm": 15127, "a.out.nodebug.wasm.gz": 7450, - "total": 38333, - "total_gz": 15975, + "total": 38325, + "total_gz": 15974, "sent": [ "fd_write" ], diff --git a/test/codesize/test_codesize_hello_O1.json b/test/codesize/test_codesize_hello_O1.json index 5eea936e2ba2e..9525cad3cc8c3 100644 --- a/test/codesize/test_codesize_hello_O1.json +++ b/test/codesize/test_codesize_hello_O1.json @@ -1,10 +1,10 @@ { - "a.out.js": 6353, - "a.out.js.gz": 2462, + "a.out.js": 6345, + "a.out.js.gz": 2460, "a.out.nodebug.wasm": 2675, "a.out.nodebug.wasm.gz": 1491, - "total": 9028, - "total_gz": 3953, + "total": 9020, + "total_gz": 3951, "sent": [ "fd_write" ], diff --git a/test/codesize/test_codesize_hello_O2.json b/test/codesize/test_codesize_hello_O2.json index 6d95b8ea6d495..c0f30e38d682c 100644 --- a/test/codesize/test_codesize_hello_O2.json +++ b/test/codesize/test_codesize_hello_O2.json @@ -1,10 +1,10 @@ { - "a.out.js": 4325, - "a.out.js.gz": 2132, + "a.out.js": 4319, + "a.out.js.gz": 2131, "a.out.nodebug.wasm": 1927, "a.out.nodebug.wasm.gz": 1138, - "total": 6252, - "total_gz": 3270, + "total": 6246, + "total_gz": 3269, "sent": [ "fd_write" ], diff --git a/test/codesize/test_codesize_hello_O3.json b/test/codesize/test_codesize_hello_O3.json index 5e120b0bd2e06..1b9f5f4d33fd2 100644 --- a/test/codesize/test_codesize_hello_O3.json +++ b/test/codesize/test_codesize_hello_O3.json @@ -1,10 +1,10 @@ { - "a.out.js": 4267, - "a.out.js.gz": 2092, + "a.out.js": 4261, + "a.out.js.gz": 2091, "a.out.nodebug.wasm": 1681, "a.out.nodebug.wasm.gz": 960, - "total": 5948, - "total_gz": 3052, + "total": 5942, + "total_gz": 3051, "sent": [ "a (fd_write)" ], diff --git a/test/codesize/test_codesize_hello_Os.json b/test/codesize/test_codesize_hello_Os.json index 3b66cac60bc76..560a05125f5ce 100644 --- a/test/codesize/test_codesize_hello_Os.json +++ b/test/codesize/test_codesize_hello_Os.json @@ -1,10 +1,10 @@ { - "a.out.js": 4267, - "a.out.js.gz": 2092, + "a.out.js": 4261, + "a.out.js.gz": 2091, "a.out.nodebug.wasm": 1671, "a.out.nodebug.wasm.gz": 964, - "total": 5938, - "total_gz": 3056, + "total": 5932, + "total_gz": 3055, "sent": [ "a (fd_write)" ], diff --git a/test/codesize/test_codesize_hello_dylink.json b/test/codesize/test_codesize_hello_dylink.json index 0725e21aa1784..67d37ec2376cf 100644 --- a/test/codesize/test_codesize_hello_dylink.json +++ b/test/codesize/test_codesize_hello_dylink.json @@ -1,10 +1,10 @@ { - "a.out.js": 26937, - "a.out.js.gz": 11474, + "a.out.js": 26931, + "a.out.js.gz": 11473, "a.out.nodebug.wasm": 18567, "a.out.nodebug.wasm.gz": 9199, - "total": 45504, - "total_gz": 20673, + "total": 45498, + "total_gz": 20672, "sent": [ "__heap_base", "__indirect_function_table", diff --git a/test/codesize/test_codesize_hello_dylink_all.json b/test/codesize/test_codesize_hello_dylink_all.json index 2dec9c6cb50d4..f84482c8916df 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": 245848, - "a.out.nodebug.wasm": 597755, - "total": 843603, + "a.out.js": 245842, + "a.out.nodebug.wasm": 597763, + "total": 843605, "sent": [ "IMG_Init", "IMG_Load", diff --git a/test/codesize/test_codesize_hello_single_file.json b/test/codesize/test_codesize_hello_single_file.json index 17d49fc2bd11d..b216a17b1a986 100644 --- a/test/codesize/test_codesize_hello_single_file.json +++ b/test/codesize/test_codesize_hello_single_file.json @@ -1,6 +1,6 @@ { - "a.out.js": 6503, - "a.out.js.gz": 3580, + "a.out.js": 6497, + "a.out.js.gz": 3579, "sent": [ "a (fd_write)" ] diff --git a/test/codesize/test_codesize_hello_wasmfs.json b/test/codesize/test_codesize_hello_wasmfs.json index 5e120b0bd2e06..1b9f5f4d33fd2 100644 --- a/test/codesize/test_codesize_hello_wasmfs.json +++ b/test/codesize/test_codesize_hello_wasmfs.json @@ -1,10 +1,10 @@ { - "a.out.js": 4267, - "a.out.js.gz": 2092, + "a.out.js": 4261, + "a.out.js.gz": 2091, "a.out.nodebug.wasm": 1681, "a.out.nodebug.wasm.gz": 960, - "total": 5948, - "total_gz": 3052, + "total": 5942, + "total_gz": 3051, "sent": [ "a (fd_write)" ], diff --git a/test/codesize/test_minimal_runtime_code_size_audio_worklet.json b/test/codesize/test_minimal_runtime_code_size_audio_worklet.json index 3b300a7165dfc..6c1cd50fbbccd 100644 --- a/test/codesize/test_minimal_runtime_code_size_audio_worklet.json +++ b/test/codesize/test_minimal_runtime_code_size_audio_worklet.json @@ -1,10 +1,10 @@ { "a.html": 519, "a.html.gz": 357, - "a.js": 3859, - "a.js.gz": 2037, + "a.js": 3853, + "a.js.gz": 2035, "a.wasm": 1308, "a.wasm.gz": 876, - "total": 5686, - "total_gz": 3270 + "total": 5680, + "total_gz": 3268 } diff --git a/test/codesize/test_small_js_flags.json b/test/codesize/test_small_js_flags.json index 4b91b8456f856..258ceaa4a17cf 100644 --- a/test/codesize/test_small_js_flags.json +++ b/test/codesize/test_small_js_flags.json @@ -1,4 +1,4 @@ { - "a.out.js": 2732, + "a.out.js": 2726, "a.out.js.gz": 1495 } diff --git a/test/codesize/test_unoptimized_code_size.json b/test/codesize/test_unoptimized_code_size.json index 1a2d9196d9c0b..16940da00e92d 100644 --- a/test/codesize/test_unoptimized_code_size.json +++ b/test/codesize/test_unoptimized_code_size.json @@ -1,16 +1,16 @@ { - "hello_world.js": 55411, - "hello_world.js.gz": 17487, + "hello_world.js": 55400, + "hello_world.js.gz": 17483, "hello_world.wasm": 15127, "hello_world.wasm.gz": 7450, - "no_asserts.js": 26570, - "no_asserts.js.gz": 8870, + "no_asserts.js": 26559, + "no_asserts.js.gz": 8867, "no_asserts.wasm": 12227, "no_asserts.wasm.gz": 6010, - "strict.js": 53449, - "strict.js.gz": 16824, + "strict.js": 53438, + "strict.js.gz": 16822, "strict.wasm": 15127, "strict.wasm.gz": 7447, - "total": 177911, - "total_gz": 64088 + "total": 177878, + "total_gz": 64079 } From ded8f94646b3fecf05e2357775f6c8895e5ec84d Mon Sep 17 00:00:00 2001 From: juj Date: Wed, 1 Oct 2025 20:31:11 +0300 Subject: [PATCH 4/6] Automatic rebaseline of codesize expectations. NFC This is an automatic change generated by tools/maint/rebaseline_tests.py. The following (3) test expectation files were updated by running the tests with `--rebaseline`: ``` codesize/test_codesize_cxx_mangle.json: 258687 => 258687 [+0 bytes / +0.00%] codesize/test_codesize_files_wasmfs.json: 55696 => 55700 [+4 bytes / +0.01%] codesize/test_codesize_hello_dylink_all.json: 843605 => 843597 [-8 bytes / -0.00%] Average change: +0.00% (-0.00% - +0.01%) ``` --- test/codesize/test_codesize_cxx_mangle.json | 4 ++-- test/codesize/test_codesize_files_wasmfs.json | 8 ++++---- test/codesize/test_codesize_hello_dylink_all.json | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/codesize/test_codesize_cxx_mangle.json b/test/codesize/test_codesize_cxx_mangle.json index b7daaf9232560..0b993be3b0329 100644 --- a/test/codesize/test_codesize_cxx_mangle.json +++ b/test/codesize/test_codesize_cxx_mangle.json @@ -2,9 +2,9 @@ "a.out.js": 23375, "a.out.js.gz": 9148, "a.out.nodebug.wasm": 235312, - "a.out.nodebug.wasm.gz": 78935, + "a.out.nodebug.wasm.gz": 78933, "total": 258687, - "total_gz": 88083, + "total_gz": 88081, "sent": [ "__cxa_begin_catch", "__cxa_end_catch", diff --git a/test/codesize/test_codesize_files_wasmfs.json b/test/codesize/test_codesize_files_wasmfs.json index c49fa4dfa8d66..89106d810a267 100644 --- a/test/codesize/test_codesize_files_wasmfs.json +++ b/test/codesize/test_codesize_files_wasmfs.json @@ -1,10 +1,10 @@ { "a.out.js": 5465, "a.out.js.gz": 2576, - "a.out.nodebug.wasm": 50231, - "a.out.nodebug.wasm.gz": 18094, - "total": 55696, - "total_gz": 20670, + "a.out.nodebug.wasm": 50235, + "a.out.nodebug.wasm.gz": 18098, + "total": 55700, + "total_gz": 20674, "sent": [ "a (emscripten_date_now)", "b (emscripten_err)", diff --git a/test/codesize/test_codesize_hello_dylink_all.json b/test/codesize/test_codesize_hello_dylink_all.json index f84482c8916df..7a1fb7e1ba03a 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": 245842, - "a.out.nodebug.wasm": 597763, - "total": 843605, + "a.out.nodebug.wasm": 597755, + "total": 843597, "sent": [ "IMG_Init", "IMG_Load", From 5eed1133c41f7f6550a66caca4f7ef4a215a7bd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Wed, 1 Oct 2025 22:13:32 +0300 Subject: [PATCH 5/6] Automatic rebaseline of codesize expectations. NFC This is an automatic change generated by tools/maint/rebaseline_tests.py. The following (5) test expectation files were updated by running the tests with `--rebaseline`: ``` test/codesize/audio_worklet_wasm.expected.js updated codesize/test_codesize_cxx_mangle.json: 258687 => 258687 [+0 bytes / +0.00%] codesize/test_codesize_files_wasmfs.json: 55700 => 55696 [-4 bytes / -0.01%] codesize/test_codesize_hello_dylink_all.json: 843597 => 843605 [+8 bytes / +0.00%] codesize/test_minimal_runtime_code_size_audio_worklet.json: 5680 => 5929 [+249 bytes / +4.38%] Average change: +1.09% (-0.01% - +4.38%) ``` --- test/codesize/audio_worklet_wasm.expected.js | 36 +++++++++---------- test/codesize/test_codesize_cxx_mangle.json | 4 +-- test/codesize/test_codesize_files_wasmfs.json | 8 ++--- .../test_codesize_hello_dylink_all.json | 4 +-- ...nimal_runtime_code_size_audio_worklet.json | 8 ++--- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/test/codesize/audio_worklet_wasm.expected.js b/test/codesize/audio_worklet_wasm.expected.js index c0c76a51d762d..579197520960d 100644 --- a/test/codesize/audio_worklet_wasm.expected.js +++ b/test/codesize/audio_worklet_wasm.expected.js @@ -104,24 +104,24 @@ t || (w = m.mem || new WebAssembly.Memory({ var K = [], L = a => { a = a.data; - let b = a._wsc; - b && A.get(b)(...a.x); -}, N = a => { - L.push(a); -}, Q = (a, b, e, d) => { - b = P[b]; - P[a].connect(b.destination || b, e, d); -}, P = {}, R = 0, S = globalThis.TextDecoder && new TextDecoder, T = (a = 0) => { - for (var b = J, e = a, d = e + void 0; b[e] && !(e >= d); ) ++e; - if (16 < e - a && b.buffer && S) return S.decode(b.slice(a, e)); - for (d = ""; a < e; ) { - var c = b[a++]; - if (c & 128) { - var g = b[a++] & 63; - if (192 == (c & 224)) d += String.fromCharCode((c & 31) << 6 | g); else { - var f = b[a++] & 63; - c = 224 == (c & 240) ? (c & 15) << 12 | g << 6 | f : (c & 7) << 18 | g << 12 | f << 6 | b[a++] & 63; - 65536 > c ? d += String.fromCharCode(c) : (c -= 65536, d += String.fromCharCode(55296 | c >> 10, 56320 | c & 1023)); + let c = a._wsc; + c && A.get(c)(...a.x); +}, M = a => { + K.push(a); +}, P = (a, c, b, f) => { + c = O[c]; + O[a].connect(c.destination || c, b, f); +}, O = {}, Q = 0, R = globalThis.TextDecoder && new TextDecoder, S = (a = 0) => { + for (var c = I, b = a, f = b + void 0; c[b] && !(b >= f); ) ++b; + if (16 < b - a && c.buffer && R) return R.decode(c.slice(a, b)); + for (f = ""; a < b; ) { + var d = c[a++]; + if (d & 128) { + var g = c[a++] & 63; + if (192 == (d & 224)) f += String.fromCharCode((d & 31) << 6 | g); else { + var e = c[a++] & 63; + d = 224 == (d & 240) ? (d & 15) << 12 | g << 6 | e : (d & 7) << 18 | g << 12 | e << 6 | c[a++] & 63; + 65536 > d ? f += String.fromCharCode(d) : (d -= 65536, f += String.fromCharCode(55296 | d >> 10, 56320 | d & 1023)); } } else f += String.fromCharCode(d); } diff --git a/test/codesize/test_codesize_cxx_mangle.json b/test/codesize/test_codesize_cxx_mangle.json index 0b993be3b0329..b7daaf9232560 100644 --- a/test/codesize/test_codesize_cxx_mangle.json +++ b/test/codesize/test_codesize_cxx_mangle.json @@ -2,9 +2,9 @@ "a.out.js": 23375, "a.out.js.gz": 9148, "a.out.nodebug.wasm": 235312, - "a.out.nodebug.wasm.gz": 78933, + "a.out.nodebug.wasm.gz": 78935, "total": 258687, - "total_gz": 88081, + "total_gz": 88083, "sent": [ "__cxa_begin_catch", "__cxa_end_catch", diff --git a/test/codesize/test_codesize_files_wasmfs.json b/test/codesize/test_codesize_files_wasmfs.json index 89106d810a267..c49fa4dfa8d66 100644 --- a/test/codesize/test_codesize_files_wasmfs.json +++ b/test/codesize/test_codesize_files_wasmfs.json @@ -1,10 +1,10 @@ { "a.out.js": 5465, "a.out.js.gz": 2576, - "a.out.nodebug.wasm": 50235, - "a.out.nodebug.wasm.gz": 18098, - "total": 55700, - "total_gz": 20674, + "a.out.nodebug.wasm": 50231, + "a.out.nodebug.wasm.gz": 18094, + "total": 55696, + "total_gz": 20670, "sent": [ "a (emscripten_date_now)", "b (emscripten_err)", diff --git a/test/codesize/test_codesize_hello_dylink_all.json b/test/codesize/test_codesize_hello_dylink_all.json index 7a1fb7e1ba03a..f84482c8916df 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": 245842, - "a.out.nodebug.wasm": 597755, - "total": 843597, + "a.out.nodebug.wasm": 597763, + "total": 843605, "sent": [ "IMG_Init", "IMG_Load", diff --git a/test/codesize/test_minimal_runtime_code_size_audio_worklet.json b/test/codesize/test_minimal_runtime_code_size_audio_worklet.json index 6c1cd50fbbccd..f185c2835ae59 100644 --- a/test/codesize/test_minimal_runtime_code_size_audio_worklet.json +++ b/test/codesize/test_minimal_runtime_code_size_audio_worklet.json @@ -1,10 +1,10 @@ { "a.html": 519, "a.html.gz": 357, - "a.js": 3853, - "a.js.gz": 2035, + "a.js": 4102, + "a.js.gz": 2103, "a.wasm": 1308, "a.wasm.gz": 876, - "total": 5680, - "total_gz": 3268 + "total": 5929, + "total_gz": 3336 } From c06caeb68c90bfa99f2e7e5252c06f08f1c632d1 Mon Sep 17 00:00:00 2001 From: juj Date: Wed, 1 Oct 2025 22:51:36 +0300 Subject: [PATCH 6/6] Automatic rebaseline of codesize expectations. NFC This is an automatic change generated by tools/maint/rebaseline_tests.py. The following (3) test expectation files were updated by running the tests with `--rebaseline`: ``` codesize/test_codesize_cxx_mangle.json: 258687 => 258687 [+0 bytes / +0.00%] codesize/test_codesize_files_wasmfs.json: 55696 => 55700 [+4 bytes / +0.01%] codesize/test_codesize_hello_dylink_all.json: 843605 => 843597 [-8 bytes / -0.00%] Average change: +0.00% (-0.00% - +0.01%) ``` --- test/codesize/test_codesize_cxx_mangle.json | 4 ++-- test/codesize/test_codesize_files_wasmfs.json | 8 ++++---- test/codesize/test_codesize_hello_dylink_all.json | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/codesize/test_codesize_cxx_mangle.json b/test/codesize/test_codesize_cxx_mangle.json index b7daaf9232560..0b993be3b0329 100644 --- a/test/codesize/test_codesize_cxx_mangle.json +++ b/test/codesize/test_codesize_cxx_mangle.json @@ -2,9 +2,9 @@ "a.out.js": 23375, "a.out.js.gz": 9148, "a.out.nodebug.wasm": 235312, - "a.out.nodebug.wasm.gz": 78935, + "a.out.nodebug.wasm.gz": 78933, "total": 258687, - "total_gz": 88083, + "total_gz": 88081, "sent": [ "__cxa_begin_catch", "__cxa_end_catch", diff --git a/test/codesize/test_codesize_files_wasmfs.json b/test/codesize/test_codesize_files_wasmfs.json index c49fa4dfa8d66..89106d810a267 100644 --- a/test/codesize/test_codesize_files_wasmfs.json +++ b/test/codesize/test_codesize_files_wasmfs.json @@ -1,10 +1,10 @@ { "a.out.js": 5465, "a.out.js.gz": 2576, - "a.out.nodebug.wasm": 50231, - "a.out.nodebug.wasm.gz": 18094, - "total": 55696, - "total_gz": 20670, + "a.out.nodebug.wasm": 50235, + "a.out.nodebug.wasm.gz": 18098, + "total": 55700, + "total_gz": 20674, "sent": [ "a (emscripten_date_now)", "b (emscripten_err)", diff --git a/test/codesize/test_codesize_hello_dylink_all.json b/test/codesize/test_codesize_hello_dylink_all.json index f84482c8916df..7a1fb7e1ba03a 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": 245842, - "a.out.nodebug.wasm": 597763, - "total": 843605, + "a.out.nodebug.wasm": 597755, + "total": 843597, "sent": [ "IMG_Init", "IMG_Load",