From 96bf43a1424dbc8067ae18aede5b78ae172e6cc1 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 30 Oct 2024 15:32:58 -0700 Subject: [PATCH 01/25] toward always using bulkmem and lowering --- emcc.py | 6 ++-- src/library.js | 32 ------------------- system/lib/libc/emscripten_internal.h | 6 ---- .../codesize/test_codesize_cxx_ctors1.imports | 1 - .../codesize/test_codesize_cxx_ctors1.sent | 1 - .../codesize/test_codesize_cxx_ctors2.imports | 1 - .../codesize/test_codesize_cxx_ctors2.sent | 1 - .../codesize/test_codesize_cxx_except.imports | 2 -- .../codesize/test_codesize_cxx_except.sent | 1 - .../test_codesize_cxx_except_wasm.imports | 1 - .../test_codesize_cxx_except_wasm.sent | 1 - ...st_codesize_cxx_except_wasm_exnref.imports | 1 - .../test_codesize_cxx_except_wasm_exnref.sent | 1 - .../codesize/test_codesize_cxx_mangle.imports | 2 -- .../codesize/test_codesize_cxx_mangle.sent | 1 - .../test_codesize_cxx_noexcept.imports | 1 - .../codesize/test_codesize_cxx_noexcept.sent | 1 - .../codesize/test_codesize_cxx_wasmfs.imports | 1 - .../codesize/test_codesize_cxx_wasmfs.sent | 1 - .../test_codesize_files_wasmfs.imports | 5 ++- .../codesize/test_codesize_files_wasmfs.sent | 5 ++- test/test_other.py | 6 +++- tools/link.py | 2 ++ tools/system_libs.py | 6 ++-- 24 files changed, 17 insertions(+), 69 deletions(-) diff --git a/emcc.py b/emcc.py index 520ad404108b3..49f6b14291c8d 100644 --- a/emcc.py +++ b/emcc.py @@ -386,10 +386,10 @@ def get_clang_flags(user_args): # In emscripten we currently disable bulk memory by default. # This should be removed/updated when we als update the default browser targets. - if '-mbulk-memory' not in user_args and '-mno-bulk-memory' not in user_args: + #if '-mbulk-memory' not in user_args and '-mno-bulk-memory' not in user_args: # Bulk memory may be enabled via threads or directly via -s. - if not settings.BULK_MEMORY: - flags.append('-mno-bulk-memory') + # if not settings.BULK_MEMORY: + # flags.append('-mno-bulk-memory') if '-mnontrapping-fptoint' not in user_args and '-mno-nontrapping-fptoint' not in user_args: flags.append('-mno-nontrapping-fptoint') diff --git a/src/library.js b/src/library.js index a26c98c3512c6..89ada84310614 100644 --- a/src/library.js +++ b/src/library.js @@ -406,38 +406,6 @@ addToLibrary({ // the initial values of the environment accessible by getenv. $ENV: {}, - // In -Oz builds, we replace memcpy() altogether with a non-unrolled wasm - // variant, so we should never emit _emscripten_memcpy_js() in the build. - // In STANDALONE_WASM we avoid the _emscripten_memcpy_js dependency so keep - // the wasm file standalone. - // In BULK_MEMORY mode we include native versions of these functions based - // on memory.fill and memory.copy. - // In MAIN_MODULE=1 or EMCC_FORCE_STDLIBS mode all of libc is force included - // so we cannot override parts of it, and therefore cannot use libc_optz. -#if (SHRINK_LEVEL < 2 || LINKABLE || process.env.EMCC_FORCE_STDLIBS) && !STANDALONE_WASM && !BULK_MEMORY - -#if MIN_CHROME_VERSION < 45 || MIN_FIREFOX_VERSION < 34 || MIN_SAFARI_VERSION < 100101 - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin lists browsers that support TypedArray.prototype.copyWithin, but it - // has outdated information for Safari, saying it would not support it. - // https://github.com/WebKit/webkit/commit/24a800eea4d82d6d595cdfec69d0f68e733b5c52#diff-c484911d8df319ba75fce0d8e7296333R1 suggests support was added on Aug 28, 2015. - // Manual testing suggests: - // Safari/601.1 Version/9.0 on iPhone 4s with iOS 9.3.6 (released September 30, 2015) does not support copyWithin. - // but the following systems do: - // AppleWebKit/602.2.14 Safari/602.1 Version/10.0 Mobile/14B100 iPhone OS 10_1_1 on iPhone 5s with iOS 10.1.1 (released October 31, 2016) - // AppleWebKit/603.3.8 Safari/602.1 Version/10.0 on iPhone 5 with iOS 10.3.4 (released July 22, 2019) - // AppleWebKit/605.1.15 iPhone OS 12_3_1 Version/12.1.1 Safari/604.1 on iPhone SE with iOS 12.3.1 - // AppleWebKit/605.1.15 Safari/604.1 Version/13.0.4 iPhone OS 13_3 on iPhone 6s with iOS 13.3 - // AppleWebKit/605.1.15 Version/13.0.3 Intel Mac OS X 10_15_1 on Safari 13.0.3 (15608.3.10.1.4) on macOS Catalina 10.15.1 - // Hence the support status of .copyWithin() for Safari version range [10.0.0, 10.1.0] is unknown. - _emscripten_memcpy_js: `= Uint8Array.prototype.copyWithin - ? (dest, src, num) => HEAPU8.copyWithin(dest, src, src + num) - : (dest, src, num) => HEAPU8.set(HEAPU8.subarray(src, src+num), dest)`, -#else - _emscripten_memcpy_js: (dest, src, num) => HEAPU8.copyWithin(dest, src, src + num), -#endif - -#endif - #if !STANDALONE_WASM // ========================================================================== // assert.h diff --git a/system/lib/libc/emscripten_internal.h b/system/lib/libc/emscripten_internal.h index 766f7dd63b923..9df178f7841ad 100644 --- a/system/lib/libc/emscripten_internal.h +++ b/system/lib/libc/emscripten_internal.h @@ -30,12 +30,6 @@ _Noreturn void _abort_js(void); void setThrew(uintptr_t threw, int value); -// An external JS implementation that is efficient for very large copies, using -// HEAPU8.set() -void _emscripten_memcpy_js(void* __restrict__ dest, - const void* __restrict__ src, - size_t n) EM_IMPORT(_emscripten_memcpy_js); - void* _emscripten_memcpy_bulkmem(void* __restrict__ dest, const void* __restrict__ src, size_t n); diff --git a/test/other/codesize/test_codesize_cxx_ctors1.imports b/test/other/codesize/test_codesize_cxx_ctors1.imports index 39ee5c0a1feea..b4c8651dc0e7a 100644 --- a/test/other/codesize/test_codesize_cxx_ctors1.imports +++ b/test/other/codesize/test_codesize_cxx_ctors1.imports @@ -1,6 +1,5 @@ env.__cxa_throw env._abort_js -env._emscripten_memcpy_js env._tzset_js env.emscripten_resize_heap wasi_snapshot_preview1.environ_get diff --git a/test/other/codesize/test_codesize_cxx_ctors1.sent b/test/other/codesize/test_codesize_cxx_ctors1.sent index 469227e5c1d77..ba1faccf2d36d 100644 --- a/test/other/codesize/test_codesize_cxx_ctors1.sent +++ b/test/other/codesize/test_codesize_cxx_ctors1.sent @@ -1,6 +1,5 @@ __cxa_throw _abort_js -_emscripten_memcpy_js _tzset_js emscripten_resize_heap environ_get diff --git a/test/other/codesize/test_codesize_cxx_ctors2.imports b/test/other/codesize/test_codesize_cxx_ctors2.imports index b706c07df528f..ddadf337d0f2a 100644 --- a/test/other/codesize/test_codesize_cxx_ctors2.imports +++ b/test/other/codesize/test_codesize_cxx_ctors2.imports @@ -1,5 +1,4 @@ env._abort_js -env._emscripten_memcpy_js env._tzset_js env.emscripten_resize_heap wasi_snapshot_preview1.fd_close diff --git a/test/other/codesize/test_codesize_cxx_ctors2.sent b/test/other/codesize/test_codesize_cxx_ctors2.sent index 469227e5c1d77..ba1faccf2d36d 100644 --- a/test/other/codesize/test_codesize_cxx_ctors2.sent +++ b/test/other/codesize/test_codesize_cxx_ctors2.sent @@ -1,6 +1,5 @@ __cxa_throw _abort_js -_emscripten_memcpy_js _tzset_js emscripten_resize_heap environ_get diff --git a/test/other/codesize/test_codesize_cxx_except.imports b/test/other/codesize/test_codesize_cxx_except.imports index 260df48a1cee4..862370e134c8c 100644 --- a/test/other/codesize/test_codesize_cxx_except.imports +++ b/test/other/codesize/test_codesize_cxx_except.imports @@ -7,7 +7,6 @@ env.__cxa_throw env.__cxa_uncaught_exceptions env.__resumeException env._abort_js -env._emscripten_memcpy_js env._tzset_js env.emscripten_resize_heap env.invoke_diii @@ -17,7 +16,6 @@ env.invoke_ii env.invoke_iii env.invoke_iiii env.invoke_iiiii -env.invoke_iiiiii env.invoke_iiiiiii env.invoke_iiiiiiii env.invoke_iiiiiiiiiiii diff --git a/test/other/codesize/test_codesize_cxx_except.sent b/test/other/codesize/test_codesize_cxx_except.sent index 74d4d57edf6f8..812e8004418b0 100644 --- a/test/other/codesize/test_codesize_cxx_except.sent +++ b/test/other/codesize/test_codesize_cxx_except.sent @@ -7,7 +7,6 @@ __cxa_throw __cxa_uncaught_exceptions __resumeException _abort_js -_emscripten_memcpy_js _tzset_js emscripten_resize_heap environ_get diff --git a/test/other/codesize/test_codesize_cxx_except_wasm.imports b/test/other/codesize/test_codesize_cxx_except_wasm.imports index 91a534c9f66f0..686c058477034 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm.imports +++ b/test/other/codesize/test_codesize_cxx_except_wasm.imports @@ -1,5 +1,4 @@ env._abort_js -env._emscripten_memcpy_js env._tzset_js env.emscripten_resize_heap wasi_snapshot_preview1.environ_get diff --git a/test/other/codesize/test_codesize_cxx_except_wasm.sent b/test/other/codesize/test_codesize_cxx_except_wasm.sent index 7dc8ebef23ae9..f307b35a2ffb0 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm.sent +++ b/test/other/codesize/test_codesize_cxx_except_wasm.sent @@ -1,5 +1,4 @@ _abort_js -_emscripten_memcpy_js _tzset_js emscripten_resize_heap environ_get diff --git a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.imports b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.imports index 91a534c9f66f0..686c058477034 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.imports +++ b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.imports @@ -1,5 +1,4 @@ env._abort_js -env._emscripten_memcpy_js env._tzset_js env.emscripten_resize_heap wasi_snapshot_preview1.environ_get diff --git a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.sent b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.sent index 7dc8ebef23ae9..f307b35a2ffb0 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.sent +++ b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.sent @@ -1,5 +1,4 @@ _abort_js -_emscripten_memcpy_js _tzset_js emscripten_resize_heap environ_get diff --git a/test/other/codesize/test_codesize_cxx_mangle.imports b/test/other/codesize/test_codesize_cxx_mangle.imports index 260df48a1cee4..862370e134c8c 100644 --- a/test/other/codesize/test_codesize_cxx_mangle.imports +++ b/test/other/codesize/test_codesize_cxx_mangle.imports @@ -7,7 +7,6 @@ env.__cxa_throw env.__cxa_uncaught_exceptions env.__resumeException env._abort_js -env._emscripten_memcpy_js env._tzset_js env.emscripten_resize_heap env.invoke_diii @@ -17,7 +16,6 @@ env.invoke_ii env.invoke_iii env.invoke_iiii env.invoke_iiiii -env.invoke_iiiiii env.invoke_iiiiiii env.invoke_iiiiiiii env.invoke_iiiiiiiiiiii diff --git a/test/other/codesize/test_codesize_cxx_mangle.sent b/test/other/codesize/test_codesize_cxx_mangle.sent index 74d4d57edf6f8..812e8004418b0 100644 --- a/test/other/codesize/test_codesize_cxx_mangle.sent +++ b/test/other/codesize/test_codesize_cxx_mangle.sent @@ -7,7 +7,6 @@ __cxa_throw __cxa_uncaught_exceptions __resumeException _abort_js -_emscripten_memcpy_js _tzset_js emscripten_resize_heap environ_get diff --git a/test/other/codesize/test_codesize_cxx_noexcept.imports b/test/other/codesize/test_codesize_cxx_noexcept.imports index 39ee5c0a1feea..b4c8651dc0e7a 100644 --- a/test/other/codesize/test_codesize_cxx_noexcept.imports +++ b/test/other/codesize/test_codesize_cxx_noexcept.imports @@ -1,6 +1,5 @@ env.__cxa_throw env._abort_js -env._emscripten_memcpy_js env._tzset_js env.emscripten_resize_heap wasi_snapshot_preview1.environ_get diff --git a/test/other/codesize/test_codesize_cxx_noexcept.sent b/test/other/codesize/test_codesize_cxx_noexcept.sent index 469227e5c1d77..ba1faccf2d36d 100644 --- a/test/other/codesize/test_codesize_cxx_noexcept.sent +++ b/test/other/codesize/test_codesize_cxx_noexcept.sent @@ -1,6 +1,5 @@ __cxa_throw _abort_js -_emscripten_memcpy_js _tzset_js emscripten_resize_heap environ_get diff --git a/test/other/codesize/test_codesize_cxx_wasmfs.imports b/test/other/codesize/test_codesize_cxx_wasmfs.imports index 04f0a4519e9fc..9abae4f3562be 100644 --- a/test/other/codesize/test_codesize_cxx_wasmfs.imports +++ b/test/other/codesize/test_codesize_cxx_wasmfs.imports @@ -1,6 +1,5 @@ env.__cxa_throw env._abort_js -env._emscripten_memcpy_js env._tzset_js env._wasmfs_copy_preloaded_file_data env._wasmfs_get_num_preloaded_dirs diff --git a/test/other/codesize/test_codesize_cxx_wasmfs.sent b/test/other/codesize/test_codesize_cxx_wasmfs.sent index a0049ced118ca..4c86de922a934 100644 --- a/test/other/codesize/test_codesize_cxx_wasmfs.sent +++ b/test/other/codesize/test_codesize_cxx_wasmfs.sent @@ -1,6 +1,5 @@ __cxa_throw _abort_js -_emscripten_memcpy_js _tzset_js _wasmfs_copy_preloaded_file_data _wasmfs_get_num_preloaded_dirs diff --git a/test/other/codesize/test_codesize_files_wasmfs.imports b/test/other/codesize/test_codesize_files_wasmfs.imports index 74ec884c2cde4..519a7e0d06403 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.imports +++ b/test/other/codesize/test_codesize_files_wasmfs.imports @@ -11,6 +11,5 @@ j (_wasmfs_get_preloaded_child_path) k (_wasmfs_get_num_preloaded_files) l (_wasmfs_get_num_preloaded_dirs) m (_wasmfs_copy_preloaded_file_data) -n (_emscripten_memcpy_js) -o (_abort_js) -p (random_get) +n (_abort_js) +o (random_get) diff --git a/test/other/codesize/test_codesize_files_wasmfs.sent b/test/other/codesize/test_codesize_files_wasmfs.sent index 74ec884c2cde4..519a7e0d06403 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.sent +++ b/test/other/codesize/test_codesize_files_wasmfs.sent @@ -11,6 +11,5 @@ j (_wasmfs_get_preloaded_child_path) k (_wasmfs_get_num_preloaded_files) l (_wasmfs_get_num_preloaded_dirs) m (_wasmfs_copy_preloaded_file_data) -n (_emscripten_memcpy_js) -o (_abort_js) -p (random_get) +n (_abort_js) +o (random_get) diff --git a/test/test_other.py b/test/test_other.py index 0e6405845ed8a..85d9858369e59 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -10355,7 +10355,7 @@ def compile(flags): self.run_process([EMCC, test_file('hello_world.c')] + flags) compile(['-c']) - verify_features_sec('bulk-memory', False) + verify_features_sec('bulk-memory', True) verify_features_sec('nontrapping-fptoint', False) verify_features_sec('sign-ext', True) verify_features_sec('mutable-globals', True) @@ -10365,6 +10365,10 @@ def compile(flags): compile(['-mnontrapping-fptoint', '-c']) verify_features_sec('nontrapping-fptoint', True) + compile(['-sMIN_SAFARI_VERSION=140000']) + verify_features_sec_linked('bulk-memory', True) + verify_features_sec_linked('bulk-nontrapping-fptoint', True) + # BIGINT causes binaryen to not run, and keeps the target_features section after link # Setting this SAFARI_VERSION should enable bulk memory because it links in emscripten_memcpy_bulkmem # However it does not enable nontrapping-fptoint yet because it has no effect at compile time and diff --git a/tools/link.py b/tools/link.py index b7759ff0b0b24..6ec83195b651e 100644 --- a/tools/link.py +++ b/tools/link.py @@ -340,6 +340,8 @@ def get_binaryen_passes(): if not feature_matrix.caniuse(feature_matrix.Feature.SIGN_EXT): logger.debug('lowering sign-ext feature due to incompatible target browser engines') passes += ['--signext-lowering'] + if not feature_matrix.caniuse(feature_matrix.Feature.BULK_MEMORY): + logger.debug('lowering bulk-memory feature due to incompatible target browser engines') if optimizing: passes += ['--post-emscripten'] if settings.SIDE_MODULE: diff --git a/tools/system_libs.py b/tools/system_libs.py index 9c99272dd63e8..22255e684c4ac 100644 --- a/tools/system_libs.py +++ b/tools/system_libs.py @@ -1396,7 +1396,7 @@ class libbulkmemory(MuslInternalLibrary, AsanInstrumentedLibrary): cflags = ['-mbulk-memory'] def can_use(self): - return super(libbulkmemory, self).can_use() and settings.BULK_MEMORY + return super(libbulkmemory, self).can_use() class libprintf_long_double(libc): @@ -2361,8 +2361,8 @@ def add_sanitizer_libs(): if settings.SHRINK_LEVEL >= 2 and not settings.LINKABLE and \ not os.environ.get('EMCC_FORCE_STDLIBS'): add_library('libc_optz') - if settings.BULK_MEMORY: - add_library('libbulkmemory') + # TODO: Just move this into libc? + add_library('libbulkmemory') if settings.STANDALONE_WASM: add_library('libstandalonewasm') if settings.ALLOW_UNIMPLEMENTED_SYSCALLS: From d38642b4980acf3db67f7b75682ea14f6fd18acf Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 5 Nov 2024 17:13:58 -0800 Subject: [PATCH 02/25] remove libbulkmem, fix for memory64, various fixes --- system/lib/libc/emscripten_memcpy.c | 13 ++++++------- system/lib/libc/emscripten_memcpy_bulkmem.S | 12 +++++++++--- system/lib/libc/emscripten_memset.c | 11 +---------- system/lib/libc/emscripten_memset_bulkmem.S | 12 +++++++++--- test/test_other.py | 17 +++++++++++++---- tools/system_libs.py | 19 +++++-------------- 6 files changed, 43 insertions(+), 41 deletions(-) diff --git a/system/lib/libc/emscripten_memcpy.c b/system/lib/libc/emscripten_memcpy.c index f6a58956e4c6a..56016d8b29d13 100644 --- a/system/lib/libc/emscripten_memcpy.c +++ b/system/lib/libc/emscripten_memcpy.c @@ -9,20 +9,20 @@ #include "emscripten_internal.h" // Use the simple/naive version of memcpy when building with asan -#if defined(EMSCRIPTEN_OPTIMIZE_FOR_OZ) || __has_feature(address_sanitizer) +#if __has_feature(address_sanitizer) static void *__memcpy(void *dest, const void *src, size_t n) { unsigned char *d = (unsigned char *)dest; const unsigned char *s = (const unsigned char *)src; -#pragma clang loop unroll(disable) while(n--) *d++ = *s++; return dest; } -#elif defined(__wasm_bulk_memory__) +#elif defined(__wasm_bulk_memory__) || defined(EMSCRIPTEN_OPTIMIZE_FOR_OZ) static void *__memcpy(void *restrict dest, const void *restrict src, size_t n) { - return n ? _emscripten_memcpy_bulkmem(dest, src, n) : dest; + // TODO: Ensure this is inlined with Binaryen or inline asm + return _emscripten_memcpy_bulkmem(dest, src, n); } #else @@ -35,12 +35,11 @@ static void *__memcpy(void *restrict dest, const void *restrict src, size_t n) { unsigned char *block_aligned_d_end; unsigned char *d_end; -#if !defined(EMSCRIPTEN_STANDALONE_WASM) if (n >= 512) { - _emscripten_memcpy_js(dest, src, n); + // TODO: Re-investigate the size threshold to enable this + _emscripten_memcpy_bulkmem(dest, src, n); return dest; } -#endif d_end = d + n; if ((((uintptr_t)d) & 3) == (((uintptr_t)s) & 3)) { diff --git a/system/lib/libc/emscripten_memcpy_bulkmem.S b/system/lib/libc/emscripten_memcpy_bulkmem.S index 7a59102f24105..5ff3a2777253c 100644 --- a/system/lib/libc/emscripten_memcpy_bulkmem.S +++ b/system/lib/libc/emscripten_memcpy_bulkmem.S @@ -7,10 +7,16 @@ .globl _emscripten_memcpy_bulkmem _emscripten_memcpy_bulkmem: .functype _emscripten_memcpy_bulkmem (PTR, PTR, PTR) -> (PTR) - local.get 0 - local.get 1 local.get 2 - memory.copy 0, 0 +#ifdef __wasm64__ + i32.wrap_i64 +#endif + if + local.get 0 + local.get 1 + local.get 2 + memory.copy 0, 0 + end_if local.get 0 end_function diff --git a/system/lib/libc/emscripten_memset.c b/system/lib/libc/emscripten_memset.c index 1b51a68b9c76a..202ca61800ac0 100644 --- a/system/lib/libc/emscripten_memset.c +++ b/system/lib/libc/emscripten_memset.c @@ -9,16 +9,7 @@ __attribute__((no_sanitize("address"))) void *__memset(void *str, int c, size_t __attribute__((__weak__)) void *__musl_memset(void *str, int c, size_t n); __attribute__((__weak__)) void *__memset(void *str, int c, size_t n); -#ifdef EMSCRIPTEN_OPTIMIZE_FOR_OZ - -void *__memset(void *str, int c, size_t n) { - unsigned char *s = (unsigned char *)str; -#pragma clang loop unroll(disable) - while(n--) *s++ = c; - return str; -} - -#elif defined(__wasm_bulk_memory__) +#if defined(__wasm_bulk_memory__) || defined(EMSCRIPTEN_OPTIMIZE_FOR_OZ) void *__memset(void *str, int c, size_t n) { return _emscripten_memset_bulkmem(str, c, n); diff --git a/system/lib/libc/emscripten_memset_bulkmem.S b/system/lib/libc/emscripten_memset_bulkmem.S index f734e6ccc0ad5..658f9937b4b8f 100644 --- a/system/lib/libc/emscripten_memset_bulkmem.S +++ b/system/lib/libc/emscripten_memset_bulkmem.S @@ -7,10 +7,16 @@ .globl _emscripten_memset_bulkmem _emscripten_memset_bulkmem: .functype _emscripten_memset_bulkmem (PTR, i32, PTR) -> (PTR) - local.get 0 - local.get 1 local.get 2 - memory.fill 0 +#ifdef __wasm64__ + i32.wrap_i64 +#endif + if + local.get 0 + local.get 1 + local.get 2 + memory.fill 0 + end_if local.get 0 end_function diff --git a/test/test_other.py b/test/test_other.py index 85d9858369e59..9fcef12b399b4 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -10337,6 +10337,8 @@ def test_wasm_features_section(self, args): def test_wasm_features(self): # Test that wasm features are explicitly enabled or disabled based on target engine version + # Here we are reading the features section and trusting that LLVM and/or Binaryen faithfully + # represent what features are used def verify_features_sec(feature, expect_in, linked=False): with webassembly.Module('a.out.wasm' if linked else 'hello_world.o') as module: features = module.get_target_features() @@ -10365,9 +10367,16 @@ def compile(flags): compile(['-mnontrapping-fptoint', '-c']) verify_features_sec('nontrapping-fptoint', True) + compile(['-sMIN_SAFARI_VERSION=120000']) + verify_features_sec_linked('sign-ext', False) + compile(['-sMIN_SAFARI_VERSION=140000']) + verify_features_sec_linked('bulk-memory', True) # XXX fix before commit + verify_features_sec_linked('nontrapping-fptoint', False) + + compile(['-sMIN_SAFARI_VERSION=140100', '-pthread']) + verify_features_sec_linked('atomics', True) verify_features_sec_linked('bulk-memory', True) - verify_features_sec_linked('bulk-nontrapping-fptoint', True) # BIGINT causes binaryen to not run, and keeps the target_features section after link # Setting this SAFARI_VERSION should enable bulk memory because it links in emscripten_memcpy_bulkmem @@ -10381,7 +10390,7 @@ def compile(flags): verify_features_sec_linked('nontrapping-fptoint', False) compile(['-sMIN_SAFARI_VERSION=150000', '-mno-bulk-memory', '-sWASM_BIGINT']) - # FIXME? -mno-bulk-memory at link time does not override MIN_SAFARI_VERSION. it probably should? + # FIXME? -mno-bulk-memory etc at link time do not override MIN_SAFARI_VERSION. should they? verify_features_sec_linked('bulk-memory', True) def test_js_preprocess(self): @@ -13311,7 +13320,7 @@ def test_offset_convertor_plus_wasm2js(self): def test_standard_library_mapping(self): # Test the `-l` flags on the command line get mapped the correct libraries variant - libs = ['-lc', '-lbulkmemory', '-lcompiler_rt', '-lmalloc'] + libs = ['-lc', '-lcompiler_rt', '-lmalloc'] err = self.run_process([EMCC, test_file('hello_world.c'), '-pthread', '-nodefaultlibs', '-v'] + libs, stderr=PIPE).stderr # Check that the linker was run with `-mt` variants because `-pthread` was passed. @@ -14858,7 +14867,7 @@ def test_preload_module(self, args): @node_pthreads def test_standalone_whole_archive(self): - self.emcc_args += ['-sSTANDALONE_WASM', '-pthread', '-Wl,--whole-archive', '-lbulkmemory', '-lstandalonewasm', '-Wl,--no-whole-archive'] + self.emcc_args += ['-sSTANDALONE_WASM', '-pthread', '-Wl,--whole-archive', '-lstandalonewasm', '-Wl,--no-whole-archive'] self.do_runf('hello_world.c') @parameterized({ diff --git a/tools/system_libs.py b/tools/system_libs.py index 22255e684c4ac..ddc775962ec3a 100644 --- a/tools/system_libs.py +++ b/tools/system_libs.py @@ -1051,6 +1051,7 @@ def get_libcall_files(self): other_files = files_in_path( path='system/lib/libc', filenames=['emscripten_memcpy.c', 'emscripten_memset.c', + 'emscripten_memcpy_bulkmem.S', 'emscripten_memset_bulkmem.S', 'emscripten_scan_stack.c', 'emscripten_get_heap_size.c', # needed by malloc 'emscripten_memmove.c']) @@ -1287,6 +1288,8 @@ def get_files(self): 'emscripten_memcpy.c', 'emscripten_memmove.c', 'emscripten_memset.c', + 'emscripten_memcpy_bulkmem.S', + 'emscripten_memset_bulkmem.S', 'emscripten_mmap.c', 'emscripten_scan_stack.c', 'emscripten_time.c', @@ -1388,17 +1391,6 @@ def can_use(self): not settings.LINKABLE and not os.environ.get('EMCC_FORCE_STDLIBS') -class libbulkmemory(MuslInternalLibrary, AsanInstrumentedLibrary): - name = 'libbulkmemory' - src_dir = 'system/lib/libc' - src_files = ['emscripten_memcpy.c', 'emscripten_memset.c', - 'emscripten_memcpy_bulkmem.S', 'emscripten_memset_bulkmem.S'] - cflags = ['-mbulk-memory'] - - def can_use(self): - return super(libbulkmemory, self).can_use() - - class libprintf_long_double(libc): name = 'libprintf_long_double' cflags = ['-DEMSCRIPTEN_PRINTF_LONG_DOUBLE'] @@ -2201,7 +2193,8 @@ def get_files(self): '__main_void.c']) files += files_in_path( path='system/lib/libc', - filenames=['emscripten_memcpy.c', 'emscripten_memset.c']) + filenames=['emscripten_memcpy.c', 'emscripten_memset.c', + ]) # XXX why do we need the C files here but not the S files? # It is more efficient to use JS methods for time, normally. files += files_in_path( path='system/lib/libc/musl/src/time', @@ -2361,8 +2354,6 @@ def add_sanitizer_libs(): if settings.SHRINK_LEVEL >= 2 and not settings.LINKABLE and \ not os.environ.get('EMCC_FORCE_STDLIBS'): add_library('libc_optz') - # TODO: Just move this into libc? - add_library('libbulkmemory') if settings.STANDALONE_WASM: add_library('libstandalonewasm') if settings.ALLOW_UNIMPLEMENTED_SYSCALLS: From 40e4fec7a9019aa7de6feb8a4053dfd0142b52da Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 6 Nov 2024 10:57:31 -0800 Subject: [PATCH 03/25] more fixes --- src/library_sigs.js | 1 - test/test_other.py | 28 ---------------------------- tools/feature_matrix.py | 7 +++++++ 3 files changed, 7 insertions(+), 29 deletions(-) diff --git a/src/library_sigs.js b/src/library_sigs.js index 33dda2c63ae02..2e147de3b753f 100644 --- a/src/library_sigs.js +++ b/src/library_sigs.js @@ -323,7 +323,6 @@ sigs = { _emscripten_get_progname__sig: 'vpi', _emscripten_init_main_thread_js__sig: 'vp', _emscripten_lookup_name__sig: 'ip', - _emscripten_memcpy_js__sig: 'vppp', _emscripten_notify_mailbox_postmessage__sig: 'vpp', _emscripten_push_main_loop_blocker__sig: 'vppp', _emscripten_push_uncounted_main_loop_blocker__sig: 'vppp', diff --git a/test/test_other.py b/test/test_other.py index 9fcef12b399b4..9787de004ca31 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -14647,34 +14647,6 @@ def test_wasi_with_sjlj(self): self.set_setting('DEFAULT_TO_CXX') self.do_runf(test_file('core/test_longjmp.c'), emcc_args=self.get_emcc_args()) - def test_memops_bulk_memory(self): - self.emcc_args += ['--profiling-funcs', '-fno-builtin'] - - def run(args, expect_bulk_mem): - self.do_runf('other/test_memops_bulk_memory.c', emcc_args=args) - funcs = self.parse_wasm('test_memops_bulk_memory.wasm')[2] - js = read_file('test_memops_bulk_memory.js') - if expect_bulk_mem: - self.assertNotContained('_emscripten_memcpy_js', js) - self.assertIn('$_emscripten_memcpy_bulkmem', funcs) - else: - self.assertContained('_emscripten_memcpy_js', js) - self.assertNotIn('$_emscripten_memcpy_bulkmem', funcs) - - # By default we expect to find `_emscripten_memcpy_js` in the generaed JS - # and not to find the `emscripten_memcpy_bulkmem` function on the wasm - # side. - run([], expect_bulk_mem=False) - - # With bulk memory enabled we expect *not* to find it. - run(['-mbulk-memory'], expect_bulk_mem=True) - - run(['-mbulk-memory', '-mno-bulk-memory'], expect_bulk_mem=False) - - # -pthread implicitly enables bulk memory too. - self.setup_node_pthreads() - run(['-pthread'], expect_bulk_mem=True) - def test_memory_init_file_unsupported(self): err = self.expect_fail([EMCC, test_file('hello_world.c'), '--memory-init-file=1']) self.assertContained('error: --memory-init-file is no longer supported', err) diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index 0b6a26368e99e..124863ba09940 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -123,6 +123,13 @@ def enable_feature(feature, reason): if settings[name] < min_version: if name in user_settings: # If the user explicitly chose an older version we issue a warning. + if name == 'MIN_SAFARI_VERSION' and feature == 'pthreads': + # But as a special case, don't warn when forcing on bulk memory on Safari. + # This is because Safari implemented part of bulk memory along with threads in 14.1, + # but not all of it. So bulk-mem is listed as supported in 15.0. So we want to + # continue enabling bulk memory via pthreads without a warning in 14.1, but without + # enabling other features requiring 15.0. + continue diagnostics.warning( 'compatibility', f'{name}={user_settings[name]} is not compatible with {reason} ' From ffc87f740b6f5fa5b203c4798abd248fe71ae4fd Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 6 Nov 2024 14:57:08 -0800 Subject: [PATCH 04/25] add lowering pass, fix some tests --- test/test_other.py | 8 ++++++++ tools/feature_matrix.py | 2 ++ tools/link.py | 1 + 3 files changed, 11 insertions(+) diff --git a/test/test_other.py b/test/test_other.py index 9787de004ca31..50d478c4aa765 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -10393,6 +10393,14 @@ def compile(flags): # FIXME? -mno-bulk-memory etc at link time do not override MIN_SAFARI_VERSION. should they? verify_features_sec_linked('bulk-memory', True) + # feature_matrix has the (IMO strange) behavior that enabling one feature supported by + # a particular browser version will cause all other features supported by that version + # to be enabled as well. + # TODO: is this test redundant with test_signext_lowering? + compile(['-sWASM_BIGINT']) + verify_features_sec_linked('bulk-memory', True) + verify_features_sec_linked('nontrapping-fptoint', True) + def test_js_preprocess(self): # Use stderr rather than stdout here because stdout is redirected to the output JS file itself. create_file('lib.js', ''' diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index 124863ba09940..db79f21780e8d 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -148,6 +148,8 @@ def apply_min_browser_versions(): if settings.PTHREADS: enable_feature(Feature.THREADS, 'pthreads') enable_feature(Feature.BULK_MEMORY, 'pthreads') + if settings.WASM_WORKERS: + enable_feature(Feature.BULK_MEMORY, 'wasm-workers') if settings.AUDIO_WORKLET: enable_feature(Feature.GLOBALTHIS, 'AUDIO_WORKLET') if settings.MEMORY64 == 1: diff --git a/tools/link.py b/tools/link.py index 6ec83195b651e..48d799adac77e 100644 --- a/tools/link.py +++ b/tools/link.py @@ -342,6 +342,7 @@ def get_binaryen_passes(): passes += ['--signext-lowering'] if not feature_matrix.caniuse(feature_matrix.Feature.BULK_MEMORY): logger.debug('lowering bulk-memory feature due to incompatible target browser engines') + passes += ['--memory-copy-fill-lowering'] if optimizing: passes += ['--post-emscripten'] if settings.SIDE_MODULE: From 8aa18123995b9b9075a1ac56320a24eb012698dd Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 6 Nov 2024 15:44:45 -0800 Subject: [PATCH 05/25] simplify return --- system/lib/libc/emscripten_memcpy.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/system/lib/libc/emscripten_memcpy.c b/system/lib/libc/emscripten_memcpy.c index 56016d8b29d13..b460877702155 100644 --- a/system/lib/libc/emscripten_memcpy.c +++ b/system/lib/libc/emscripten_memcpy.c @@ -37,8 +37,7 @@ static void *__memcpy(void *restrict dest, const void *restrict src, size_t n) { if (n >= 512) { // TODO: Re-investigate the size threshold to enable this - _emscripten_memcpy_bulkmem(dest, src, n); - return dest; + return _emscripten_memcpy_bulkmem(dest, src, n); } d_end = d + n; From c0994186a3fa1f667cb90e4d5af18adec86caab1 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 8 Nov 2024 10:18:18 -0800 Subject: [PATCH 06/25] require bulk memory --- system/lib/libc/emscripten_memcpy.c | 6 +++++- system/lib/libc/emscripten_memset.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/system/lib/libc/emscripten_memcpy.c b/system/lib/libc/emscripten_memcpy.c index b460877702155..54ef045b8a89a 100644 --- a/system/lib/libc/emscripten_memcpy.c +++ b/system/lib/libc/emscripten_memcpy.c @@ -8,6 +8,10 @@ #include "libc.h" #include "emscripten_internal.h" +#if !defined(__wasm_bulk_memory__) +#error "This file must be compile with bulk memory enabled" +#endif + // Use the simple/naive version of memcpy when building with asan #if __has_feature(address_sanitizer) @@ -18,7 +22,7 @@ static void *__memcpy(void *dest, const void *src, size_t n) { return dest; } -#elif defined(__wasm_bulk_memory__) || defined(EMSCRIPTEN_OPTIMIZE_FOR_OZ) +#elif defined(EMSCRIPTEN_OPTIMIZE_FOR_OZ) static void *__memcpy(void *restrict dest, const void *restrict src, size_t n) { // TODO: Ensure this is inlined with Binaryen or inline asm diff --git a/system/lib/libc/emscripten_memset.c b/system/lib/libc/emscripten_memset.c index 202ca61800ac0..3fc0f58061975 100644 --- a/system/lib/libc/emscripten_memset.c +++ b/system/lib/libc/emscripten_memset.c @@ -9,7 +9,11 @@ __attribute__((no_sanitize("address"))) void *__memset(void *str, int c, size_t __attribute__((__weak__)) void *__musl_memset(void *str, int c, size_t n); __attribute__((__weak__)) void *__memset(void *str, int c, size_t n); -#if defined(__wasm_bulk_memory__) || defined(EMSCRIPTEN_OPTIMIZE_FOR_OZ) +#if !defined(__wasm_bulk_memory__) +#error "This file must be compiled with bulk memory enabled" +#endif + +#if defined(EMSCRIPTEN_OPTIMIZE_FOR_OZ) void *__memset(void *str, int c, size_t n) { return _emscripten_memset_bulkmem(str, c, n); From ec3483afb885e835b1463a2d9e2305f213e5ba17 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 8 Nov 2024 10:31:42 -0800 Subject: [PATCH 07/25] fix warnings --- tools/feature_matrix.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index db79f21780e8d..28a655ea6403b 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -123,7 +123,7 @@ def enable_feature(feature, reason): if settings[name] < min_version: if name in user_settings: # If the user explicitly chose an older version we issue a warning. - if name == 'MIN_SAFARI_VERSION' and feature == 'pthreads': + if name == 'MIN_SAFARI_VERSION' and reason == 'pthreads': # But as a special case, don't warn when forcing on bulk memory on Safari. # This is because Safari implemented part of bulk memory along with threads in 14.1, # but not all of it. So bulk-mem is listed as supported in 15.0. So we want to @@ -148,7 +148,7 @@ def apply_min_browser_versions(): if settings.PTHREADS: enable_feature(Feature.THREADS, 'pthreads') enable_feature(Feature.BULK_MEMORY, 'pthreads') - if settings.WASM_WORKERS: + if settings.WASM_WORKERS or settings.SHARED_MEMORY: enable_feature(Feature.BULK_MEMORY, 'wasm-workers') if settings.AUDIO_WORKLET: enable_feature(Feature.GLOBALTHIS, 'AUDIO_WORKLET') From 51ffac798236401cb2af0d295c36d1f7d214b21b Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 21 Nov 2024 17:19:11 -0800 Subject: [PATCH 08/25] Update safari version, update pass name, fixes --- emcc.py | 6 ------ test/test_other.py | 20 ++------------------ tools/feature_matrix.py | 2 +- tools/link.py | 2 +- tools/system_libs.py | 4 ---- 5 files changed, 4 insertions(+), 30 deletions(-) diff --git a/emcc.py b/emcc.py index de7614acada1d..37e8e41029a1f 100644 --- a/emcc.py +++ b/emcc.py @@ -385,12 +385,6 @@ def get_clang_flags(user_args): if '-mbulk-memory' not in user_args: flags.append('-mbulk-memory') - # In emscripten we currently disable bulk memory by default. - # This should be removed/updated when we als update the default browser targets. - #if '-mbulk-memory' not in user_args and '-mno-bulk-memory' not in user_args: - # Bulk memory may be enabled via threads or directly via -s. - # if not settings.BULK_MEMORY: - # flags.append('-mno-bulk-memory') if '-mnontrapping-fptoint' not in user_args and '-mno-nontrapping-fptoint' not in user_args: flags.append('-mno-nontrapping-fptoint') diff --git a/test/test_other.py b/test/test_other.py index f1d90e8385e27..98d2f205d920e 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -8511,7 +8511,7 @@ def test_binaryen_warn_mem(self): self.run_process([EMCC, test_file('hello_world.c'), '-sINITIAL_MEMORY=' + str(16 * 1024 * 1024), '--pre-js', 'pre.js', '-sWASM_ASYNC_COMPILATION=0', '-sIMPORTED_MEMORY']) out = self.run_js('a.out.js', assert_returncode=NON_ZERO) self.assertContained('LinkError', out) - self.assertContained("memory import 2 has a larger maximum size 800 than the module's declared maximum", out) + self.assertContained("memory import 1 has a larger maximum size 800 than the module's declared maximum", out) self.assertNotContained('hello, world!', out) # and with memory growth, all should be good self.run_process([EMCC, test_file('hello_world.c'), '-sINITIAL_MEMORY=' + str(16 * 1024 * 1024), '--pre-js', 'pre.js', '-sALLOW_MEMORY_GROWTH', '-sWASM_ASYNC_COMPILATION=0', '-sIMPORTED_MEMORY']) @@ -10458,18 +10458,10 @@ def compile(flags): compile(['-mnontrapping-fptoint', '-c']) verify_features_sec('nontrapping-fptoint', True) - compile(['-sMIN_SAFARI_VERSION=120000']) - verify_features_sec_linked('sign-ext', False) - compile(['-sMIN_SAFARI_VERSION=140000']) - verify_features_sec_linked('bulk-memory', True) # XXX fix before commit + verify_features_sec_linked('bulk-memory', False) verify_features_sec_linked('nontrapping-fptoint', False) - compile(['-sMIN_SAFARI_VERSION=140100', '-pthread']) - verify_features_sec_linked('atomics', True) - verify_features_sec_linked('bulk-memory', True) - - # BIGINT causes binaryen to not run, and keeps the target_features section after link # Setting this SAFARI_VERSION should enable bulk memory because it links in emscripten_memcpy_bulkmem # However it does not enable nontrapping-fptoint yet because it has no effect at compile time and # no libraries include nontrapping yet. @@ -10484,14 +10476,6 @@ def compile(flags): # -mno-bulk-memory at link time overrides MIN_SAFARI_VERSION verify_features_sec_linked('bulk-memory', False) - # feature_matrix has the (IMO strange) behavior that enabling one feature supported by - # a particular browser version will cause all other features supported by that version - # to be enabled as well. - # TODO: is this test redundant with test_signext_lowering? - compile(['-sWASM_BIGINT']) - verify_features_sec_linked('bulk-memory', True) - verify_features_sec_linked('nontrapping-fptoint', True) - def test_js_preprocess(self): # Use stderr rather than stdout here because stdout is redirected to the output JS file itself. create_file('lib.js', ''' diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index 62b1ee046dacc..b3947cfb39575 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -56,7 +56,7 @@ class Feature(IntEnum): Feature.BULK_MEMORY: { 'chrome': 75, 'firefox': 79, - 'safari': 150000, + 'safari': 140100, # TODO: Reset this to 150000 when we update the default. }, Feature.MUTABLE_GLOBALS: { 'chrome': 74, diff --git a/tools/link.py b/tools/link.py index eefa990e190d2..765d8da830b0c 100644 --- a/tools/link.py +++ b/tools/link.py @@ -342,7 +342,7 @@ def get_binaryen_passes(): passes += ['--signext-lowering'] if not feature_matrix.caniuse(feature_matrix.Feature.BULK_MEMORY): logger.debug('lowering bulk-memory feature due to incompatible target browser engines') - passes += ['--memory-copy-fill-lowering'] + passes += ['--llvm-memory-copy-fill-lowering'] if optimizing: passes += ['--post-emscripten'] if settings.SIDE_MODULE: diff --git a/tools/system_libs.py b/tools/system_libs.py index ddc775962ec3a..f049d8532060e 100644 --- a/tools/system_libs.py +++ b/tools/system_libs.py @@ -2191,10 +2191,6 @@ def get_files(self): filenames=['standalone.c', 'standalone_wasm_stdio.c', '__main_void.c']) - files += files_in_path( - path='system/lib/libc', - filenames=['emscripten_memcpy.c', 'emscripten_memset.c', - ]) # XXX why do we need the C files here but not the S files? # It is more efficient to use JS methods for time, normally. files += files_in_path( path='system/lib/libc/musl/src/time', From 76eee637ca6b05448138e95b9445be0f315f8b32 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 21 Nov 2024 17:41:57 -0800 Subject: [PATCH 09/25] add node versions --- tools/feature_matrix.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index b3947cfb39575..f690d3fab16b8 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -47,16 +47,19 @@ class Feature(IntEnum): 'chrome': 75, 'firefox': 65, 'safari': 150000, + 'node': 130000, }, Feature.SIGN_EXT: { 'chrome': 74, 'firefox': 62, 'safari': 140100, + 'node': 120000, }, Feature.BULK_MEMORY: { 'chrome': 75, 'firefox': 79, 'safari': 140100, # TODO: Reset this to 150000 when we update the default. + 'node': 130000, }, Feature.MUTABLE_GLOBALS: { 'chrome': 74, @@ -67,6 +70,7 @@ class Feature(IntEnum): 'chrome': 67, 'firefox': 68, 'safari': 150000, + 'node': 110000, }, Feature.THREADS: { 'chrome': 74, From cd2d0afa7a752aae1ec092040ec51a74bafdb4aa Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 25 Nov 2024 13:38:40 -0800 Subject: [PATCH 10/25] rebaseline codesize tests --- test/code_size/embind_hello_wasm.json | 8 ++++---- test/code_size/embind_val_wasm.json | 8 ++++---- test/code_size/hello_webgl2_wasm.json | 8 ++++---- test/code_size/hello_webgl2_wasm2js.json | 8 ++++---- test/code_size/hello_webgl_wasm.json | 8 ++++---- test/code_size/hello_webgl_wasm2js.json | 8 ++++---- test/code_size/hello_world_wasm.json | 4 ++-- test/code_size/hello_world_wasm2js.js | 1 + test/code_size/hello_world_wasm2js.json | 8 ++++---- test/code_size/math_wasm.json | 8 ++++---- test/code_size/random_printf_wasm.json | 8 ++++---- test/code_size/random_printf_wasm2js.json | 8 ++++---- test/other/codesize/test_codesize_cxx_ctors1.gzsize | 2 +- test/other/codesize/test_codesize_cxx_ctors1.jssize | 2 +- test/other/codesize/test_codesize_cxx_ctors1.size | 2 +- test/other/codesize/test_codesize_cxx_ctors2.gzsize | 2 +- test/other/codesize/test_codesize_cxx_ctors2.jssize | 2 +- test/other/codesize/test_codesize_cxx_ctors2.size | 2 +- test/other/codesize/test_codesize_cxx_except.gzsize | 2 +- test/other/codesize/test_codesize_cxx_except.jssize | 2 +- test/other/codesize/test_codesize_cxx_except.size | 2 +- test/other/codesize/test_codesize_cxx_except_wasm.gzsize | 2 +- test/other/codesize/test_codesize_cxx_except_wasm.jssize | 2 +- test/other/codesize/test_codesize_cxx_except_wasm.size | 2 +- .../codesize/test_codesize_cxx_except_wasm_exnref.gzsize | 2 +- .../codesize/test_codesize_cxx_except_wasm_exnref.jssize | 2 +- .../codesize/test_codesize_cxx_except_wasm_exnref.size | 2 +- test/other/codesize/test_codesize_cxx_lto.size | 2 +- test/other/codesize/test_codesize_cxx_mangle.gzsize | 2 +- test/other/codesize/test_codesize_cxx_mangle.jssize | 2 +- test/other/codesize/test_codesize_cxx_mangle.size | 2 +- test/other/codesize/test_codesize_cxx_noexcept.gzsize | 2 +- test/other/codesize/test_codesize_cxx_noexcept.jssize | 2 +- test/other/codesize/test_codesize_cxx_noexcept.size | 2 +- test/other/codesize/test_codesize_cxx_wasmfs.gzsize | 2 +- test/other/codesize/test_codesize_cxx_wasmfs.jssize | 2 +- test/other/codesize/test_codesize_cxx_wasmfs.size | 2 +- test/other/codesize/test_codesize_files_js_fs.size | 2 +- test/other/codesize/test_codesize_files_wasmfs.exports | 8 ++++---- test/other/codesize/test_codesize_files_wasmfs.funcs | 3 --- test/other/codesize/test_codesize_files_wasmfs.gzsize | 2 +- test/other/codesize/test_codesize_files_wasmfs.jssize | 2 +- test/other/codesize/test_codesize_files_wasmfs.size | 2 +- test/other/codesize/test_codesize_hello_O0.funcs | 1 + test/other/codesize/test_codesize_hello_O0.gzsize | 2 +- test/other/codesize/test_codesize_hello_O0.imports | 1 - test/other/codesize/test_codesize_hello_O0.jssize | 2 +- test/other/codesize/test_codesize_hello_O0.sent | 1 - test/other/codesize/test_codesize_hello_O0.size | 2 +- test/other/codesize/test_codesize_hello_O1.funcs | 1 + test/other/codesize/test_codesize_hello_O1.gzsize | 2 +- test/other/codesize/test_codesize_hello_O1.imports | 1 - test/other/codesize/test_codesize_hello_O1.jssize | 2 +- test/other/codesize/test_codesize_hello_O1.sent | 1 - test/other/codesize/test_codesize_hello_O1.size | 2 +- test/other/codesize/test_codesize_hello_O2.gzsize | 2 +- test/other/codesize/test_codesize_hello_O2.imports | 1 - test/other/codesize/test_codesize_hello_O2.jssize | 2 +- test/other/codesize/test_codesize_hello_O2.sent | 1 - test/other/codesize/test_codesize_hello_O2.size | 2 +- test/other/codesize/test_codesize_hello_O3.exports | 8 ++++---- test/other/codesize/test_codesize_hello_O3.gzsize | 2 +- test/other/codesize/test_codesize_hello_O3.imports | 1 - test/other/codesize/test_codesize_hello_O3.jssize | 2 +- test/other/codesize/test_codesize_hello_O3.sent | 1 - test/other/codesize/test_codesize_hello_O3.size | 2 +- test/other/codesize/test_codesize_hello_Os.exports | 8 ++++---- test/other/codesize/test_codesize_hello_Os.gzsize | 2 +- test/other/codesize/test_codesize_hello_Os.imports | 1 - test/other/codesize/test_codesize_hello_Os.jssize | 2 +- test/other/codesize/test_codesize_hello_Os.sent | 1 - test/other/codesize/test_codesize_hello_Os.size | 2 +- test/other/codesize/test_codesize_hello_Oz.size | 2 +- test/other/codesize/test_codesize_hello_dylink.gzsize | 2 +- test/other/codesize/test_codesize_hello_dylink.imports | 1 - test/other/codesize/test_codesize_hello_dylink.jssize | 2 +- test/other/codesize/test_codesize_hello_dylink.sent | 1 - test/other/codesize/test_codesize_hello_dylink.size | 2 +- test/other/codesize/test_codesize_hello_wasmfs.exports | 8 ++++---- test/other/codesize/test_codesize_hello_wasmfs.gzsize | 2 +- test/other/codesize/test_codesize_hello_wasmfs.imports | 1 - test/other/codesize/test_codesize_hello_wasmfs.jssize | 2 +- test/other/codesize/test_codesize_hello_wasmfs.sent | 1 - test/other/codesize/test_codesize_hello_wasmfs.size | 2 +- .../codesize/test_codesize_libcxxabi_message_O3.size | 2 +- .../test_codesize_libcxxabi_message_O3_standalone.size | 2 +- test/other/codesize/test_codesize_mem_O3.size | 2 +- test/other/codesize/test_codesize_mem_O3_grow.size | 2 +- .../codesize/test_codesize_mem_O3_grow_standalone.size | 2 +- test/other/codesize/test_codesize_mem_O3_standalone.size | 2 +- .../codesize/test_codesize_mem_O3_standalone_lib.size | 2 +- .../codesize/test_codesize_mem_O3_standalone_narg.size | 2 +- .../test_codesize_mem_O3_standalone_narg_flto.size | 2 +- test/other/codesize/test_codesize_minimal_O0.size | 2 +- test/other/codesize/test_codesize_minimal_O1.size | 2 +- test/other/codesize/test_codesize_minimal_pthreads.size | 2 +- test/other/test_unoptimized_code_size.js.size | 2 +- test/other/test_unoptimized_code_size.wasm.size | 2 +- test/other/test_unoptimized_code_size_no_asserts.js.size | 2 +- .../other/test_unoptimized_code_size_no_asserts.wasm.size | 2 +- test/other/test_unoptimized_code_size_strict.js.size | 2 +- test/other/test_unoptimized_code_size_strict.wasm.size | 2 +- 102 files changed, 130 insertions(+), 144 deletions(-) diff --git a/test/code_size/embind_hello_wasm.json b/test/code_size/embind_hello_wasm.json index f3b1d73bc6bec..6300bb3522a85 100644 --- a/test/code_size/embind_hello_wasm.json +++ b/test/code_size/embind_hello_wasm.json @@ -3,8 +3,8 @@ "a.html.gz": 380, "a.js": 9718, "a.js.gz": 4291, - "a.wasm": 7728, - "a.wasm.gz": 3502, - "total": 17998, - "total_gz": 8173 + "a.wasm": 7599, + "a.wasm.gz": 3432, + "total": 17869, + "total_gz": 8103 } diff --git a/test/code_size/embind_val_wasm.json b/test/code_size/embind_val_wasm.json index 9af792edee31e..33d4146fd3de3 100644 --- a/test/code_size/embind_val_wasm.json +++ b/test/code_size/embind_val_wasm.json @@ -3,8 +3,8 @@ "a.html.gz": 380, "a.js": 6849, "a.js.gz": 2947, - "a.wasm": 9568, - "a.wasm.gz": 4911, - "total": 16969, - "total_gz": 8238 + "a.wasm": 9452, + "a.wasm.gz": 4855, + "total": 16853, + "total_gz": 8182 } diff --git a/test/code_size/hello_webgl2_wasm.json b/test/code_size/hello_webgl2_wasm.json index 6a80b58ccd57a..a7994f2e3a960 100644 --- a/test/code_size/hello_webgl2_wasm.json +++ b/test/code_size/hello_webgl2_wasm.json @@ -3,8 +3,8 @@ "a.html.gz": 328, "a.js": 4531, "a.js.gz": 2312, - "a.wasm": 10402, - "a.wasm.gz": 6704, - "total": 15387, - "total_gz": 9344 + "a.wasm": 10344, + "a.wasm.gz": 6680, + "total": 15329, + "total_gz": 9320 } diff --git a/test/code_size/hello_webgl2_wasm2js.json b/test/code_size/hello_webgl2_wasm2js.json index 3d8c851127bc8..7c0b1da64dae7 100644 --- a/test/code_size/hello_webgl2_wasm2js.json +++ b/test/code_size/hello_webgl2_wasm2js.json @@ -1,8 +1,8 @@ { "a.html": 346, "a.html.gz": 262, - "a.js": 22199, - "a.js.gz": 11579, - "total": 22545, - "total_gz": 11841 + "a.js": 22200, + "a.js.gz": 11627, + "total": 22546, + "total_gz": 11889 } diff --git a/test/code_size/hello_webgl_wasm.json b/test/code_size/hello_webgl_wasm.json index 78cc66760308e..3a9aff55d8c06 100644 --- a/test/code_size/hello_webgl_wasm.json +++ b/test/code_size/hello_webgl_wasm.json @@ -3,8 +3,8 @@ "a.html.gz": 328, "a.js": 4069, "a.js.gz": 2158, - "a.wasm": 10402, - "a.wasm.gz": 6704, - "total": 14925, - "total_gz": 9190 + "a.wasm": 10344, + "a.wasm.gz": 6680, + "total": 14867, + "total_gz": 9166 } diff --git a/test/code_size/hello_webgl_wasm2js.json b/test/code_size/hello_webgl_wasm2js.json index 1320f0d8bddcf..5d8584fd8fedc 100644 --- a/test/code_size/hello_webgl_wasm2js.json +++ b/test/code_size/hello_webgl_wasm2js.json @@ -1,8 +1,8 @@ { "a.html": 346, "a.html.gz": 262, - "a.js": 21725, - "a.js.gz": 11413, - "total": 22071, - "total_gz": 11675 + "a.js": 21726, + "a.js.gz": 11467, + "total": 22072, + "total_gz": 11729 } diff --git a/test/code_size/hello_world_wasm.json b/test/code_size/hello_world_wasm.json index dc5b02a59ba81..ba2630c8edfe2 100644 --- a/test/code_size/hello_world_wasm.json +++ b/test/code_size/hello_world_wasm.json @@ -3,8 +3,8 @@ "a.html.gz": 380, "a.js": 283, "a.js.gz": 244, - "a.wasm": 103, + "a.wasm": 106, "a.wasm.gz": 113, - "total": 938, + "total": 941, "total_gz": 737 } diff --git a/test/code_size/hello_world_wasm2js.js b/test/code_size/hello_world_wasm2js.js index 506eec49240aa..b9049f3928eb0 100644 --- a/test/code_size/hello_world_wasm2js.js +++ b/test/code_size/hello_world_wasm2js.js @@ -15,6 +15,7 @@ function e(b) { for (var v, p = 0, t = a, w = f.length, y = a + (3 * w >> 2) - ("=" == f[w - 2]) - ("=" == f[w - 1]); p < w; p += 4) a = m[f.charCodeAt(p + 1)], v = m[f.charCodeAt(p + 2)], c[t++] = m[f.charCodeAt(p)] << 2 | a >> 4, t < y && (c[t++] = a << 4 | v >> 2), t < y && (c[t++] = v << 6 | m[f.charCodeAt(p + 3)]); + return c; } for (var q, m = new Uint8Array(123), n = 25; 0 <= n; --n) m[48 + n] = 52 + n, m[65 + n] = n, m[97 + n] = 26 + n; diff --git a/test/code_size/hello_world_wasm2js.json b/test/code_size/hello_world_wasm2js.json index 4b2ebea84cdfe..191e70bae00a0 100644 --- a/test/code_size/hello_world_wasm2js.json +++ b/test/code_size/hello_world_wasm2js.json @@ -1,8 +1,8 @@ { "a.html": 323, "a.html.gz": 253, - "a.js": 1052, - "a.js.gz": 630, - "total": 1375, - "total_gz": 883 + "a.js": 1061, + "a.js.gz": 629, + "total": 1384, + "total_gz": 882 } diff --git a/test/code_size/math_wasm.json b/test/code_size/math_wasm.json index 391e9180af9a3..f6d66f5d8f40c 100644 --- a/test/code_size/math_wasm.json +++ b/test/code_size/math_wasm.json @@ -3,8 +3,8 @@ "a.html.gz": 380, "a.js": 110, "a.js.gz": 125, - "a.wasm": 2719, - "a.wasm.gz": 1675, - "total": 3381, - "total_gz": 2180 + "a.wasm": 2722, + "a.wasm.gz": 1678, + "total": 3384, + "total_gz": 2183 } diff --git a/test/code_size/random_printf_wasm.json b/test/code_size/random_printf_wasm.json index 2972d5a41da4c..c675ac92074f0 100644 --- a/test/code_size/random_printf_wasm.json +++ b/test/code_size/random_printf_wasm.json @@ -1,6 +1,6 @@ { - "a.html": 12698, - "a.html.gz": 6901, - "total": 12698, - "total_gz": 6901 + "a.html": 12626, + "a.html.gz": 6877, + "total": 12626, + "total_gz": 6877 } diff --git a/test/code_size/random_printf_wasm2js.json b/test/code_size/random_printf_wasm2js.json index 4f592a8bb51a2..51677c84146a7 100644 --- a/test/code_size/random_printf_wasm2js.json +++ b/test/code_size/random_printf_wasm2js.json @@ -1,6 +1,6 @@ { - "a.html": 17276, - "a.html.gz": 7511, - "total": 17276, - "total_gz": 7511 + "a.html": 17308, + "a.html.gz": 7560, + "total": 17308, + "total_gz": 7560 } diff --git a/test/other/codesize/test_codesize_cxx_ctors1.gzsize b/test/other/codesize/test_codesize_cxx_ctors1.gzsize index 70461f8a6e739..de0616b2b6e00 100644 --- a/test/other/codesize/test_codesize_cxx_ctors1.gzsize +++ b/test/other/codesize/test_codesize_cxx_ctors1.gzsize @@ -1 +1 @@ -8450 +8423 diff --git a/test/other/codesize/test_codesize_cxx_ctors1.jssize b/test/other/codesize/test_codesize_cxx_ctors1.jssize index cfe33a90d39b5..9c8ed6dab8268 100644 --- a/test/other/codesize/test_codesize_cxx_ctors1.jssize +++ b/test/other/codesize/test_codesize_cxx_ctors1.jssize @@ -1 +1 @@ -20797 +20743 diff --git a/test/other/codesize/test_codesize_cxx_ctors1.size b/test/other/codesize/test_codesize_cxx_ctors1.size index 67d610a7db4b8..892c2092d40ca 100644 --- a/test/other/codesize/test_codesize_cxx_ctors1.size +++ b/test/other/codesize/test_codesize_cxx_ctors1.size @@ -1 +1 @@ -129276 +128919 diff --git a/test/other/codesize/test_codesize_cxx_ctors2.gzsize b/test/other/codesize/test_codesize_cxx_ctors2.gzsize index 3a402b492b0d7..4be81cb9fb3af 100644 --- a/test/other/codesize/test_codesize_cxx_ctors2.gzsize +++ b/test/other/codesize/test_codesize_cxx_ctors2.gzsize @@ -1 +1 @@ -8436 +8407 diff --git a/test/other/codesize/test_codesize_cxx_ctors2.jssize b/test/other/codesize/test_codesize_cxx_ctors2.jssize index f9b02e898e2f7..61b087013e3d6 100644 --- a/test/other/codesize/test_codesize_cxx_ctors2.jssize +++ b/test/other/codesize/test_codesize_cxx_ctors2.jssize @@ -1 +1 @@ -20765 +20711 diff --git a/test/other/codesize/test_codesize_cxx_ctors2.size b/test/other/codesize/test_codesize_cxx_ctors2.size index 8649e524047b6..70b64e69ddc41 100644 --- a/test/other/codesize/test_codesize_cxx_ctors2.size +++ b/test/other/codesize/test_codesize_cxx_ctors2.size @@ -1 +1 @@ -128722 +128320 diff --git a/test/other/codesize/test_codesize_cxx_except.gzsize b/test/other/codesize/test_codesize_cxx_except.gzsize index 7eee896173205..54b5a9132e773 100644 --- a/test/other/codesize/test_codesize_cxx_except.gzsize +++ b/test/other/codesize/test_codesize_cxx_except.gzsize @@ -1 +1 @@ -9477 +9455 diff --git a/test/other/codesize/test_codesize_cxx_except.jssize b/test/other/codesize/test_codesize_cxx_except.jssize index 790b94dcc58e4..9b9de894d1afe 100644 --- a/test/other/codesize/test_codesize_cxx_except.jssize +++ b/test/other/codesize/test_codesize_cxx_except.jssize @@ -1 +1 @@ -24640 +24587 diff --git a/test/other/codesize/test_codesize_cxx_except.size b/test/other/codesize/test_codesize_cxx_except.size index 4101c1e3f43f1..92c39794e55ca 100644 --- a/test/other/codesize/test_codesize_cxx_except.size +++ b/test/other/codesize/test_codesize_cxx_except.size @@ -1 +1 @@ -171403 +171108 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm.gzsize b/test/other/codesize/test_codesize_cxx_except_wasm.gzsize index 6536dd0d80ddf..240688a836da8 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm.gzsize +++ b/test/other/codesize/test_codesize_cxx_except_wasm.gzsize @@ -1 +1 @@ -8419 +8391 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm.jssize b/test/other/codesize/test_codesize_cxx_except_wasm.jssize index bd029fefbea94..f78897d8c6b83 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm.jssize +++ b/test/other/codesize/test_codesize_cxx_except_wasm.jssize @@ -1 +1 @@ -20691 +20638 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm.size b/test/other/codesize/test_codesize_cxx_except_wasm.size index 9cd423f86ea1c..ba01d3fe8c28d 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm.size +++ b/test/other/codesize/test_codesize_cxx_except_wasm.size @@ -1 +1 @@ -142503 +142225 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.gzsize b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.gzsize index 6536dd0d80ddf..240688a836da8 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.gzsize +++ b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.gzsize @@ -1 +1 @@ -8419 +8391 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.jssize b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.jssize index bd029fefbea94..f78897d8c6b83 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.jssize +++ b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.jssize @@ -1 +1 @@ -20691 +20638 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.size b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.size index 1d7e1abae6ec3..02ccf113d8e16 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.size +++ b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.size @@ -1 +1 @@ -145140 +144862 diff --git a/test/other/codesize/test_codesize_cxx_lto.size b/test/other/codesize/test_codesize_cxx_lto.size index 0f54d0629ace8..1f35140c9cffe 100644 --- a/test/other/codesize/test_codesize_cxx_lto.size +++ b/test/other/codesize/test_codesize_cxx_lto.size @@ -1 +1 @@ -122475 +122347 diff --git a/test/other/codesize/test_codesize_cxx_mangle.gzsize b/test/other/codesize/test_codesize_cxx_mangle.gzsize index a434caefa3d33..24690b277c7fd 100644 --- a/test/other/codesize/test_codesize_cxx_mangle.gzsize +++ b/test/other/codesize/test_codesize_cxx_mangle.gzsize @@ -1 +1 @@ -9480 +9458 diff --git a/test/other/codesize/test_codesize_cxx_mangle.jssize b/test/other/codesize/test_codesize_cxx_mangle.jssize index 790b94dcc58e4..9b9de894d1afe 100644 --- a/test/other/codesize/test_codesize_cxx_mangle.jssize +++ b/test/other/codesize/test_codesize_cxx_mangle.jssize @@ -1 +1 @@ -24640 +24587 diff --git a/test/other/codesize/test_codesize_cxx_mangle.size b/test/other/codesize/test_codesize_cxx_mangle.size index 586adb4028ee1..cfe90b8d77a10 100644 --- a/test/other/codesize/test_codesize_cxx_mangle.size +++ b/test/other/codesize/test_codesize_cxx_mangle.size @@ -1 +1 @@ -232914 +232790 diff --git a/test/other/codesize/test_codesize_cxx_noexcept.gzsize b/test/other/codesize/test_codesize_cxx_noexcept.gzsize index 70461f8a6e739..de0616b2b6e00 100644 --- a/test/other/codesize/test_codesize_cxx_noexcept.gzsize +++ b/test/other/codesize/test_codesize_cxx_noexcept.gzsize @@ -1 +1 @@ -8450 +8423 diff --git a/test/other/codesize/test_codesize_cxx_noexcept.jssize b/test/other/codesize/test_codesize_cxx_noexcept.jssize index cfe33a90d39b5..9c8ed6dab8268 100644 --- a/test/other/codesize/test_codesize_cxx_noexcept.jssize +++ b/test/other/codesize/test_codesize_cxx_noexcept.jssize @@ -1 +1 @@ -20797 +20743 diff --git a/test/other/codesize/test_codesize_cxx_noexcept.size b/test/other/codesize/test_codesize_cxx_noexcept.size index ff65c81fe6324..c82d5e805905c 100644 --- a/test/other/codesize/test_codesize_cxx_noexcept.size +++ b/test/other/codesize/test_codesize_cxx_noexcept.size @@ -1 +1 @@ -132080 +131731 diff --git a/test/other/codesize/test_codesize_cxx_wasmfs.gzsize b/test/other/codesize/test_codesize_cxx_wasmfs.gzsize index 4a45c385de208..ae66aa49f5efd 100644 --- a/test/other/codesize/test_codesize_cxx_wasmfs.gzsize +++ b/test/other/codesize/test_codesize_cxx_wasmfs.gzsize @@ -1 +1 @@ -3895 +3873 diff --git a/test/other/codesize/test_codesize_cxx_wasmfs.jssize b/test/other/codesize/test_codesize_cxx_wasmfs.jssize index 4a63574e4a00e..a32df27cb8771 100644 --- a/test/other/codesize/test_codesize_cxx_wasmfs.jssize +++ b/test/other/codesize/test_codesize_cxx_wasmfs.jssize @@ -1 +1 @@ -8691 +8638 diff --git a/test/other/codesize/test_codesize_cxx_wasmfs.size b/test/other/codesize/test_codesize_cxx_wasmfs.size index 8577c65274f9b..3f188d53f524b 100644 --- a/test/other/codesize/test_codesize_cxx_wasmfs.size +++ b/test/other/codesize/test_codesize_cxx_wasmfs.size @@ -1 +1 @@ -169523 +169237 diff --git a/test/other/codesize/test_codesize_files_js_fs.size b/test/other/codesize/test_codesize_files_js_fs.size index 6bb2f4ee89f3f..bd03e260e74c2 100644 --- a/test/other/codesize/test_codesize_files_js_fs.size +++ b/test/other/codesize/test_codesize_files_js_fs.size @@ -1 +1 @@ -389 +392 diff --git a/test/other/codesize/test_codesize_files_wasmfs.exports b/test/other/codesize/test_codesize_files_wasmfs.exports index 1b3d6ede9e560..b64e135c8e3cf 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.exports +++ b/test/other/codesize/test_codesize_files_wasmfs.exports @@ -1,4 +1,4 @@ -q (memory) -r (__wasm_call_ctors) -s (main) -t (__indirect_function_table) +p (memory) +q (__wasm_call_ctors) +r (main) +s (__indirect_function_table) diff --git a/test/other/codesize/test_codesize_files_wasmfs.funcs b/test/other/codesize/test_codesize_files_wasmfs.funcs index c13be46f97079..1fec0a5640720 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.funcs +++ b/test/other/codesize/test_codesize_files_wasmfs.funcs @@ -22,8 +22,6 @@ $__cxxabiv1::__vmi_class_type_info::has_unambiguous_public_base\28__cxxabiv1::__ $__cxxabiv1::__vmi_class_type_info::search_above_dst\28__cxxabiv1::__dynamic_cast_info*\2c\20void\20const*\2c\20void\20const*\2c\20int\2c\20bool\29\20const $__cxxabiv1::__vmi_class_type_info::search_below_dst\28__cxxabiv1::__dynamic_cast_info*\2c\20void\20const*\2c\20int\2c\20bool\29\20const $__lockfile -$__memcpy -$__memset $__pthread_mutex_lock $__throw_bad_alloc_shim\28\29 $__unlockfile @@ -38,7 +36,6 @@ $fflush $is_equal\28std::type_info\20const*\2c\20std::type_info\20const*\2c\20bool\29 $main $memcmp -$memmove $operator\20delete\28void*\29 $operator\20new\28unsigned\20long\29 $pthread_mutex_init diff --git a/test/other/codesize/test_codesize_files_wasmfs.gzsize b/test/other/codesize/test_codesize_files_wasmfs.gzsize index 02089ff0b983b..ac8b4e046fa97 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.gzsize +++ b/test/other/codesize/test_codesize_files_wasmfs.gzsize @@ -1 +1 @@ -2989 +2971 diff --git a/test/other/codesize/test_codesize_files_wasmfs.jssize b/test/other/codesize/test_codesize_files_wasmfs.jssize index d928f1e433d22..dcea0b8b886f4 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.jssize +++ b/test/other/codesize/test_codesize_files_wasmfs.jssize @@ -1 +1 @@ -6327 +6294 diff --git a/test/other/codesize/test_codesize_files_wasmfs.size b/test/other/codesize/test_codesize_files_wasmfs.size index 8dbc1b508195f..a6afc98809eb8 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.size +++ b/test/other/codesize/test_codesize_files_wasmfs.size @@ -1 +1 @@ -51157 +50076 diff --git a/test/other/codesize/test_codesize_hello_O0.funcs b/test/other/codesize/test_codesize_hello_O0.funcs index 7b3556720ebea..fab2e6f63b37b 100644 --- a/test/other/codesize/test_codesize_hello_O0.funcs +++ b/test/other/codesize/test_codesize_hello_O0.funcs @@ -23,6 +23,7 @@ $__unlockfile $__vfprintf_internal $__wasi_syscall_ret $__wasm_call_ctors +$_emscripten_memcpy_bulkmem $_emscripten_stack_alloc $_emscripten_stack_restore $_emscripten_tempret_get diff --git a/test/other/codesize/test_codesize_hello_O0.gzsize b/test/other/codesize/test_codesize_hello_O0.gzsize index 21424ac54ff74..dbdbc7a6eee01 100644 --- a/test/other/codesize/test_codesize_hello_O0.gzsize +++ b/test/other/codesize/test_codesize_hello_O0.gzsize @@ -1 +1 @@ -8040 +8008 diff --git a/test/other/codesize/test_codesize_hello_O0.imports b/test/other/codesize/test_codesize_hello_O0.imports index caa640aadbb19..de07703175666 100644 --- a/test/other/codesize/test_codesize_hello_O0.imports +++ b/test/other/codesize/test_codesize_hello_O0.imports @@ -1,2 +1 @@ -env._emscripten_memcpy_js wasi_snapshot_preview1.fd_write diff --git a/test/other/codesize/test_codesize_hello_O0.jssize b/test/other/codesize/test_codesize_hello_O0.jssize index 9e6f15369d6f3..1bc0fa398e769 100644 --- a/test/other/codesize/test_codesize_hello_O0.jssize +++ b/test/other/codesize/test_codesize_hello_O0.jssize @@ -1 +1 @@ -21408 +21346 diff --git a/test/other/codesize/test_codesize_hello_O0.sent b/test/other/codesize/test_codesize_hello_O0.sent index 60fe5feb789b6..4fa386c695da8 100644 --- a/test/other/codesize/test_codesize_hello_O0.sent +++ b/test/other/codesize/test_codesize_hello_O0.sent @@ -1,2 +1 @@ -_emscripten_memcpy_js fd_write diff --git a/test/other/codesize/test_codesize_hello_O0.size b/test/other/codesize/test_codesize_hello_O0.size index b55e8eb4cd221..5d344e558030d 100644 --- a/test/other/codesize/test_codesize_hello_O0.size +++ b/test/other/codesize/test_codesize_hello_O0.size @@ -1 +1 @@ -14531 +14542 diff --git a/test/other/codesize/test_codesize_hello_O1.funcs b/test/other/codesize/test_codesize_hello_O1.funcs index f5073582b3f40..ec9609d23715c 100644 --- a/test/other/codesize/test_codesize_hello_O1.funcs +++ b/test/other/codesize/test_codesize_hello_O1.funcs @@ -11,6 +11,7 @@ $__towrite $__unlockfile $__wasi_syscall_ret $__wasm_call_ctors +$_emscripten_memcpy_bulkmem $_emscripten_stack_alloc $_emscripten_stack_restore $_emscripten_tempret_get diff --git a/test/other/codesize/test_codesize_hello_O1.gzsize b/test/other/codesize/test_codesize_hello_O1.gzsize index c1fe14e0295ce..2b4ea894fb435 100644 --- a/test/other/codesize/test_codesize_hello_O1.gzsize +++ b/test/other/codesize/test_codesize_hello_O1.gzsize @@ -1 +1 @@ -2818 +2779 diff --git a/test/other/codesize/test_codesize_hello_O1.imports b/test/other/codesize/test_codesize_hello_O1.imports index caa640aadbb19..de07703175666 100644 --- a/test/other/codesize/test_codesize_hello_O1.imports +++ b/test/other/codesize/test_codesize_hello_O1.imports @@ -1,2 +1 @@ -env._emscripten_memcpy_js wasi_snapshot_preview1.fd_write diff --git a/test/other/codesize/test_codesize_hello_O1.jssize b/test/other/codesize/test_codesize_hello_O1.jssize index 331d936bc2012..db08354ed589a 100644 --- a/test/other/codesize/test_codesize_hello_O1.jssize +++ b/test/other/codesize/test_codesize_hello_O1.jssize @@ -1 +1 @@ -7025 +6963 diff --git a/test/other/codesize/test_codesize_hello_O1.sent b/test/other/codesize/test_codesize_hello_O1.sent index 60fe5feb789b6..4fa386c695da8 100644 --- a/test/other/codesize/test_codesize_hello_O1.sent +++ b/test/other/codesize/test_codesize_hello_O1.sent @@ -1,2 +1 @@ -_emscripten_memcpy_js fd_write diff --git a/test/other/codesize/test_codesize_hello_O1.size b/test/other/codesize/test_codesize_hello_O1.size index 48c6e93066ff9..6a5bdca5ee17a 100644 --- a/test/other/codesize/test_codesize_hello_O1.size +++ b/test/other/codesize/test_codesize_hello_O1.size @@ -1 +1 @@ -2535 +2536 diff --git a/test/other/codesize/test_codesize_hello_O2.gzsize b/test/other/codesize/test_codesize_hello_O2.gzsize index ff7f50a6d7109..cc8eed3452190 100644 --- a/test/other/codesize/test_codesize_hello_O2.gzsize +++ b/test/other/codesize/test_codesize_hello_O2.gzsize @@ -1 +1 @@ -2498 +2465 diff --git a/test/other/codesize/test_codesize_hello_O2.imports b/test/other/codesize/test_codesize_hello_O2.imports index caa640aadbb19..de07703175666 100644 --- a/test/other/codesize/test_codesize_hello_O2.imports +++ b/test/other/codesize/test_codesize_hello_O2.imports @@ -1,2 +1 @@ -env._emscripten_memcpy_js wasi_snapshot_preview1.fd_write diff --git a/test/other/codesize/test_codesize_hello_O2.jssize b/test/other/codesize/test_codesize_hello_O2.jssize index f61405c38790b..2de675059f8a4 100644 --- a/test/other/codesize/test_codesize_hello_O2.jssize +++ b/test/other/codesize/test_codesize_hello_O2.jssize @@ -1 +1 @@ -5036 +4983 diff --git a/test/other/codesize/test_codesize_hello_O2.sent b/test/other/codesize/test_codesize_hello_O2.sent index 60fe5feb789b6..4fa386c695da8 100644 --- a/test/other/codesize/test_codesize_hello_O2.sent +++ b/test/other/codesize/test_codesize_hello_O2.sent @@ -1,2 +1 @@ -_emscripten_memcpy_js fd_write diff --git a/test/other/codesize/test_codesize_hello_O2.size b/test/other/codesize/test_codesize_hello_O2.size index b6ac305674cf9..78bed88929ed3 100644 --- a/test/other/codesize/test_codesize_hello_O2.size +++ b/test/other/codesize/test_codesize_hello_O2.size @@ -1 +1 @@ -2047 +2023 diff --git a/test/other/codesize/test_codesize_hello_O3.exports b/test/other/codesize/test_codesize_hello_O3.exports index 99502013435fa..a88ed67232916 100644 --- a/test/other/codesize/test_codesize_hello_O3.exports +++ b/test/other/codesize/test_codesize_hello_O3.exports @@ -1,4 +1,4 @@ -c (memory) -d (__wasm_call_ctors) -e (main) -f (__indirect_function_table) +b (memory) +c (__wasm_call_ctors) +d (main) +e (__indirect_function_table) diff --git a/test/other/codesize/test_codesize_hello_O3.gzsize b/test/other/codesize/test_codesize_hello_O3.gzsize index 94c0c0eb6b8d3..2f097f031198d 100644 --- a/test/other/codesize/test_codesize_hello_O3.gzsize +++ b/test/other/codesize/test_codesize_hello_O3.gzsize @@ -1 +1 @@ -2418 +2397 diff --git a/test/other/codesize/test_codesize_hello_O3.imports b/test/other/codesize/test_codesize_hello_O3.imports index 747be6c703000..6da83238cc224 100644 --- a/test/other/codesize/test_codesize_hello_O3.imports +++ b/test/other/codesize/test_codesize_hello_O3.imports @@ -1,2 +1 @@ a (fd_write) -b (_emscripten_memcpy_js) diff --git a/test/other/codesize/test_codesize_hello_O3.jssize b/test/other/codesize/test_codesize_hello_O3.jssize index 2fe2a2bc84df4..c8db55238c8e5 100644 --- a/test/other/codesize/test_codesize_hello_O3.jssize +++ b/test/other/codesize/test_codesize_hello_O3.jssize @@ -1 +1 @@ -4882 +4849 diff --git a/test/other/codesize/test_codesize_hello_O3.sent b/test/other/codesize/test_codesize_hello_O3.sent index 747be6c703000..6da83238cc224 100644 --- a/test/other/codesize/test_codesize_hello_O3.sent +++ b/test/other/codesize/test_codesize_hello_O3.sent @@ -1,2 +1 @@ a (fd_write) -b (_emscripten_memcpy_js) diff --git a/test/other/codesize/test_codesize_hello_O3.size b/test/other/codesize/test_codesize_hello_O3.size index 173a6680f8970..b0539e90d9ac1 100644 --- a/test/other/codesize/test_codesize_hello_O3.size +++ b/test/other/codesize/test_codesize_hello_O3.size @@ -1 +1 @@ -1737 +1735 diff --git a/test/other/codesize/test_codesize_hello_Os.exports b/test/other/codesize/test_codesize_hello_Os.exports index 99502013435fa..a88ed67232916 100644 --- a/test/other/codesize/test_codesize_hello_Os.exports +++ b/test/other/codesize/test_codesize_hello_Os.exports @@ -1,4 +1,4 @@ -c (memory) -d (__wasm_call_ctors) -e (main) -f (__indirect_function_table) +b (memory) +c (__wasm_call_ctors) +d (main) +e (__indirect_function_table) diff --git a/test/other/codesize/test_codesize_hello_Os.gzsize b/test/other/codesize/test_codesize_hello_Os.gzsize index 94c0c0eb6b8d3..2f097f031198d 100644 --- a/test/other/codesize/test_codesize_hello_Os.gzsize +++ b/test/other/codesize/test_codesize_hello_Os.gzsize @@ -1 +1 @@ -2418 +2397 diff --git a/test/other/codesize/test_codesize_hello_Os.imports b/test/other/codesize/test_codesize_hello_Os.imports index 747be6c703000..6da83238cc224 100644 --- a/test/other/codesize/test_codesize_hello_Os.imports +++ b/test/other/codesize/test_codesize_hello_Os.imports @@ -1,2 +1 @@ a (fd_write) -b (_emscripten_memcpy_js) diff --git a/test/other/codesize/test_codesize_hello_Os.jssize b/test/other/codesize/test_codesize_hello_Os.jssize index 2fe2a2bc84df4..c8db55238c8e5 100644 --- a/test/other/codesize/test_codesize_hello_Os.jssize +++ b/test/other/codesize/test_codesize_hello_Os.jssize @@ -1 +1 @@ -4882 +4849 diff --git a/test/other/codesize/test_codesize_hello_Os.sent b/test/other/codesize/test_codesize_hello_Os.sent index 747be6c703000..6da83238cc224 100644 --- a/test/other/codesize/test_codesize_hello_Os.sent +++ b/test/other/codesize/test_codesize_hello_Os.sent @@ -1,2 +1 @@ a (fd_write) -b (_emscripten_memcpy_js) diff --git a/test/other/codesize/test_codesize_hello_Os.size b/test/other/codesize/test_codesize_hello_Os.size index 54c9fc81b32d0..921f45ad4bffa 100644 --- a/test/other/codesize/test_codesize_hello_Os.size +++ b/test/other/codesize/test_codesize_hello_Os.size @@ -1 +1 @@ -1728 +1726 diff --git a/test/other/codesize/test_codesize_hello_Oz.size b/test/other/codesize/test_codesize_hello_Oz.size index b151ec96e078d..39eb8283b0002 100644 --- a/test/other/codesize/test_codesize_hello_Oz.size +++ b/test/other/codesize/test_codesize_hello_Oz.size @@ -1 +1 @@ -1286 +1261 diff --git a/test/other/codesize/test_codesize_hello_dylink.gzsize b/test/other/codesize/test_codesize_hello_dylink.gzsize index 97efd5dbc5030..df9f25e4e287b 100644 --- a/test/other/codesize/test_codesize_hello_dylink.gzsize +++ b/test/other/codesize/test_codesize_hello_dylink.gzsize @@ -1 +1 @@ -6339 +6301 diff --git a/test/other/codesize/test_codesize_hello_dylink.imports b/test/other/codesize/test_codesize_hello_dylink.imports index c986c46c080b2..ed7c6d9be94fb 100644 --- a/test/other/codesize/test_codesize_hello_dylink.imports +++ b/test/other/codesize/test_codesize_hello_dylink.imports @@ -3,7 +3,6 @@ env.__indirect_function_table env.__memory_base env.__stack_pointer env.__table_base -env._emscripten_memcpy_js env.emscripten_resize_heap env.memory wasi_snapshot_preview1.fd_write diff --git a/test/other/codesize/test_codesize_hello_dylink.jssize b/test/other/codesize/test_codesize_hello_dylink.jssize index 9195b2fc9c83d..e4777a52bd127 100644 --- a/test/other/codesize/test_codesize_hello_dylink.jssize +++ b/test/other/codesize/test_codesize_hello_dylink.jssize @@ -1 +1 @@ -13936 +13860 diff --git a/test/other/codesize/test_codesize_hello_dylink.sent b/test/other/codesize/test_codesize_hello_dylink.sent index 01672c0ec979f..1ca2e37d90365 100644 --- a/test/other/codesize/test_codesize_hello_dylink.sent +++ b/test/other/codesize/test_codesize_hello_dylink.sent @@ -3,7 +3,6 @@ __indirect_function_table __memory_base __stack_pointer __table_base -_emscripten_memcpy_js emscripten_resize_heap fd_write memory diff --git a/test/other/codesize/test_codesize_hello_dylink.size b/test/other/codesize/test_codesize_hello_dylink.size index a30e08ecfada3..1181db50bb598 100644 --- a/test/other/codesize/test_codesize_hello_dylink.size +++ b/test/other/codesize/test_codesize_hello_dylink.size @@ -1 +1 @@ -9784 +9760 diff --git a/test/other/codesize/test_codesize_hello_wasmfs.exports b/test/other/codesize/test_codesize_hello_wasmfs.exports index 99502013435fa..a88ed67232916 100644 --- a/test/other/codesize/test_codesize_hello_wasmfs.exports +++ b/test/other/codesize/test_codesize_hello_wasmfs.exports @@ -1,4 +1,4 @@ -c (memory) -d (__wasm_call_ctors) -e (main) -f (__indirect_function_table) +b (memory) +c (__wasm_call_ctors) +d (main) +e (__indirect_function_table) diff --git a/test/other/codesize/test_codesize_hello_wasmfs.gzsize b/test/other/codesize/test_codesize_hello_wasmfs.gzsize index 94c0c0eb6b8d3..2f097f031198d 100644 --- a/test/other/codesize/test_codesize_hello_wasmfs.gzsize +++ b/test/other/codesize/test_codesize_hello_wasmfs.gzsize @@ -1 +1 @@ -2418 +2397 diff --git a/test/other/codesize/test_codesize_hello_wasmfs.imports b/test/other/codesize/test_codesize_hello_wasmfs.imports index 747be6c703000..6da83238cc224 100644 --- a/test/other/codesize/test_codesize_hello_wasmfs.imports +++ b/test/other/codesize/test_codesize_hello_wasmfs.imports @@ -1,2 +1 @@ a (fd_write) -b (_emscripten_memcpy_js) diff --git a/test/other/codesize/test_codesize_hello_wasmfs.jssize b/test/other/codesize/test_codesize_hello_wasmfs.jssize index 2fe2a2bc84df4..c8db55238c8e5 100644 --- a/test/other/codesize/test_codesize_hello_wasmfs.jssize +++ b/test/other/codesize/test_codesize_hello_wasmfs.jssize @@ -1 +1 @@ -4882 +4849 diff --git a/test/other/codesize/test_codesize_hello_wasmfs.sent b/test/other/codesize/test_codesize_hello_wasmfs.sent index 747be6c703000..6da83238cc224 100644 --- a/test/other/codesize/test_codesize_hello_wasmfs.sent +++ b/test/other/codesize/test_codesize_hello_wasmfs.sent @@ -1,2 +1 @@ a (fd_write) -b (_emscripten_memcpy_js) diff --git a/test/other/codesize/test_codesize_hello_wasmfs.size b/test/other/codesize/test_codesize_hello_wasmfs.size index 173a6680f8970..b0539e90d9ac1 100644 --- a/test/other/codesize/test_codesize_hello_wasmfs.size +++ b/test/other/codesize/test_codesize_hello_wasmfs.size @@ -1 +1 @@ -1737 +1735 diff --git a/test/other/codesize/test_codesize_libcxxabi_message_O3.size b/test/other/codesize/test_codesize_libcxxabi_message_O3.size index c17e934b51c1f..29d6383b52c13 100644 --- a/test/other/codesize/test_codesize_libcxxabi_message_O3.size +++ b/test/other/codesize/test_codesize_libcxxabi_message_O3.size @@ -1 +1 @@ -97 +100 diff --git a/test/other/codesize/test_codesize_libcxxabi_message_O3_standalone.size b/test/other/codesize/test_codesize_libcxxabi_message_O3_standalone.size index eec49411b8413..3af99eeec11bb 100644 --- a/test/other/codesize/test_codesize_libcxxabi_message_O3_standalone.size +++ b/test/other/codesize/test_codesize_libcxxabi_message_O3_standalone.size @@ -1 +1 @@ -177 +180 diff --git a/test/other/codesize/test_codesize_mem_O3.size b/test/other/codesize/test_codesize_mem_O3.size index 2c9122f5b758b..ce94be3b6ea28 100644 --- a/test/other/codesize/test_codesize_mem_O3.size +++ b/test/other/codesize/test_codesize_mem_O3.size @@ -1 +1 @@ -5288 +5291 diff --git a/test/other/codesize/test_codesize_mem_O3_grow.size b/test/other/codesize/test_codesize_mem_O3_grow.size index 82758ce061e87..3ae79a93ab2b2 100644 --- a/test/other/codesize/test_codesize_mem_O3_grow.size +++ b/test/other/codesize/test_codesize_mem_O3_grow.size @@ -1 +1 @@ -5289 +5292 diff --git a/test/other/codesize/test_codesize_mem_O3_grow_standalone.size b/test/other/codesize/test_codesize_mem_O3_grow_standalone.size index a0096d7853f16..d9ab575e0e703 100644 --- a/test/other/codesize/test_codesize_mem_O3_grow_standalone.size +++ b/test/other/codesize/test_codesize_mem_O3_grow_standalone.size @@ -1 +1 @@ -5612 +5615 diff --git a/test/other/codesize/test_codesize_mem_O3_standalone.size b/test/other/codesize/test_codesize_mem_O3_standalone.size index b7b57d282909f..b1fe233b1092f 100644 --- a/test/other/codesize/test_codesize_mem_O3_standalone.size +++ b/test/other/codesize/test_codesize_mem_O3_standalone.size @@ -1 +1 @@ -5537 +5540 diff --git a/test/other/codesize/test_codesize_mem_O3_standalone_lib.size b/test/other/codesize/test_codesize_mem_O3_standalone_lib.size index 25db995aa2569..554553b353b9b 100644 --- a/test/other/codesize/test_codesize_mem_O3_standalone_lib.size +++ b/test/other/codesize/test_codesize_mem_O3_standalone_lib.size @@ -1 +1 @@ -5300 +5303 diff --git a/test/other/codesize/test_codesize_mem_O3_standalone_narg.size b/test/other/codesize/test_codesize_mem_O3_standalone_narg.size index e650e5aa24adc..66ff790e932f6 100644 --- a/test/other/codesize/test_codesize_mem_O3_standalone_narg.size +++ b/test/other/codesize/test_codesize_mem_O3_standalone_narg.size @@ -1 +1 @@ -5330 +5333 diff --git a/test/other/codesize/test_codesize_mem_O3_standalone_narg_flto.size b/test/other/codesize/test_codesize_mem_O3_standalone_narg_flto.size index bcfe4e9786b14..d5cf5c28b6a26 100644 --- a/test/other/codesize/test_codesize_mem_O3_standalone_narg_flto.size +++ b/test/other/codesize/test_codesize_mem_O3_standalone_narg_flto.size @@ -1 +1 @@ -4138 +4141 diff --git a/test/other/codesize/test_codesize_minimal_O0.size b/test/other/codesize/test_codesize_minimal_O0.size index 37cdd416f157a..60d44837bc39b 100644 --- a/test/other/codesize/test_codesize_minimal_O0.size +++ b/test/other/codesize/test_codesize_minimal_O0.size @@ -1 +1 @@ -975 +988 diff --git a/test/other/codesize/test_codesize_minimal_O1.size b/test/other/codesize/test_codesize_minimal_O1.size index 100000a67875f..6bb2f4ee89f3f 100644 --- a/test/other/codesize/test_codesize_minimal_O1.size +++ b/test/other/codesize/test_codesize_minimal_O1.size @@ -1 +1 @@ -376 +389 diff --git a/test/other/codesize/test_codesize_minimal_pthreads.size b/test/other/codesize/test_codesize_minimal_pthreads.size index 10b2d7f643c17..f4c623fbbe87f 100644 --- a/test/other/codesize/test_codesize_minimal_pthreads.size +++ b/test/other/codesize/test_codesize_minimal_pthreads.size @@ -1 +1 @@ -19501 +19458 diff --git a/test/other/test_unoptimized_code_size.js.size b/test/other/test_unoptimized_code_size.js.size index a9702b35fe87e..420620d93c769 100644 --- a/test/other/test_unoptimized_code_size.js.size +++ b/test/other/test_unoptimized_code_size.js.size @@ -1 +1 @@ -54957 +54798 diff --git a/test/other/test_unoptimized_code_size.wasm.size b/test/other/test_unoptimized_code_size.wasm.size index b55e8eb4cd221..5d344e558030d 100644 --- a/test/other/test_unoptimized_code_size.wasm.size +++ b/test/other/test_unoptimized_code_size.wasm.size @@ -1 +1 @@ -14531 +14542 diff --git a/test/other/test_unoptimized_code_size_no_asserts.js.size b/test/other/test_unoptimized_code_size_no_asserts.js.size index 478cd0ea98e0c..72ba6eed23a59 100644 --- a/test/other/test_unoptimized_code_size_no_asserts.js.size +++ b/test/other/test_unoptimized_code_size_no_asserts.js.size @@ -1 +1 @@ -30611 +30452 diff --git a/test/other/test_unoptimized_code_size_no_asserts.wasm.size b/test/other/test_unoptimized_code_size_no_asserts.wasm.size index a65dc9b14619a..a5755921eac44 100644 --- a/test/other/test_unoptimized_code_size_no_asserts.wasm.size +++ b/test/other/test_unoptimized_code_size_no_asserts.wasm.size @@ -1 +1 @@ -11724 +11735 diff --git a/test/other/test_unoptimized_code_size_strict.js.size b/test/other/test_unoptimized_code_size_strict.js.size index 93cc7231065b7..61b318ed70a45 100644 --- a/test/other/test_unoptimized_code_size_strict.js.size +++ b/test/other/test_unoptimized_code_size_strict.js.size @@ -1 +1 @@ -53753 +53594 diff --git a/test/other/test_unoptimized_code_size_strict.wasm.size b/test/other/test_unoptimized_code_size_strict.wasm.size index b55e8eb4cd221..5d344e558030d 100644 --- a/test/other/test_unoptimized_code_size_strict.wasm.size +++ b/test/other/test_unoptimized_code_size_strict.wasm.size @@ -1 +1 @@ -14531 +14542 From 747201c558aa7a4b40fa8c07a714dc9bb8558259 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 26 Nov 2024 14:26:01 -0800 Subject: [PATCH 11/25] review suggestions --- embuilder.py | 1 - tools/feature_matrix.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/embuilder.py b/embuilder.py index 4b706c1d6df76..6b7d19330bb30 100755 --- a/embuilder.py +++ b/embuilder.py @@ -30,7 +30,6 @@ # Minimal subset of targets used by CI systems to build enough to be useful MINIMAL_TASKS = [ - 'libbulkmemory', 'libcompiler_rt', 'libcompiler_rt-wasm-sjlj', 'libcompiler_rt-ww', diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index f690d3fab16b8..c8ff690366813 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -167,7 +167,7 @@ def apply_min_browser_versions(): if settings.PTHREADS: enable_feature(Feature.THREADS, 'pthreads') enable_feature(Feature.BULK_MEMORY, 'pthreads') - if settings.WASM_WORKERS or settings.SHARED_MEMORY: + elif settings.WASM_WORKERS or settings.SHARED_MEMORY: enable_feature(Feature.BULK_MEMORY, 'wasm-workers') if settings.AUDIO_WORKLET: enable_feature(Feature.GLOBALTHIS, 'AUDIO_WORKLET') From 4714852e51e9fa6734c92a03b6c8335dc45b0d05 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 26 Nov 2024 15:45:57 -0800 Subject: [PATCH 12/25] rebaseline code size --- test/code_size/embind_val_wasm.json | 8 ++++---- test/code_size/random_printf_wasm.json | 8 ++++---- test/code_size/random_printf_wasm2js.json | 8 ++++---- test/other/codesize/test_codesize_cxx_ctors1.size | 2 +- test/other/codesize/test_codesize_cxx_ctors2.size | 2 +- test/other/codesize/test_codesize_cxx_except.size | 2 +- test/other/codesize/test_codesize_cxx_except_wasm.size | 2 +- .../codesize/test_codesize_cxx_except_wasm_exnref.size | 2 +- test/other/codesize/test_codesize_cxx_lto.size | 2 +- test/other/codesize/test_codesize_cxx_mangle.size | 2 +- test/other/codesize/test_codesize_cxx_noexcept.size | 2 +- test/other/codesize/test_codesize_cxx_wasmfs.size | 2 +- test/other/codesize/test_codesize_hello_O0.size | 2 +- test/other/test_unoptimized_code_size.wasm.size | 2 +- .../other/test_unoptimized_code_size_no_asserts.wasm.size | 2 +- test/other/test_unoptimized_code_size_strict.wasm.size | 2 +- 16 files changed, 25 insertions(+), 25 deletions(-) diff --git a/test/code_size/embind_val_wasm.json b/test/code_size/embind_val_wasm.json index 33d4146fd3de3..3c6708cfc2f7a 100644 --- a/test/code_size/embind_val_wasm.json +++ b/test/code_size/embind_val_wasm.json @@ -3,8 +3,8 @@ "a.html.gz": 380, "a.js": 6849, "a.js.gz": 2947, - "a.wasm": 9452, - "a.wasm.gz": 4855, - "total": 16853, - "total_gz": 8182 + "a.wasm": 9456, + "a.wasm.gz": 4858, + "total": 16857, + "total_gz": 8185 } diff --git a/test/code_size/random_printf_wasm.json b/test/code_size/random_printf_wasm.json index c675ac92074f0..8cd67b52466d7 100644 --- a/test/code_size/random_printf_wasm.json +++ b/test/code_size/random_printf_wasm.json @@ -1,6 +1,6 @@ { - "a.html": 12626, - "a.html.gz": 6877, - "total": 12626, - "total_gz": 6877 + "a.html": 12630, + "a.html.gz": 6890, + "total": 12630, + "total_gz": 6890 } diff --git a/test/code_size/random_printf_wasm2js.json b/test/code_size/random_printf_wasm2js.json index 51677c84146a7..12f3040d0a82d 100644 --- a/test/code_size/random_printf_wasm2js.json +++ b/test/code_size/random_printf_wasm2js.json @@ -1,6 +1,6 @@ { - "a.html": 17308, - "a.html.gz": 7560, - "total": 17308, - "total_gz": 7560 + "a.html": 17314, + "a.html.gz": 7565, + "total": 17314, + "total_gz": 7565 } diff --git a/test/other/codesize/test_codesize_cxx_ctors1.size b/test/other/codesize/test_codesize_cxx_ctors1.size index 892c2092d40ca..0b39a0f4c9f14 100644 --- a/test/other/codesize/test_codesize_cxx_ctors1.size +++ b/test/other/codesize/test_codesize_cxx_ctors1.size @@ -1 +1 @@ -128919 +128918 diff --git a/test/other/codesize/test_codesize_cxx_ctors2.size b/test/other/codesize/test_codesize_cxx_ctors2.size index 70b64e69ddc41..a34569db4e55e 100644 --- a/test/other/codesize/test_codesize_cxx_ctors2.size +++ b/test/other/codesize/test_codesize_cxx_ctors2.size @@ -1 +1 @@ -128320 +128319 diff --git a/test/other/codesize/test_codesize_cxx_except.size b/test/other/codesize/test_codesize_cxx_except.size index 92c39794e55ca..5ad9027676aa8 100644 --- a/test/other/codesize/test_codesize_cxx_except.size +++ b/test/other/codesize/test_codesize_cxx_except.size @@ -1 +1 @@ -171108 +171107 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm.size b/test/other/codesize/test_codesize_cxx_except_wasm.size index ba01d3fe8c28d..080b84612b71f 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm.size +++ b/test/other/codesize/test_codesize_cxx_except_wasm.size @@ -1 +1 @@ -142225 +142224 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.size b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.size index 02ccf113d8e16..78bcec982cede 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.size +++ b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.size @@ -1 +1 @@ -144862 +144861 diff --git a/test/other/codesize/test_codesize_cxx_lto.size b/test/other/codesize/test_codesize_cxx_lto.size index 1f35140c9cffe..68d244fee22e5 100644 --- a/test/other/codesize/test_codesize_cxx_lto.size +++ b/test/other/codesize/test_codesize_cxx_lto.size @@ -1 +1 @@ -122347 +122344 diff --git a/test/other/codesize/test_codesize_cxx_mangle.size b/test/other/codesize/test_codesize_cxx_mangle.size index cfe90b8d77a10..572f17912dfc4 100644 --- a/test/other/codesize/test_codesize_cxx_mangle.size +++ b/test/other/codesize/test_codesize_cxx_mangle.size @@ -1 +1 @@ -232790 +232789 diff --git a/test/other/codesize/test_codesize_cxx_noexcept.size b/test/other/codesize/test_codesize_cxx_noexcept.size index c82d5e805905c..ce2c63b9dcf18 100644 --- a/test/other/codesize/test_codesize_cxx_noexcept.size +++ b/test/other/codesize/test_codesize_cxx_noexcept.size @@ -1 +1 @@ -131731 +131730 diff --git a/test/other/codesize/test_codesize_cxx_wasmfs.size b/test/other/codesize/test_codesize_cxx_wasmfs.size index 3f188d53f524b..640e5ced8600c 100644 --- a/test/other/codesize/test_codesize_cxx_wasmfs.size +++ b/test/other/codesize/test_codesize_cxx_wasmfs.size @@ -1 +1 @@ -169237 +169236 diff --git a/test/other/codesize/test_codesize_hello_O0.size b/test/other/codesize/test_codesize_hello_O0.size index 5d344e558030d..5d384185c08b0 100644 --- a/test/other/codesize/test_codesize_hello_O0.size +++ b/test/other/codesize/test_codesize_hello_O0.size @@ -1 +1 @@ -14542 +14546 diff --git a/test/other/test_unoptimized_code_size.wasm.size b/test/other/test_unoptimized_code_size.wasm.size index 5d344e558030d..5d384185c08b0 100644 --- a/test/other/test_unoptimized_code_size.wasm.size +++ b/test/other/test_unoptimized_code_size.wasm.size @@ -1 +1 @@ -14542 +14546 diff --git a/test/other/test_unoptimized_code_size_no_asserts.wasm.size b/test/other/test_unoptimized_code_size_no_asserts.wasm.size index a5755921eac44..0d826cc46a028 100644 --- a/test/other/test_unoptimized_code_size_no_asserts.wasm.size +++ b/test/other/test_unoptimized_code_size_no_asserts.wasm.size @@ -1 +1 @@ -11735 +11739 diff --git a/test/other/test_unoptimized_code_size_strict.wasm.size b/test/other/test_unoptimized_code_size_strict.wasm.size index 5d344e558030d..5d384185c08b0 100644 --- a/test/other/test_unoptimized_code_size_strict.wasm.size +++ b/test/other/test_unoptimized_code_size_strict.wasm.size @@ -1 +1 @@ -14542 +14546 From 9da8ecce4c57f4724537b1d09b6bd32c30800386 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 26 Nov 2024 16:03:48 -0800 Subject: [PATCH 13/25] add suggested comment --- system/lib/libc/emscripten_memcpy_bulkmem.S | 1 + system/lib/libc/emscripten_memset_bulkmem.S | 1 + 2 files changed, 2 insertions(+) diff --git a/system/lib/libc/emscripten_memcpy_bulkmem.S b/system/lib/libc/emscripten_memcpy_bulkmem.S index 5ff3a2777253c..876b997944893 100644 --- a/system/lib/libc/emscripten_memcpy_bulkmem.S +++ b/system/lib/libc/emscripten_memcpy_bulkmem.S @@ -11,6 +11,7 @@ _emscripten_memcpy_bulkmem: #ifdef __wasm64__ i32.wrap_i64 #endif + // memory.copy traps on OOB zero-length copies, but memcpy must not. if local.get 0 local.get 1 diff --git a/system/lib/libc/emscripten_memset_bulkmem.S b/system/lib/libc/emscripten_memset_bulkmem.S index 658f9937b4b8f..ba8d91bb0ae8f 100644 --- a/system/lib/libc/emscripten_memset_bulkmem.S +++ b/system/lib/libc/emscripten_memset_bulkmem.S @@ -11,6 +11,7 @@ _emscripten_memset_bulkmem: #ifdef __wasm64__ i32.wrap_i64 #endif + // memory.fill traps on OOB zero-length sets, but memset must not. if local.get 0 local.get 1 From b0e13cabf807844961652e0c8a2a8002b7cdf9f5 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 27 Nov 2024 11:39:52 -0800 Subject: [PATCH 14/25] remove accidental commit --- test/other/codesize/test_codesize_cxx_except_wasm_exnref. | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test/other/codesize/test_codesize_cxx_except_wasm_exnref. diff --git a/test/other/codesize/test_codesize_cxx_except_wasm_exnref. b/test/other/codesize/test_codesize_cxx_except_wasm_exnref. deleted file mode 100644 index e69de29bb2d1d..0000000000000 From e4d0e828bcf10d372a9017760d875a9cc8ac1297 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 27 Nov 2024 12:10:05 -0800 Subject: [PATCH 15/25] rebaseline --- test/code_size/random_printf_wasm.json | 8 ++++---- test/code_size/random_printf_wasm2js.json | 8 ++++---- test/other/codesize/test_codesize_cxx_ctors1.size | 2 +- test/other/codesize/test_codesize_cxx_ctors2.size | 2 +- test/other/codesize/test_codesize_cxx_except_wasm.size | 2 +- .../codesize/test_codesize_cxx_except_wasm_exnref.size | 2 +- test/other/codesize/test_codesize_cxx_lto.size | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/test/code_size/random_printf_wasm.json b/test/code_size/random_printf_wasm.json index 8cd67b52466d7..962c99e938f61 100644 --- a/test/code_size/random_printf_wasm.json +++ b/test/code_size/random_printf_wasm.json @@ -1,6 +1,6 @@ { - "a.html": 12630, - "a.html.gz": 6890, - "total": 12630, - "total_gz": 6890 + "a.html": 12618, + "a.html.gz": 6883, + "total": 12618, + "total_gz": 6883 } diff --git a/test/code_size/random_printf_wasm2js.json b/test/code_size/random_printf_wasm2js.json index 12f3040d0a82d..705648a731a7d 100644 --- a/test/code_size/random_printf_wasm2js.json +++ b/test/code_size/random_printf_wasm2js.json @@ -1,6 +1,6 @@ { - "a.html": 17314, - "a.html.gz": 7565, - "total": 17314, - "total_gz": 7565 + "a.html": 17304, + "a.html.gz": 7569, + "total": 17304, + "total_gz": 7569 } diff --git a/test/other/codesize/test_codesize_cxx_ctors1.size b/test/other/codesize/test_codesize_cxx_ctors1.size index 0b39a0f4c9f14..23a27d4558f0f 100644 --- a/test/other/codesize/test_codesize_cxx_ctors1.size +++ b/test/other/codesize/test_codesize_cxx_ctors1.size @@ -1 +1 @@ -128918 +128915 diff --git a/test/other/codesize/test_codesize_cxx_ctors2.size b/test/other/codesize/test_codesize_cxx_ctors2.size index a34569db4e55e..b8e1ef9efdd88 100644 --- a/test/other/codesize/test_codesize_cxx_ctors2.size +++ b/test/other/codesize/test_codesize_cxx_ctors2.size @@ -1 +1 @@ -128319 +128316 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm.size b/test/other/codesize/test_codesize_cxx_except_wasm.size index 080b84612b71f..baa3d5f60c8aa 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm.size +++ b/test/other/codesize/test_codesize_cxx_except_wasm.size @@ -1 +1 @@ -142224 +142244 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.size b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.size index 78bcec982cede..d21237bb16134 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.size +++ b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.size @@ -1 +1 @@ -144861 +144831 diff --git a/test/other/codesize/test_codesize_cxx_lto.size b/test/other/codesize/test_codesize_cxx_lto.size index 68d244fee22e5..45397d003b1bc 100644 --- a/test/other/codesize/test_codesize_cxx_lto.size +++ b/test/other/codesize/test_codesize_cxx_lto.size @@ -1 +1 @@ -122344 +121855 From c668e908a59b9f1d609ae847b9136f1e80374275 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 19 Dec 2024 13:14:12 -0800 Subject: [PATCH 16/25] review comments --- system/lib/libc/emscripten_memcpy.c | 4 ---- system/lib/libc/emscripten_memset.c | 4 ---- test/test_other.py | 7 ++++--- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/system/lib/libc/emscripten_memcpy.c b/system/lib/libc/emscripten_memcpy.c index 54ef045b8a89a..7e30f567463c2 100644 --- a/system/lib/libc/emscripten_memcpy.c +++ b/system/lib/libc/emscripten_memcpy.c @@ -8,10 +8,6 @@ #include "libc.h" #include "emscripten_internal.h" -#if !defined(__wasm_bulk_memory__) -#error "This file must be compile with bulk memory enabled" -#endif - // Use the simple/naive version of memcpy when building with asan #if __has_feature(address_sanitizer) diff --git a/system/lib/libc/emscripten_memset.c b/system/lib/libc/emscripten_memset.c index 3fc0f58061975..111a99f495e62 100644 --- a/system/lib/libc/emscripten_memset.c +++ b/system/lib/libc/emscripten_memset.c @@ -9,10 +9,6 @@ __attribute__((no_sanitize("address"))) void *__memset(void *str, int c, size_t __attribute__((__weak__)) void *__musl_memset(void *str, int c, size_t n); __attribute__((__weak__)) void *__memset(void *str, int c, size_t n); -#if !defined(__wasm_bulk_memory__) -#error "This file must be compiled with bulk memory enabled" -#endif - #if defined(EMSCRIPTEN_OPTIMIZE_FOR_OZ) void *__memset(void *str, int c, size_t n) { diff --git a/test/test_other.py b/test/test_other.py index fb2c3b8ad3626..008cf9c9f837f 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -10441,9 +10441,10 @@ def test_wasm_features_section(self, args): self.verify_custom_sec_existence('a.out.wasm', 'target_features', False) def test_wasm_features(self): - # Test that wasm features are explicitly enabled or disabled based on target engine version - # Here we are reading the features section and trusting that LLVM and/or Binaryen faithfully - # represent what features are used + # Test that wasm features are explicitly enabled or disabled based on + # target engine version. Here we are reading the features section and + # trusting that LLVM and/or Binaryen faithfully represent what features + # are used def verify_features_sec(feature, expect_in, linked=False): with webassembly.Module('a.out.wasm' if linked else 'hello_world.o') as module: features = module.get_target_features() From 7fc041bfc116d28bebc23d4f26b97529d661fc0b Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 19 Dec 2024 14:41:00 -0800 Subject: [PATCH 17/25] tweak test_wasm_features --- test/test_other.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/test/test_other.py b/test/test_other.py index 008cf9c9f837f..fffc9489e7157 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -10473,36 +10473,36 @@ def compile(flags): # Disable a feature compile(['-mno-sign-ext', '-c']) verify_features_sec('sign-ext', False) - # Disabling overrides default browser versions + # Disable via browser selection + compile(['-sMIN_FIREFOX_VERSION=61']) + verify_features_sec_linked('sign-ext', False) + # Flag disabling overrides default browser versions compile(['-mno-sign-ext']) verify_features_sec_linked('sign-ext', False) - # Disabling overrides manual browser versions + # Flag disabling overrides explicit browser version compile(['-sMIN_SAFARI_VERSION=150000', '-mno-sign-ext']) - # Disable via browser selection - compile(['-sMIN_FIREFOX_VERSION=61']) verify_features_sec_linked('sign-ext', False) - # Manual enable overrides browser version + # Flag enabling overrides explicit browser version compile(['-sMIN_FIREFOX_VERSION=61', '-msign-ext']) verify_features_sec_linked('sign-ext', True) + # Flag disabling overrides explicit version for bulk memory + compile(['-sMIN_SAFARI_VERSION=150000', '-mno-bulk-memory']) + verify_features_sec_linked('bulk-memory-opt', False) - compile(['-mnontrapping-fptoint', '-c']) - verify_features_sec('nontrapping-fptoint', True) - + # TODO(https://github.com/emscripten-core/emscripten/issues/23184) set this back to 14.1 + # Also the section below can be deleted/updated once the default is 15.1 compile(['-sMIN_SAFARI_VERSION=140000']) - verify_features_sec_linked('bulk-memory', False) + verify_features_sec_linked('bulk-memory-opt', False) verify_features_sec_linked('nontrapping-fptoint', False) - # Setting this SAFARI_VERSION should enable bulk memory because it links in emscripten_memcpy_bulkmem compile(['-sMIN_SAFARI_VERSION=150000']) verify_features_sec_linked('sign-ext', True) verify_features_sec_linked('mutable-globals', True) verify_features_sec_linked('multivalue', True) - verify_features_sec_linked('bulk-memory', True) + verify_features_sec_linked('bulk-memory-opt', True) verify_features_sec_linked('nontrapping-fptoint', True) - compile(['-sMIN_SAFARI_VERSION=150000', '-mno-bulk-memory']) - # -mno-bulk-memory at link time overrides MIN_SAFARI_VERSION - verify_features_sec_linked('bulk-memory', False) + def test_js_preprocess(self): # Use stderr rather than stdout here because stdout is redirected to the output JS file itself. From 47a490816b37e385bd4f61a6d8ce62164b683437 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 19 Dec 2024 14:48:20 -0800 Subject: [PATCH 18/25] Use MIN_NODE_VERSION in test-node-compat --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 61d7cb912a278..f076434d566ac 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -739,6 +739,7 @@ jobs: environment: LANG: "C.UTF-8" EMTEST_SKIP_V8: "1" + EMCC_CFLAGS: "-sMIN_NODE_VERSION=101900" steps: - checkout - run: From 22600c125083d4bfd0be64c09495944db0dffe55 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 19 Dec 2024 16:26:22 -0800 Subject: [PATCH 19/25] remove extra blank lines --- test/test_other.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/test_other.py b/test/test_other.py index fffc9489e7157..3ff45f7eff423 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -10502,8 +10502,6 @@ def compile(flags): verify_features_sec_linked('bulk-memory-opt', True) verify_features_sec_linked('nontrapping-fptoint', True) - - def test_js_preprocess(self): # Use stderr rather than stdout here because stdout is redirected to the output JS file itself. create_file('lib.js', ''' From c20eee9f97d51973c0233d964fae8fc80e2be1ee Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 20 Dec 2024 11:36:57 -0800 Subject: [PATCH 20/25] enable printing all features in test_dwarf --- test/test_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_core.py b/test/test_core.py index 243b6d202babd..672a727dffba9 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -7801,7 +7801,7 @@ def get_dwarf_addr(line, col): # Get the wat, printing with -g which has binary offsets wat = self.run_process([Path(building.get_binaryen_bin(), 'wasm-opt'), - wasm_filename, '-g', '--print'], stdout=PIPE).stdout + wasm_filename, '-g', '--print', '-all'], stdout=PIPE).stdout # We expect to see a pattern like this in optimized builds (there isn't # much that can change with such calls to JS (they can't be reordered or From 216ea0954cdc923f69be9a18b82e3f03072c6fc7 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 20 Dec 2024 13:55:29 -0800 Subject: [PATCH 21/25] Add node version required for threads and mutable globals --- tools/feature_matrix.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index 59acbc87e1976..c91af1ea422c7 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -65,6 +65,7 @@ class Feature(IntEnum): 'chrome': 74, 'firefox': 61, 'safari': 120000, + 'node': 120000, }, Feature.JS_BIGINT_INTEGRATION: { 'chrome': 67, @@ -76,6 +77,7 @@ class Feature(IntEnum): 'chrome': 74, 'firefox': 79, 'safari': 140100, + 'node': 160400, }, Feature.GLOBALTHIS: { 'chrome': 71, From 8399076343a03fc00f6afff6a6131d740619af82 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 20 Dec 2024 14:04:41 -0800 Subject: [PATCH 22/25] move node environment from job to step --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index f076434d566ac..dd5af4b95e010 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -750,6 +750,8 @@ jobs: - install-node-canary - run-tests: title: "node (canary)" + environment: + EMCC_CFLAGS: "-sMIN_NODE_VERSION=101900" test_targets: " other.test_deterministic other.test_gen_struct_info From 3caad8d8de5f862ebdb053c760b98751453ad4fb Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 20 Dec 2024 14:26:12 -0800 Subject: [PATCH 23/25] review suggestion Co-authored-by: Alon Zakai --- tools/feature_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index c91af1ea422c7..75d6872f28e17 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -172,7 +172,7 @@ def apply_min_browser_versions(): enable_feature(Feature.THREADS, 'pthreads') enable_feature(Feature.BULK_MEMORY, 'pthreads') elif settings.WASM_WORKERS or settings.SHARED_MEMORY: - enable_feature(Feature.BULK_MEMORY, 'wasm-workers') + enable_feature(Feature.BULK_MEMORY, 'shared-mem') if settings.AUDIO_WORKLET: enable_feature(Feature.GLOBALTHIS, 'AUDIO_WORKLET') if settings.MEMORY64 == 1: From 7bbbb6744bea5c8b40424e5dd42efdc4c55c9d23 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 20 Dec 2024 14:27:26 -0800 Subject: [PATCH 24/25] Make CI param for extra cflags, so node version can be injected only for one step --- .circleci/config.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dd5af4b95e010..ea3b60f9d80f3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -240,6 +240,10 @@ commands: description: "Name of given test suite" type: string default: "" + extra-cflags: + description: "Extra EMCC_CFLAGS" + type: string + default: "" steps: - when: # We only set EMTEST_RETRY_FLAKY on pull requests. When we run @@ -250,6 +254,8 @@ commands: set-retry-flaky-tests - run: name: run tests (<< parameters.title >>) + environment: + EMCC_CFLAGS: << parameters.extra-cflags >> command: | env ./test/runner << parameters.test_targets >> @@ -739,7 +745,6 @@ jobs: environment: LANG: "C.UTF-8" EMTEST_SKIP_V8: "1" - EMCC_CFLAGS: "-sMIN_NODE_VERSION=101900" steps: - checkout - run: @@ -750,8 +755,7 @@ jobs: - install-node-canary - run-tests: title: "node (canary)" - environment: - EMCC_CFLAGS: "-sMIN_NODE_VERSION=101900" + extra-cflags: "-sMIN_NODE_VERSION=101900" test_targets: " other.test_deterministic other.test_gen_struct_info From c3c901bf2027f2e43c56a0d53667284c2fc4ee23 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 20 Dec 2024 14:31:24 -0800 Subject: [PATCH 25/25] actually fix the node config by moving the env var to the intended place --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ea3b60f9d80f3..cf7f91827745a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -755,7 +755,6 @@ jobs: - install-node-canary - run-tests: title: "node (canary)" - extra-cflags: "-sMIN_NODE_VERSION=101900" test_targets: " other.test_deterministic other.test_gen_struct_info @@ -772,6 +771,7 @@ jobs: node_version: "10.19.0" - run-tests: title: "node (oldest / 10.19.0)" + extra-cflags: "-sMIN_NODE_VERSION=101900" test_targets: " other.test_gen_struct_info other.test_native_call_before_init