From 9eaa39266c3c9a3fadfc4ee439c6bd8593683e5b Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 15 Nov 2024 14:53:25 -0800 Subject: [PATCH 01/32] [WIP] Enable WASM_BIGINT by default Enables by default by temporarily reducing required Safari version. Also includes bugfixes for WASM_BIGINT compatibility. --- src/library_wasmfs_jsimpl.js | 1 + src/shell.js | 3 ++- test/test_core.py | 16 +++++++--------- test/test_other.py | 9 +++++---- tools/feature_matrix.py | 2 +- tools/link.py | 6 ++++++ 6 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/library_wasmfs_jsimpl.js b/src/library_wasmfs_jsimpl.js index f6293f3d460ea..63b3e77ec2aee 100644 --- a/src/library_wasmfs_jsimpl.js +++ b/src/library_wasmfs_jsimpl.js @@ -53,6 +53,7 @@ addToLibrary({ return wasmFS$backends[backend].getSize(file); }, + _wasmfs_jsimpl_set_size__i53abi: true, _wasmfs_jsimpl_set_size: (backend, file, size) => { #if ASSERTIONS assert(wasmFS$backends[backend]); diff --git a/src/shell.js b/src/shell.js index ae3cf54a416e0..b4831f5ea61b9 100644 --- a/src/shell.js +++ b/src/shell.js @@ -49,7 +49,8 @@ var Module = typeof {{{ EXPORT_NAME }}} != 'undefined' ? {{{ EXPORT_NAME }}} : { #include "polyfill/objassign.js" #endif -#if WASM_BIGINT && MIN_SAFARI_VERSION < 150000 +#if WASM_BIGINT && MIN_SAFARI_VERSION < 140100 +// TODO: Fix this back to 150000 // See https://caniuse.com/mdn-javascript_builtins_bigint64array #include "polyfill/bigint64array.js" #endif diff --git a/test/test_core.py b/test/test_core.py index f0da30a4af1f6..ffb0875b81241 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -1954,10 +1954,8 @@ def test_em_js(self, args, force_c): @no_wasm2js('WASM_BIGINT is not compatible with wasm2js') def test_em_js_i64(self): - err = self.expect_fail([EMCC, '-Werror', test_file('core/test_em_js_i64.c')]) + err = self.expect_fail([EMCC, '-Werror', '-sWASM_BIGINT=0', test_file('core/test_em_js_i64.c')]) self.assertContained('emcc: error: using 64-bit arguments in EM_JS function without WASM_BIGINT is not yet fully supported: `foo`', err) - - self.set_setting('WASM_BIGINT') self.node_args += shared.node_bigint_flags(self.get_nodejs()) self.do_core_test('test_em_js_i64.c') @@ -6995,11 +6993,10 @@ def test_EXPORTED_RUNTIME_METHODS(self): def test_dyncall_specific(self, *args): if self.get_setting('MEMORY64'): self.skipTest('not compatible with MEMORY64') - if self.get_setting('WASM_BIGINT'): - # define DYNCALLS because this test does test calling them directly, and - # in WASM_BIGINT mode we do not enable them by default (since we can do - # more without them - we don't need to legalize) - args = list(args) + ['-sDYNCALLS', '-DWASM_BIGINT'] + # define DYNCALLS because this test does test calling them directly, and + # in WASM_BIGINT mode we do not enable them by default (since we can do + # more without them - we don't need to legalize) + args = list(args) + ['-sDYNCALLS', '-DWASM_BIGINT'] cases = [ ('DIRECT', []), ('DYNAMIC_SIG', ['-sDYNCALLS']), @@ -8417,6 +8414,7 @@ def test_wasm2js(self): if self.is_wasm2js(): self.skipTest('redundant to test wasm2js in wasm2js* mode') self.set_setting('WASM', 0) + self.set_setting('WASM_BIGINT', 0) self.do_core_test('test_hello_world.c') self.assertNotExists('test_hello_world.js.mem') @@ -8448,7 +8446,7 @@ def test_wasm2js_fallback(self, args): if self.is_wasm2js(): self.skipTest('redundant to test wasm2js in wasm2js* mode') - cmd = [EMCC, test_file('small_hello_world.c'), '-sWASM=2'] + args + cmd = [EMCC, test_file('small_hello_world.c'), '-sWASM=2', '-sWASM_BIGINT=0'] + args self.run_process(cmd) # First run with WebAssembly support enabled diff --git a/test/test_other.py b/test/test_other.py index 3176a44a634d2..8be21fc3100f1 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -8197,15 +8197,15 @@ def test_memory_growth_noasm(self): assert 'use asm' not in src def test_EM_ASM_i64(self): + self.do_other_test('test_em_asm_i64.cpp') + self.do_other_test('test_em_asm_i64.cpp', force_c=True) + + self.set_setting('WASM_BIGINT', 0) expected = 'Invalid character 106("j") in readEmAsmArgs!' self.do_runf('other/test_em_asm_i64.cpp', expected_output=expected, assert_returncode=NON_ZERO) - self.set_setting('WASM_BIGINT') - self.do_other_test('test_em_asm_i64.cpp') - self.do_other_test('test_em_asm_i64.cpp', force_c=True) - def test_eval_ctor_ordering(self): # ensure order of execution remains correct, even with a bad ctor def test(p1, p2, p3, last, expected): @@ -12373,6 +12373,7 @@ def fail(args, details): # plain -O0 legalization_message = 'to disable int64 legalization (which requires changes after link) use -sWASM_BIGINT' fail([], legalization_message) + fail(['-sMIN_SAFARI_VERSION=140100'], legalization_message) # optimized builds even without legalization optimization_message = '-O2+ optimizations always require changes, build with -O0 or -O1 instead' fail(required_flags + ['-O2'], optimization_message) diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index 53ee6f66ce716..515bc7f3c4b7a 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -66,7 +66,7 @@ class Feature(IntEnum): Feature.JS_BIGINT_INTEGRATION: { 'chrome': 67, 'firefox': 68, - 'safari': 150000, + 'safari': 140100, }, Feature.THREADS: { 'chrome': 74, diff --git a/tools/link.py b/tools/link.py index c554bf3e1292c..e7c4d6af53490 100644 --- a/tools/link.py +++ b/tools/link.py @@ -786,6 +786,10 @@ def phase_linker_setup(options, state, newargs): # to js. settings.WASM = 1 settings.WASM2JS = 1 + # Wasm bigint doesn't make sense with wasm2js, since it controls how the + # wasm and JS interact. + settings.WASM_BIGINT = 0 + feature_matrix.disable_feature(feature_matrix.Feature.JS_BIGINT_INTEGRATION) if settings.WASM == 2: # Requesting both Wasm and Wasm2JS support settings.WASM2JS = 1 @@ -1386,6 +1390,8 @@ def phase_linker_setup(options, state, newargs): settings.SUPPORTS_PROMISE_ANY = feature_matrix.caniuse(feature_matrix.Feature.PROMISE_ANY) if not settings.BULK_MEMORY: settings.BULK_MEMORY = feature_matrix.caniuse(feature_matrix.Feature.BULK_MEMORY) + if 'WASM_BIGINT' not in user_settings: + settings.WASM_BIGINT = feature_matrix.caniuse(feature_matrix.Feature.JS_BIGINT_INTEGRATION) if settings.AUDIO_WORKLET: if settings.AUDIO_WORKLET == 1: From 5532f2992be632042d7daf28b0db8e264fec983b Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 22 Nov 2024 13:40:09 -0800 Subject: [PATCH 02/32] review comments; fix name section emission --- emcc.py | 10 ++++++++++ test/test_core.py | 1 - test/test_other.py | 3 +-- tools/emscripten.py | 13 +++++++++---- tools/feature_matrix.py | 2 +- tools/link.py | 7 +++---- 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/emcc.py b/emcc.py index dfe088e7b75c0..a43fafed7a409 100644 --- a/emcc.py +++ b/emcc.py @@ -1259,6 +1259,13 @@ def consume_arg_file(): if is_int(requested_level): # the -gX value is the debug level (-g1, -g2, etc.) settings.DEBUG_LEVEL = validate_arg_level(requested_level, 4, 'invalid debug level: ' + arg) + if settings.DEBUG_LEVEL == 0: + # Set these explicitly so -g0 overrides previous -g on the cmdline + settings.GENERATE_DWARF = 0 + settings.GENERATE_SOURCE_MAP = 0 + settings.EMIT_NAME_SECTION = 0 + elif settings.DEBUG_LEVEL > 1: + settings.EMIT_NAME_SECTION = 1 # if we don't need to preserve LLVM debug info, do not keep this flag # for clang if settings.DEBUG_LEVEL < 3: @@ -1289,17 +1296,20 @@ def consume_arg_file(): settings.GENERATE_DWARF = 1 elif requested_level == 'source-map': settings.GENERATE_SOURCE_MAP = 1 + settings.EMIT_NAME_SECTION = 1 newargs[i] = '-g' else: # Other non-integer levels (e.g. -gline-tables-only or -gdwarf-5) are # usually clang flags that emit DWARF. So we pass them through to # clang and make the emscripten code treat it like any other DWARF. settings.GENERATE_DWARF = 1 + settings.EMIT_NAME_SECTION = 1 # In all cases set the emscripten debug level to 3 so that we do not # strip during link (during compile, this does not make a difference). settings.DEBUG_LEVEL = 3 elif check_flag('-profiling') or check_flag('--profiling'): settings.DEBUG_LEVEL = max(settings.DEBUG_LEVEL, 2) + settings.EMIT_NAME_SECTION = 1 elif check_flag('-profiling-funcs') or check_flag('--profiling-funcs'): settings.EMIT_NAME_SECTION = 1 elif newargs[i] == '--tracing' or newargs[i] == '--memoryprofiler': diff --git a/test/test_core.py b/test/test_core.py index ffb0875b81241..8d3a4feae55f4 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -8414,7 +8414,6 @@ def test_wasm2js(self): if self.is_wasm2js(): self.skipTest('redundant to test wasm2js in wasm2js* mode') self.set_setting('WASM', 0) - self.set_setting('WASM_BIGINT', 0) self.do_core_test('test_hello_world.c') self.assertNotExists('test_hello_world.js.mem') diff --git a/test/test_other.py b/test/test_other.py index 8be21fc3100f1..5b2c9cdf1fffb 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -3079,8 +3079,7 @@ def test_dwarf_sourcemap_names(self): # TODO: It seems odd that -gsource-map leaves behind a name section. Should it? (['-gsource-map'], False, True, True), (['-g1', '-Oz', '-gsource-map'], False, True, True), - # -g0 does not override -gsource-map but does remove name section. TODO: should it? - (['-gsource-map', '-g0'], False, True, False), + (['-gsource-map', '-g0'], False, False, False), # --emit-symbol-map should not affect the results (['--emit-symbol-map', '-gsource-map'], False, True, True), (['--emit-symbol-map'], False, False, False), diff --git a/tools/emscripten.py b/tools/emscripten.py index f13391b5be020..b519cddd11135 100644 --- a/tools/emscripten.py +++ b/tools/emscripten.py @@ -566,12 +566,17 @@ def finalize_wasm(infile, outfile, js_syms): infile] shared.check_call(cmd) - if not settings.GENERATE_DWARF or not settings.EMIT_PRODUCERS_SECTION: - # For sections we no longer need, strip now to speed subsequent passes + # For sections we no longer need, strip now to speed subsequent passes + strip_sections = [] + if not settings.EMIT_PRODUCERS_SECTION: + strip_sections += ['producers'] + if not settings.EMIT_NAME_SECTION: + strip_sections += ['name'] + + if strip_sections or not settings.GENERATE_DWARF: building.save_intermediate(outfile, 'strip.wasm') - sections = ['producers'] if not settings.EMIT_PRODUCERS_SECTION else [] building.strip(infile, outfile, debug=not settings.GENERATE_DWARF, - sections=sections) + sections=strip_sections) metadata = get_metadata(outfile, outfile, modify_wasm, args) diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index 515bc7f3c4b7a..ca5a25f0f52be 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -66,7 +66,7 @@ class Feature(IntEnum): Feature.JS_BIGINT_INTEGRATION: { 'chrome': 67, 'firefox': 68, - 'safari': 140100, + 'safari': 140100, # TODO: set this back to 15 after we update the default targets. }, Feature.THREADS: { 'chrome': 74, diff --git a/tools/link.py b/tools/link.py index e7c4d6af53490..a50a9bddced0e 100644 --- a/tools/link.py +++ b/tools/link.py @@ -788,8 +788,8 @@ def phase_linker_setup(options, state, newargs): settings.WASM2JS = 1 # Wasm bigint doesn't make sense with wasm2js, since it controls how the # wasm and JS interact. - settings.WASM_BIGINT = 0 - feature_matrix.disable_feature(feature_matrix.Feature.JS_BIGINT_INTEGRATION) + if settings.WASM_BIGINT: + exit_with_error('WASM_BIGINT is not compatible with WASM=0') if settings.WASM == 2: # Requesting both Wasm and Wasm2JS support settings.WASM2JS = 1 @@ -1390,8 +1390,7 @@ def phase_linker_setup(options, state, newargs): settings.SUPPORTS_PROMISE_ANY = feature_matrix.caniuse(feature_matrix.Feature.PROMISE_ANY) if not settings.BULK_MEMORY: settings.BULK_MEMORY = feature_matrix.caniuse(feature_matrix.Feature.BULK_MEMORY) - if 'WASM_BIGINT' not in user_settings: - settings.WASM_BIGINT = feature_matrix.caniuse(feature_matrix.Feature.JS_BIGINT_INTEGRATION) + default_setting('WASM_BIGINT', feature_matrix.caniuse(feature_matrix.Feature.JS_BIGINT_INTEGRATION)) if settings.AUDIO_WORKLET: if settings.AUDIO_WORKLET == 1: From 5d13302e6ad971886fb73bf606f581dd78bd7a37 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 22 Nov 2024 13:51:56 -0800 Subject: [PATCH 03/32] one more debuginfo test works now --- test/test_other.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_other.py b/test/test_other.py index 5b2c9cdf1fffb..40227ec682caf 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -3088,7 +3088,7 @@ def test_dwarf_sourcemap_names(self): (['-sASYNCIFY=1', '-gsource-map'], False, True, True), (['-g', '-gsource-map'], True, True, True), (['-g2', '-gsource-map'], False, True, True), - # (['-gsplit-dwarf', '-gsource-map'], True, True, True), TODO this currently fails! + (['-gsplit-dwarf', '-gsource-map'], True, True, True), (['-gsource-map', '-sWASM_BIGINT', '-sERROR_ON_WASM_CHANGES_AFTER_LINK'], False, True, True), ]: print(flags, expect_dwarf, expect_sourcemap, expect_names) From 152c205201b7dbe88db5f944e9b16ddbd4685cac Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 22 Nov 2024 17:59:17 -0800 Subject: [PATCH 04/32] fix more tests, use explicit need_name_section in finalize --- src/shell.js | 2 +- test/test_other.py | 108 ++++++++++++++++++++-------------------- tools/emscripten.py | 7 ++- tools/feature_matrix.py | 2 +- tools/link.py | 2 +- 5 files changed, 62 insertions(+), 59 deletions(-) diff --git a/src/shell.js b/src/shell.js index b4831f5ea61b9..9f0ddbab794be 100644 --- a/src/shell.js +++ b/src/shell.js @@ -50,7 +50,7 @@ var Module = typeof {{{ EXPORT_NAME }}} != 'undefined' ? {{{ EXPORT_NAME }}} : { #endif #if WASM_BIGINT && MIN_SAFARI_VERSION < 140100 -// TODO: Fix this back to 150000 +// TODO(features): Fix this back to 150000 // See https://caniuse.com/mdn-javascript_builtins_bigint64array #include "polyfill/bigint64array.js" #endif diff --git a/test/test_other.py b/test/test_other.py index 40227ec682caf..cd3bba26b665b 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -2960,7 +2960,7 @@ def test_emcc_debug_files(self): self.assertFalse(os.path.exists(self.canonical_temp_dir)) else: print(sorted(os.listdir(self.canonical_temp_dir))) - self.assertExists(os.path.join(self.canonical_temp_dir, 'emcc-03-original.js')) + self.assertExists(os.path.join(self.canonical_temp_dir, 'emcc-02-original.js')) def test_debuginfo_line_tables_only(self): def test(do_compile): @@ -3504,10 +3504,10 @@ def test_embind_tsgen_val(self): def test_embind_tsgen_bigint(self): args = [EMXX, test_file('other/embind_tsgen_bigint.cpp'), '-lembind', '--emit-tsd', 'embind_tsgen_bigint.d.ts'] # Check that TypeScript generation fails when code contains bigints but their support is not enabled - stderr = self.expect_fail(args) + stderr = self.expect_fail(args + ['-sWASM_BIGINT=0']) self.assertContained("Missing primitive type to TS type for 'int64_t", stderr) # Check that TypeScript generation works when bigint support is enabled - self.run_process(args + ['-sWASM_BIGINT']) + self.run_process(args) self.assertFileContents(test_file('other/embind_tsgen_bigint.d.ts'), read_file('embind_tsgen_bigint.d.ts')) @requires_wasm64 @@ -8013,8 +8013,8 @@ def test_malloc_multithreading(self, allocator, args): self.do_other_test('test_malloc_multithreading.cpp', emcc_args=args) @parameterized({ - '': ([], 'testbind.js'), - 'bigint': (['-sWASM_BIGINT'], 'testbind_bigint.js'), + '': ([], 'testbind_bigint.js'), + 'nobigint': (['-sWASM_BIGINT=0'], 'testbind.js'), }) @requires_node def test_i64_return_value(self, args, bind_js): @@ -8510,7 +8510,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']) @@ -8934,39 +8934,39 @@ def test_exported_runtime_methods_metadce(self, use_legacy_name): for export in exports: self.assertContained(f'Module["{export}"]', js) - def test_legalize_js_ffi(self): - # test disabling of JS FFI legalization - for (args, js_ffi) in [ - (['-sLEGALIZE_JS_FFI=1', '-sSIDE_MODULE', '-O1'], True), - (['-sLEGALIZE_JS_FFI=0', '-sSIDE_MODULE', '-O1'], False), - (['-sLEGALIZE_JS_FFI=0', '-sSIDE_MODULE', '-O0'], False), - (['-sLEGALIZE_JS_FFI=1', '-sWARN_ON_UNDEFINED_SYMBOLS=0', '-O0'], True), - (['-sLEGALIZE_JS_FFI=0', '-sWARN_ON_UNDEFINED_SYMBOLS=0', '-O0'], False), - ]: - print(args) - delete_file('a.out.wasm') - cmd = [EMCC, test_file('other/ffi.c'), '-g', '-o', 'a.out.wasm'] + args - print(' '.join(cmd)) - self.run_process(cmd) - text = self.get_wasm_text('a.out.wasm') - # remove internal comments and extra whitespace - text = re.sub(r'\(;[^;]+;\)', '', text) - text = re.sub(r'\$var\$*.', '', text) - text = re.sub(r'param \$\d+', 'param ', text) - text = re.sub(r' +', ' ', text) - e_add_f32 = re.search(r'func \$add_f \(param f32\) \(param f32\) \(result f32\)', text) - assert e_add_f32, 'add_f export missing' - i_i64_i32 = re.search(r'import "env" "import_ll" .*\(param i32 i32\) \(result i32\)', text) - i_i64_i64 = re.search(r'import "env" "import_ll" .*\(param i64\) \(result i64\)', text) - e_i64_i32 = re.search(r'func \$legalstub\$add_ll \(param i32\) \(param i32\) \(param i32\) \(param i32\) \(result i32\)', text) - if js_ffi: - assert i_i64_i32, 'i64 not converted to i32 in imports' - assert not i_i64_i64, 'i64 not converted to i32 in imports' - assert e_i64_i32, 'i64 not converted to i32 in exports' - else: - assert not i_i64_i32, 'i64 converted to i32 in imports' - assert i_i64_i64, 'i64 converted to i32 in imports' - assert not e_i64_i32, 'i64 converted to i32 in exports' + @parameterized({ + 'legal_side_O1': (['-sLEGALIZE_JS_FFI=1', '-sSIDE_MODULE', '-O1'], True), + 'nolegal_side_O1': (['-sLEGALIZE_JS_FFI=0', '-sSIDE_MODULE', '-O1'], False), + 'nolegal_side_O0': (['-sLEGALIZE_JS_FFI=0', '-sSIDE_MODULE', '-O0'], False), + 'legal_O0': (['-sLEGALIZE_JS_FFI=1', '-sWARN_ON_UNDEFINED_SYMBOLS=0', '-O0'], True), + 'nolegal_O0': (['-sLEGALIZE_JS_FFI=0', '-sWARN_ON_UNDEFINED_SYMBOLS=0', '-O0'], False), + }) + def test_legalize_js_ffi(self, args, js_ffi): + # test disabling of JS FFI legalization when not using bigint + print(args) + delete_file('a.out.wasm') + cmd = [EMCC, test_file('other/ffi.c'), '-g', '-o', 'a.out.wasm', '-sWASM_BIGINT=0'] + args + print(' '.join(cmd)) + self.run_process(cmd) + text = self.get_wasm_text('a.out.wasm') + # remove internal comments and extra whitespace + text = re.sub(r'\(;[^;]+;\)', '', text) + text = re.sub(r'\$var\$*.', '', text) + text = re.sub(r'param \$\d+', 'param ', text) + text = re.sub(r' +', ' ', text) + e_add_f32 = re.search(r'func \$add_f \(param f32\) \(param f32\) \(result f32\)', text) + assert e_add_f32, 'add_f export missing' + i_i64_i32 = re.search(r'import "env" "import_ll" .*\(param i32 i32\) \(result i32\)', text) + i_i64_i64 = re.search(r'import "env" "import_ll" .*\(param i64\) \(result i64\)', text) + e_i64_i32 = re.search(r'func \$legalstub\$add_ll \(param i32\) \(param i32\) \(param i32\) \(param i32\) \(result i32\)', text) + if js_ffi: + assert i_i64_i32, 'i64 not converted to i32 in imports' + assert not i_i64_i64, 'i64 not converted to i32 in imports' + assert e_i64_i32, 'i64 not converted to i32 in exports' + else: + assert not i_i64_i32, 'i64 converted to i32 in imports' + assert i_i64_i64, 'i64 converted to i32 in imports' + assert not e_i64_i32, 'i64 converted to i32 in exports' @disabled('https://github.com/WebAssembly/binaryen/pull/6428') def test_no_legalize_js_ffi(self): @@ -11478,13 +11478,13 @@ def test(code): print(f'int:{i} float:{f} double:{lf}: both{both}') # iprintf is much smaller than printf with float support - self.assertGreater(i, f - 3500) + self.assertGreater(i, f - 3800) self.assertLess(i, f - 3000) # __small_printf is somewhat smaller than printf with long double support self.assertGreater(f, lf - 900) self.assertLess(f, lf - 500) # both is a little bigger still - self.assertGreater(lf, both - 110) + self.assertGreater(lf, both - 150) self.assertLess(lf, both - 50) @parameterized({ @@ -12347,19 +12347,18 @@ def ok(args, filename='hello_world.cpp', expected='hello, world!'): args += ['-sERROR_ON_WASM_CHANGES_AFTER_LINK'] self.do_runf(filename, expected, emcc_args=args) - # -O0 with BigInt support (to avoid the need for legalization) - required_flags = ['-sWASM_BIGINT'] - ok(required_flags) + # -O0 with BigInt support (now on by default) + ok([]) # Same with DWARF - ok(required_flags + ['-g']) + ok(['-g']) # Function pointer calls from JS work too - ok(required_flags, filename='hello_world_main_loop.cpp') + ok([], filename='hello_world_main_loop.cpp') # -O1 is ok as we don't run wasm-opt there (but no higher, see below) - ok(required_flags + ['-O1']) + ok(['-O1']) # Exception support shouldn't require changes after linking - ok(required_flags + ['-fexceptions']) + ok(['-fexceptions']) # Standalone mode should not do anything special to the wasm. - ok(required_flags + ['-sSTANDALONE_WASM']) + ok(['-sSTANDALONE_WASM']) # other builds fail with a standard message + extra details def fail(args, details): @@ -12371,12 +12370,12 @@ def fail(args, details): # plain -O0 legalization_message = 'to disable int64 legalization (which requires changes after link) use -sWASM_BIGINT' - fail([], legalization_message) - fail(['-sMIN_SAFARI_VERSION=140100'], legalization_message) + fail(['-sWASM_BIGINT=0'], legalization_message) + fail(['-sMIN_SAFARI_VERSION=140000'], legalization_message) # TODO(features): change this back to 140100 after 15 is default # optimized builds even without legalization optimization_message = '-O2+ optimizations always require changes, build with -O0 or -O1 instead' - fail(required_flags + ['-O2'], optimization_message) - fail(required_flags + ['-O3'], optimization_message) + fail(['-O2'], optimization_message) + fail(['-O3'], optimization_message) @crossplatform def test_output_to_nowhere(self): @@ -14471,7 +14470,8 @@ def test_reproduce(self): def test_min_browser_version(self): err = self.expect_fail([EMCC, test_file('hello_world.c'), '-Wno-transpile', '-Werror', '-sWASM_BIGINT', '-sMIN_SAFARI_VERSION=120000']) - self.assertContained('emcc: error: MIN_SAFARI_VERSION=120000 is not compatible with WASM_BIGINT (150000 or above required)', err) + # TODO(features): fix back to 15000 once Safari 15 is default + self.assertContained('emcc: error: MIN_SAFARI_VERSION=120000 is not compatible with WASM_BIGINT (140100 or above required)', err) err = self.expect_fail([EMCC, test_file('hello_world.c'), '-Wno-transpile', '-Werror', '-pthread', '-sMIN_CHROME_VERSION=73']) self.assertContained('emcc: error: MIN_CHROME_VERSION=73 is not compatible with pthreads (74 or above required)', err) diff --git a/tools/emscripten.py b/tools/emscripten.py index b519cddd11135..bd50a476f6270 100644 --- a/tools/emscripten.py +++ b/tools/emscripten.py @@ -499,12 +499,14 @@ def finalize_wasm(infile, outfile, js_syms): # if we don't need to modify the wasm, don't tell finalize to emit a wasm file modify_wasm = False + need_name_section = False if settings.WASM2JS: # wasm2js requires full legalization (and will do extra wasm binary # later processing later anyhow) modify_wasm = True if settings.DEBUG_LEVEL >= 2 or settings.ASYNCIFY_ADD or settings.ASYNCIFY_ADVISE or settings.ASYNCIFY_ONLY or settings.ASYNCIFY_REMOVE or settings.EMIT_SYMBOL_MAP or settings.EMIT_NAME_SECTION: + need_name_section = True args.append('-g') if settings.WASM_BIGINT: args.append('--bigint') @@ -566,11 +568,12 @@ def finalize_wasm(infile, outfile, js_syms): infile] shared.check_call(cmd) - # For sections we no longer need, strip now to speed subsequent passes + # For sections we no longer need, strip now to speed subsequent passes. + # If Binaryen is not needed, this is also our last chance to strip. strip_sections = [] if not settings.EMIT_PRODUCERS_SECTION: strip_sections += ['producers'] - if not settings.EMIT_NAME_SECTION: + if not need_name_section: strip_sections += ['name'] if strip_sections or not settings.GENERATE_DWARF: diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index ca5a25f0f52be..31700a0b57d80 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -66,7 +66,7 @@ class Feature(IntEnum): Feature.JS_BIGINT_INTEGRATION: { 'chrome': 67, 'firefox': 68, - 'safari': 140100, # TODO: set this back to 15 after we update the default targets. + 'safari': 140100, # TODO(features): set this back to 15 after we update the default targets. }, Feature.THREADS: { 'chrome': 74, diff --git a/tools/link.py b/tools/link.py index a50a9bddced0e..79af389f374f4 100644 --- a/tools/link.py +++ b/tools/link.py @@ -1757,7 +1757,7 @@ def get_full_import_name(name): exit_with_error('wasm2js does not support source maps yet (debug in wasm for now)') if settings.MEMORY64: exit_with_error('wasm2js does not support MEMORY64') - if settings.WASM_BIGINT: + if settings.WASM_BIGINT and 'WASM_BIGINT' in user_settings: exit_with_error('wasm2js does not support WASM_BIGINT') if settings.CAN_ADDRESS_2GB: exit_with_error('wasm2js does not support >2gb address space') From 4a6588e812448e4874613d31115d62f9f6a3c69e Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 26 Nov 2024 17:32:28 -0800 Subject: [PATCH 05/32] Use i53abi for one more wasmfs function --- src/library_wasmfs_jsimpl.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/library_wasmfs_jsimpl.js b/src/library_wasmfs_jsimpl.js index 63b3e77ec2aee..6acc27be020bf 100644 --- a/src/library_wasmfs_jsimpl.js +++ b/src/library_wasmfs_jsimpl.js @@ -106,6 +106,7 @@ addToLibrary({ _emscripten_proxy_finish(ctx); }, + _wasmfs_jsimpl_async_get_size__i53abi: true, _wasmfs_jsimpl_async_get_size__deps: ['emscripten_proxy_finish'], _wasmfs_jsimpl_async_get_size: async function(ctx, backend, file, size_p) { #if ASSERTIONS From 52fedfd028b7e047b86331b627167d924b6b1f89 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 27 Nov 2024 15:24:03 -0800 Subject: [PATCH 06/32] update node version for bigint --- tools/feature_matrix.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index 31700a0b57d80..51d4ec469a0b3 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -67,6 +67,7 @@ class Feature(IntEnum): 'chrome': 67, 'firefox': 68, 'safari': 140100, # TODO(features): set this back to 15 after we update the default targets. + 'node': 130000, }, Feature.THREADS: { 'chrome': 74, From 01d5e34a85165111bc5534fed7529a998edfa3cf Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 6 Dec 2024 15:00:42 -0800 Subject: [PATCH 07/32] dont use i53 in the wrong place --- src/library_wasmfs_jsimpl.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/library_wasmfs_jsimpl.js b/src/library_wasmfs_jsimpl.js index 6acc27be020bf..63b3e77ec2aee 100644 --- a/src/library_wasmfs_jsimpl.js +++ b/src/library_wasmfs_jsimpl.js @@ -106,7 +106,6 @@ addToLibrary({ _emscripten_proxy_finish(ctx); }, - _wasmfs_jsimpl_async_get_size__i53abi: true, _wasmfs_jsimpl_async_get_size__deps: ['emscripten_proxy_finish'], _wasmfs_jsimpl_async_get_size: async function(ctx, backend, file, size_p) { #if ASSERTIONS From 2c1b640f68be72f3e71ff2bb88b3dae3ae491c2a Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 6 Dec 2024 15:41:40 -0800 Subject: [PATCH 08/32] rebaseline size tests --- test/code_size/embind_hello_wasm.json | 12 ++++++------ test/code_size/embind_val_wasm.json | 12 ++++++------ 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/random_printf_wasm.json | 8 ++++---- test/code_size/random_printf_wasm2js.json | 8 ++++---- .../codesize/test_codesize_cxx_ctors1.exports | 5 ----- .../codesize/test_codesize_cxx_ctors1.gzsize | 2 +- .../codesize/test_codesize_cxx_ctors1.jssize | 2 +- .../other/codesize/test_codesize_cxx_ctors1.size | 2 +- .../codesize/test_codesize_cxx_ctors2.exports | 5 ----- .../codesize/test_codesize_cxx_ctors2.gzsize | 2 +- .../codesize/test_codesize_cxx_ctors2.jssize | 2 +- .../other/codesize/test_codesize_cxx_ctors2.size | 2 +- .../codesize/test_codesize_cxx_except.exports | 6 ------ .../codesize/test_codesize_cxx_except.gzsize | 2 +- .../codesize/test_codesize_cxx_except.jssize | 2 +- .../other/codesize/test_codesize_cxx_except.size | 2 +- .../test_codesize_cxx_except_wasm.exports | 5 ----- .../test_codesize_cxx_except_wasm.gzsize | 2 +- .../test_codesize_cxx_except_wasm.jssize | 2 +- .../codesize/test_codesize_cxx_except_wasm.size | 2 +- .../test_codesize_cxx_except_wasm_exnref.exports | 5 ----- .../test_codesize_cxx_except_wasm_exnref.gzsize | 2 +- .../test_codesize_cxx_except_wasm_exnref.jssize | 2 +- .../test_codesize_cxx_except_wasm_exnref.size | 2 +- test/other/codesize/test_codesize_cxx_lto.gzsize | 2 +- .../other/codesize/test_codesize_cxx_lto.imports | 16 ++++++++-------- test/other/codesize/test_codesize_cxx_lto.jssize | 2 +- test/other/codesize/test_codesize_cxx_lto.sent | 16 ++++++++-------- test/other/codesize/test_codesize_cxx_lto.size | 2 +- .../codesize/test_codesize_cxx_mangle.exports | 6 ------ .../codesize/test_codesize_cxx_mangle.gzsize | 2 +- .../codesize/test_codesize_cxx_mangle.jssize | 2 +- .../other/codesize/test_codesize_cxx_mangle.size | 2 +- .../codesize/test_codesize_cxx_noexcept.exports | 5 ----- .../codesize/test_codesize_cxx_noexcept.gzsize | 2 +- .../codesize/test_codesize_cxx_noexcept.jssize | 2 +- .../codesize/test_codesize_cxx_noexcept.size | 2 +- .../codesize/test_codesize_cxx_wasmfs.exports | 8 -------- .../codesize/test_codesize_cxx_wasmfs.gzsize | 2 +- .../codesize/test_codesize_cxx_wasmfs.jssize | 2 +- .../other/codesize/test_codesize_cxx_wasmfs.size | 2 +- .../codesize/test_codesize_files_js_fs.gzsize | 2 +- .../codesize/test_codesize_files_js_fs.jssize | 2 +- .../codesize/test_codesize_files_wasmfs.exports | 8 ++++---- .../codesize/test_codesize_files_wasmfs.funcs | 3 --- .../codesize/test_codesize_files_wasmfs.gzsize | 2 +- .../codesize/test_codesize_files_wasmfs.imports | 5 ++--- .../codesize/test_codesize_files_wasmfs.jssize | 2 +- .../codesize/test_codesize_files_wasmfs.sent | 5 ++--- .../codesize/test_codesize_files_wasmfs.size | 2 +- .../codesize/test_codesize_hello_O0.exports | 1 - test/other/codesize/test_codesize_hello_O0.funcs | 4 ---- .../other/codesize/test_codesize_hello_O0.gzsize | 2 +- .../other/codesize/test_codesize_hello_O0.jssize | 2 +- test/other/codesize/test_codesize_hello_O0.size | 2 +- .../codesize/test_codesize_hello_O1.exports | 1 - test/other/codesize/test_codesize_hello_O1.funcs | 4 ---- .../other/codesize/test_codesize_hello_O1.gzsize | 2 +- .../other/codesize/test_codesize_hello_O1.jssize | 2 +- test/other/codesize/test_codesize_hello_O1.size | 2 +- .../codesize/test_codesize_hello_O2.exports | 1 - test/other/codesize/test_codesize_hello_O2.funcs | 1 - .../other/codesize/test_codesize_hello_O2.gzsize | 2 +- .../other/codesize/test_codesize_hello_O2.jssize | 2 +- test/other/codesize/test_codesize_hello_O2.size | 2 +- .../other/codesize/test_codesize_hello_O3.gzsize | 2 +- .../other/codesize/test_codesize_hello_O3.jssize | 2 +- .../other/codesize/test_codesize_hello_Os.gzsize | 2 +- .../other/codesize/test_codesize_hello_Os.jssize | 2 +- .../other/codesize/test_codesize_hello_Oz.gzsize | 2 +- .../other/codesize/test_codesize_hello_Oz.jssize | 2 +- .../codesize/test_codesize_hello_dylink.exports | 1 - .../codesize/test_codesize_hello_dylink.funcs | 1 - .../codesize/test_codesize_hello_dylink.gzsize | 2 +- .../codesize/test_codesize_hello_dylink.jssize | 2 +- .../codesize/test_codesize_hello_dylink.size | 2 +- .../test_codesize_hello_export_nothing.gzsize | 2 +- .../test_codesize_hello_export_nothing.jssize | 2 +- .../codesize/test_codesize_hello_wasmfs.gzsize | 2 +- .../codesize/test_codesize_hello_wasmfs.jssize | 2 +- .../test_codesize_libcxxabi_message_O3.gzsize | 2 +- .../test_codesize_libcxxabi_message_O3.jssize | 2 +- ...desize_libcxxabi_message_O3_standalone.gzsize | 2 +- ...desize_libcxxabi_message_O3_standalone.jssize | 2 +- test/other/codesize/test_codesize_mem_O3.gzsize | 2 +- test/other/codesize/test_codesize_mem_O3.jssize | 2 +- .../codesize/test_codesize_mem_O3_grow.gzsize | 2 +- .../codesize/test_codesize_mem_O3_grow.jssize | 2 +- .../test_codesize_mem_O3_grow_standalone.gzsize | 2 +- .../test_codesize_mem_O3_grow_standalone.jssize | 2 +- .../test_codesize_mem_O3_standalone.gzsize | 2 +- .../test_codesize_mem_O3_standalone.jssize | 2 +- .../test_codesize_mem_O3_standalone_lib.gzsize | 2 +- .../test_codesize_mem_O3_standalone_lib.jssize | 2 +- .../test_codesize_mem_O3_standalone_narg.gzsize | 2 +- .../test_codesize_mem_O3_standalone_narg.jssize | 2 +- ...t_codesize_mem_O3_standalone_narg_flto.gzsize | 2 +- ...t_codesize_mem_O3_standalone_narg_flto.jssize | 2 +- .../codesize/test_codesize_minimal_O0.funcs | 2 -- .../codesize/test_codesize_minimal_O0.gzsize | 2 +- .../codesize/test_codesize_minimal_O0.jssize | 2 +- .../other/codesize/test_codesize_minimal_O0.size | 2 +- .../codesize/test_codesize_minimal_O1.funcs | 2 -- .../codesize/test_codesize_minimal_O1.gzsize | 2 +- .../codesize/test_codesize_minimal_O1.jssize | 2 +- .../other/codesize/test_codesize_minimal_O1.size | 2 +- .../codesize/test_codesize_minimal_O2.gzsize | 2 +- .../codesize/test_codesize_minimal_O2.jssize | 2 +- .../codesize/test_codesize_minimal_O3.gzsize | 2 +- .../codesize/test_codesize_minimal_O3.jssize | 2 +- .../codesize/test_codesize_minimal_Os.gzsize | 2 +- .../codesize/test_codesize_minimal_Os.jssize | 2 +- .../codesize/test_codesize_minimal_Os_mr.gzsize | 2 +- .../codesize/test_codesize_minimal_Os_mr.jssize | 2 +- .../test_codesize_minimal_Oz-ctors.gzsize | 2 +- .../test_codesize_minimal_Oz-ctors.jssize | 2 +- .../codesize/test_codesize_minimal_Oz.gzsize | 2 +- .../codesize/test_codesize_minimal_Oz.jssize | 2 +- .../test_codesize_minimal_pthreads.gzsize | 2 +- .../test_codesize_minimal_pthreads.jssize | 2 +- .../codesize/test_codesize_minimal_wasmfs.gzsize | 2 +- .../codesize/test_codesize_minimal_wasmfs.jssize | 2 +- test/other/test_unoptimized_code_size.js.size | 2 +- test/other/test_unoptimized_code_size.wasm.size | 2 +- ...test_unoptimized_code_size_no_asserts.js.size | 2 +- ...st_unoptimized_code_size_no_asserts.wasm.size | 2 +- .../test_unoptimized_code_size_strict.js.size | 2 +- .../test_unoptimized_code_size_strict.wasm.size | 2 +- 132 files changed, 160 insertions(+), 228 deletions(-) diff --git a/test/code_size/embind_hello_wasm.json b/test/code_size/embind_hello_wasm.json index f3b1d73bc6bec..5a9cabb8f660d 100644 --- a/test/code_size/embind_hello_wasm.json +++ b/test/code_size/embind_hello_wasm.json @@ -1,10 +1,10 @@ { "a.html": 552, "a.html.gz": 380, - "a.js": 9718, - "a.js.gz": 4291, - "a.wasm": 7728, - "a.wasm.gz": 3502, - "total": 17998, - "total_gz": 8173 + "a.js": 10004, + "a.js.gz": 4348, + "a.wasm": 7591, + "a.wasm.gz": 3419, + "total": 18147, + "total_gz": 8147 } diff --git a/test/code_size/embind_val_wasm.json b/test/code_size/embind_val_wasm.json index 9af792edee31e..13d13e7eaeb85 100644 --- a/test/code_size/embind_val_wasm.json +++ b/test/code_size/embind_val_wasm.json @@ -1,10 +1,10 @@ { "a.html": 552, "a.html.gz": 380, - "a.js": 6849, - "a.js.gz": 2947, - "a.wasm": 9568, - "a.wasm.gz": 4911, - "total": 16969, - "total_gz": 8238 + "a.js": 7278, + "a.js.gz": 3084, + "a.wasm": 9471, + "a.wasm.gz": 4849, + "total": 17301, + "total_gz": 8313 } diff --git a/test/code_size/hello_webgl2_wasm.json b/test/code_size/hello_webgl2_wasm.json index bf14a6e1a53c9..c944949a29c8c 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": 4532, "a.js.gz": 2315, - "a.wasm": 10402, - "a.wasm.gz": 6704, - "total": 15388, - "total_gz": 9347 + "a.wasm": 10377, + "a.wasm.gz": 6694, + "total": 15363, + "total_gz": 9337 } diff --git a/test/code_size/hello_webgl2_wasm2js.json b/test/code_size/hello_webgl2_wasm2js.json index 88cc365f6f5f7..62c056051c215 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": 22200, - "a.js.gz": 11582, - "total": 22546, - "total_gz": 11844 + "a.js": 22232, + "a.js.gz": 11612, + "total": 22578, + "total_gz": 11874 } diff --git a/test/code_size/hello_webgl_wasm.json b/test/code_size/hello_webgl_wasm.json index b20428e2fed64..f9432eddd1985 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": 4070, "a.js.gz": 2158, - "a.wasm": 10402, - "a.wasm.gz": 6704, - "total": 14926, - "total_gz": 9190 + "a.wasm": 10377, + "a.wasm.gz": 6694, + "total": 14901, + "total_gz": 9180 } diff --git a/test/code_size/hello_webgl_wasm2js.json b/test/code_size/hello_webgl_wasm2js.json index bc0dfe84d64a8..01af46e9951c2 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": 21726, - "a.js.gz": 11415, - "total": 22072, - "total_gz": 11677 + "a.js": 21758, + "a.js.gz": 11442, + "total": 22104, + "total_gz": 11704 } diff --git a/test/code_size/random_printf_wasm.json b/test/code_size/random_printf_wasm.json index 8548e41737392..3b0a3c6494de1 100644 --- a/test/code_size/random_printf_wasm.json +++ b/test/code_size/random_printf_wasm.json @@ -1,6 +1,6 @@ { - "a.html": 12597, - "a.html.gz": 6882, - "total": 12597, - "total_gz": 6882 + "a.html": 12589, + "a.html.gz": 6888, + "total": 12589, + "total_gz": 6888 } diff --git a/test/code_size/random_printf_wasm2js.json b/test/code_size/random_printf_wasm2js.json index b3fe0c465524e..335e5aa2294d8 100644 --- a/test/code_size/random_printf_wasm2js.json +++ b/test/code_size/random_printf_wasm2js.json @@ -1,6 +1,6 @@ { - "a.html": 17195, - "a.html.gz": 7478, - "total": 17195, - "total_gz": 7478 + "a.html": 17246, + "a.html.gz": 7510, + "total": 17246, + "total_gz": 7510 } diff --git a/test/other/codesize/test_codesize_cxx_ctors1.exports b/test/other/codesize/test_codesize_cxx_ctors1.exports index 6fc972ce0131f..e8e129078e743 100644 --- a/test/other/codesize/test_codesize_cxx_ctors1.exports +++ b/test/other/codesize/test_codesize_cxx_ctors1.exports @@ -2,11 +2,6 @@ __indirect_function_table __wasm_call_ctors _emscripten_stack_alloc _emscripten_stack_restore -dynCall_iiiiiijj -dynCall_iiiiij -dynCall_iiiiijj -dynCall_jiji -dynCall_viijii emscripten_stack_get_current main memory diff --git a/test/other/codesize/test_codesize_cxx_ctors1.gzsize b/test/other/codesize/test_codesize_cxx_ctors1.gzsize index 7c6cfdff74039..b5b16ac6f2144 100644 --- a/test/other/codesize/test_codesize_cxx_ctors1.gzsize +++ b/test/other/codesize/test_codesize_cxx_ctors1.gzsize @@ -1 +1 @@ -8577 +8470 diff --git a/test/other/codesize/test_codesize_cxx_ctors1.jssize b/test/other/codesize/test_codesize_cxx_ctors1.jssize index 61dd2a4a752ed..050339bd21f9b 100644 --- a/test/other/codesize/test_codesize_cxx_ctors1.jssize +++ b/test/other/codesize/test_codesize_cxx_ctors1.jssize @@ -1 +1 @@ -20952 +20526 diff --git a/test/other/codesize/test_codesize_cxx_ctors1.size b/test/other/codesize/test_codesize_cxx_ctors1.size index 67d610a7db4b8..4aa00e9937466 100644 --- a/test/other/codesize/test_codesize_cxx_ctors1.size +++ b/test/other/codesize/test_codesize_cxx_ctors1.size @@ -1 +1 @@ -129276 +128644 diff --git a/test/other/codesize/test_codesize_cxx_ctors2.exports b/test/other/codesize/test_codesize_cxx_ctors2.exports index fdac55c82b471..5629d338fd12b 100644 --- a/test/other/codesize/test_codesize_cxx_ctors2.exports +++ b/test/other/codesize/test_codesize_cxx_ctors2.exports @@ -1,11 +1,6 @@ __indirect_function_table _emscripten_stack_alloc _emscripten_stack_restore -dynCall_iiiiiijj -dynCall_iiiiij -dynCall_iiiiijj -dynCall_jiji -dynCall_viijii emscripten_stack_get_current main memory diff --git a/test/other/codesize/test_codesize_cxx_ctors2.gzsize b/test/other/codesize/test_codesize_cxx_ctors2.gzsize index 5c5a56aa23907..d46d79a8d03ca 100644 --- a/test/other/codesize/test_codesize_cxx_ctors2.gzsize +++ b/test/other/codesize/test_codesize_cxx_ctors2.gzsize @@ -1 +1 @@ -8561 +8452 diff --git a/test/other/codesize/test_codesize_cxx_ctors2.jssize b/test/other/codesize/test_codesize_cxx_ctors2.jssize index 946332105fd69..ca19452f2c280 100644 --- a/test/other/codesize/test_codesize_cxx_ctors2.jssize +++ b/test/other/codesize/test_codesize_cxx_ctors2.jssize @@ -1 +1 @@ -20920 +20494 diff --git a/test/other/codesize/test_codesize_cxx_ctors2.size b/test/other/codesize/test_codesize_cxx_ctors2.size index 8649e524047b6..9cf53237f6728 100644 --- a/test/other/codesize/test_codesize_cxx_ctors2.size +++ b/test/other/codesize/test_codesize_cxx_ctors2.size @@ -1 +1 @@ -128722 +128056 diff --git a/test/other/codesize/test_codesize_cxx_except.exports b/test/other/codesize/test_codesize_cxx_except.exports index b6247248c84b6..4facc660ec841 100644 --- a/test/other/codesize/test_codesize_cxx_except.exports +++ b/test/other/codesize/test_codesize_cxx_except.exports @@ -8,12 +8,6 @@ __wasm_call_ctors _emscripten_stack_alloc _emscripten_stack_restore _emscripten_tempret_set -dynCall_iiiiiijj -dynCall_iiiiij -dynCall_iiiiijj -dynCall_jiiii -dynCall_jiji -dynCall_viijii emscripten_stack_get_current main memory diff --git a/test/other/codesize/test_codesize_cxx_except.gzsize b/test/other/codesize/test_codesize_cxx_except.gzsize index f4cac6ae1ed21..77b2671d0e923 100644 --- a/test/other/codesize/test_codesize_cxx_except.gzsize +++ b/test/other/codesize/test_codesize_cxx_except.gzsize @@ -1 +1 @@ -9610 +9485 diff --git a/test/other/codesize/test_codesize_cxx_except.jssize b/test/other/codesize/test_codesize_cxx_except.jssize index 1972d66211f85..4282901fea5ef 100644 --- a/test/other/codesize/test_codesize_cxx_except.jssize +++ b/test/other/codesize/test_codesize_cxx_except.jssize @@ -1 +1 @@ -24795 +24299 diff --git a/test/other/codesize/test_codesize_cxx_except.size b/test/other/codesize/test_codesize_cxx_except.size index 276e7d93de41a..f81453318a571 100644 --- a/test/other/codesize/test_codesize_cxx_except.size +++ b/test/other/codesize/test_codesize_cxx_except.size @@ -1 +1 @@ -171406 +170759 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm.exports b/test/other/codesize/test_codesize_cxx_except_wasm.exports index 5555bb2a116cb..85bf5bc4006e4 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm.exports +++ b/test/other/codesize/test_codesize_cxx_except_wasm.exports @@ -2,10 +2,5 @@ __indirect_function_table __trap __wasm_call_ctors _emscripten_stack_alloc -dynCall_iiiiiijj -dynCall_iiiiij -dynCall_iiiiijj -dynCall_jiji -dynCall_viijii main memory diff --git a/test/other/codesize/test_codesize_cxx_except_wasm.gzsize b/test/other/codesize/test_codesize_cxx_except_wasm.gzsize index addbd0d396de9..cabaab99ef56d 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm.gzsize +++ b/test/other/codesize/test_codesize_cxx_except_wasm.gzsize @@ -1 +1 @@ -8551 +8445 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm.jssize b/test/other/codesize/test_codesize_cxx_except_wasm.jssize index f1ed501dc449f..0c832bdf867f5 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm.jssize +++ b/test/other/codesize/test_codesize_cxx_except_wasm.jssize @@ -1 +1 @@ -20845 +20419 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm.size b/test/other/codesize/test_codesize_cxx_except_wasm.size index 0053d027ae5a6..7bd56f6759d43 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm.size +++ b/test/other/codesize/test_codesize_cxx_except_wasm.size @@ -1 +1 @@ -142526 +141968 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.exports b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.exports index 5555bb2a116cb..85bf5bc4006e4 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.exports +++ b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.exports @@ -2,10 +2,5 @@ __indirect_function_table __trap __wasm_call_ctors _emscripten_stack_alloc -dynCall_iiiiiijj -dynCall_iiiiij -dynCall_iiiiijj -dynCall_jiji -dynCall_viijii main memory 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 addbd0d396de9..cabaab99ef56d 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 @@ -8551 +8445 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 f1ed501dc449f..0c832bdf867f5 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 @@ -20845 +20419 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 1c842906f1e3e..f2f2eca762519 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 @@ -145113 +144555 diff --git a/test/other/codesize/test_codesize_cxx_lto.gzsize b/test/other/codesize/test_codesize_cxx_lto.gzsize index 1ff8b32916c6a..357af50996d0e 100644 --- a/test/other/codesize/test_codesize_cxx_lto.gzsize +++ b/test/other/codesize/test_codesize_cxx_lto.gzsize @@ -1 +1 @@ -8480 +8462 diff --git a/test/other/codesize/test_codesize_cxx_lto.imports b/test/other/codesize/test_codesize_cxx_lto.imports index e03564194ed36..9277703b69e4a 100644 --- a/test/other/codesize/test_codesize_cxx_lto.imports +++ b/test/other/codesize/test_codesize_cxx_lto.imports @@ -1,11 +1,11 @@ -a (fd_seek) -b (emscripten_resize_heap) -c (_tzset_js) -d (_setitimer_js) -e (_emscripten_runtime_keepalive_clear) -f (_abort_js) -g (proc_exit) -h (fd_write) +a (emscripten_resize_heap) +b (_tzset_js) +c (_setitimer_js) +d (_emscripten_runtime_keepalive_clear) +e (_abort_js) +f (proc_exit) +g (fd_write) +h (fd_seek) i (fd_read) j (fd_close) k (environ_sizes_get) diff --git a/test/other/codesize/test_codesize_cxx_lto.jssize b/test/other/codesize/test_codesize_cxx_lto.jssize index e9bde91a32c7d..1741101ef7544 100644 --- a/test/other/codesize/test_codesize_cxx_lto.jssize +++ b/test/other/codesize/test_codesize_cxx_lto.jssize @@ -1 +1 @@ -20531 +20549 diff --git a/test/other/codesize/test_codesize_cxx_lto.sent b/test/other/codesize/test_codesize_cxx_lto.sent index e03564194ed36..9277703b69e4a 100644 --- a/test/other/codesize/test_codesize_cxx_lto.sent +++ b/test/other/codesize/test_codesize_cxx_lto.sent @@ -1,11 +1,11 @@ -a (fd_seek) -b (emscripten_resize_heap) -c (_tzset_js) -d (_setitimer_js) -e (_emscripten_runtime_keepalive_clear) -f (_abort_js) -g (proc_exit) -h (fd_write) +a (emscripten_resize_heap) +b (_tzset_js) +c (_setitimer_js) +d (_emscripten_runtime_keepalive_clear) +e (_abort_js) +f (proc_exit) +g (fd_write) +h (fd_seek) i (fd_read) j (fd_close) k (environ_sizes_get) diff --git a/test/other/codesize/test_codesize_cxx_lto.size b/test/other/codesize/test_codesize_cxx_lto.size index f7d77bf63d1d7..e643e417d5bfe 100644 --- a/test/other/codesize/test_codesize_cxx_lto.size +++ b/test/other/codesize/test_codesize_cxx_lto.size @@ -1 +1 @@ -121985 +121840 diff --git a/test/other/codesize/test_codesize_cxx_mangle.exports b/test/other/codesize/test_codesize_cxx_mangle.exports index 973868ec0db1e..3dae240b66848 100644 --- a/test/other/codesize/test_codesize_cxx_mangle.exports +++ b/test/other/codesize/test_codesize_cxx_mangle.exports @@ -9,12 +9,6 @@ __wasm_call_ctors _emscripten_stack_alloc _emscripten_stack_restore _emscripten_tempret_set -dynCall_iiiiiijj -dynCall_iiiiij -dynCall_iiiiijj -dynCall_jiiii -dynCall_jiji -dynCall_viijii emscripten_stack_get_current free main diff --git a/test/other/codesize/test_codesize_cxx_mangle.gzsize b/test/other/codesize/test_codesize_cxx_mangle.gzsize index c14a51b4e8394..6ed3bb705547c 100644 --- a/test/other/codesize/test_codesize_cxx_mangle.gzsize +++ b/test/other/codesize/test_codesize_cxx_mangle.gzsize @@ -1 +1 @@ -9615 +9489 diff --git a/test/other/codesize/test_codesize_cxx_mangle.jssize b/test/other/codesize/test_codesize_cxx_mangle.jssize index 1972d66211f85..4282901fea5ef 100644 --- a/test/other/codesize/test_codesize_cxx_mangle.jssize +++ b/test/other/codesize/test_codesize_cxx_mangle.jssize @@ -1 +1 @@ -24795 +24299 diff --git a/test/other/codesize/test_codesize_cxx_mangle.size b/test/other/codesize/test_codesize_cxx_mangle.size index 234bba9899039..6f290e8c7cfa8 100644 --- a/test/other/codesize/test_codesize_cxx_mangle.size +++ b/test/other/codesize/test_codesize_cxx_mangle.size @@ -1 +1 @@ -232917 +232440 diff --git a/test/other/codesize/test_codesize_cxx_noexcept.exports b/test/other/codesize/test_codesize_cxx_noexcept.exports index 6fc972ce0131f..e8e129078e743 100644 --- a/test/other/codesize/test_codesize_cxx_noexcept.exports +++ b/test/other/codesize/test_codesize_cxx_noexcept.exports @@ -2,11 +2,6 @@ __indirect_function_table __wasm_call_ctors _emscripten_stack_alloc _emscripten_stack_restore -dynCall_iiiiiijj -dynCall_iiiiij -dynCall_iiiiijj -dynCall_jiji -dynCall_viijii emscripten_stack_get_current main memory diff --git a/test/other/codesize/test_codesize_cxx_noexcept.gzsize b/test/other/codesize/test_codesize_cxx_noexcept.gzsize index 7c6cfdff74039..b5b16ac6f2144 100644 --- a/test/other/codesize/test_codesize_cxx_noexcept.gzsize +++ b/test/other/codesize/test_codesize_cxx_noexcept.gzsize @@ -1 +1 @@ -8577 +8470 diff --git a/test/other/codesize/test_codesize_cxx_noexcept.jssize b/test/other/codesize/test_codesize_cxx_noexcept.jssize index 61dd2a4a752ed..050339bd21f9b 100644 --- a/test/other/codesize/test_codesize_cxx_noexcept.jssize +++ b/test/other/codesize/test_codesize_cxx_noexcept.jssize @@ -1 +1 @@ -20952 +20526 diff --git a/test/other/codesize/test_codesize_cxx_noexcept.size b/test/other/codesize/test_codesize_cxx_noexcept.size index 4357180d28887..5c7bd8fc3fd6d 100644 --- a/test/other/codesize/test_codesize_cxx_noexcept.size +++ b/test/other/codesize/test_codesize_cxx_noexcept.size @@ -1 +1 @@ -132083 +131455 diff --git a/test/other/codesize/test_codesize_cxx_wasmfs.exports b/test/other/codesize/test_codesize_cxx_wasmfs.exports index 748b987551d8c..e8e129078e743 100644 --- a/test/other/codesize/test_codesize_cxx_wasmfs.exports +++ b/test/other/codesize/test_codesize_cxx_wasmfs.exports @@ -2,14 +2,6 @@ __indirect_function_table __wasm_call_ctors _emscripten_stack_alloc _emscripten_stack_restore -dynCall_iiiiiijj -dynCall_iiiiij -dynCall_iiiiijj -dynCall_iiiij -dynCall_iij -dynCall_ji -dynCall_jiji -dynCall_viijii emscripten_stack_get_current main memory diff --git a/test/other/codesize/test_codesize_cxx_wasmfs.gzsize b/test/other/codesize/test_codesize_cxx_wasmfs.gzsize index 8b6eff0e70854..759c1bab00a53 100644 --- a/test/other/codesize/test_codesize_cxx_wasmfs.gzsize +++ b/test/other/codesize/test_codesize_cxx_wasmfs.gzsize @@ -1 +1 @@ -3887 +3774 diff --git a/test/other/codesize/test_codesize_cxx_wasmfs.jssize b/test/other/codesize/test_codesize_cxx_wasmfs.jssize index 4e605f38b5b82..e236f1b03e3ec 100644 --- a/test/other/codesize/test_codesize_cxx_wasmfs.jssize +++ b/test/other/codesize/test_codesize_cxx_wasmfs.jssize @@ -1 +1 @@ -8687 +8103 diff --git a/test/other/codesize/test_codesize_cxx_wasmfs.size b/test/other/codesize/test_codesize_cxx_wasmfs.size index 206a908899546..ce4d428b5a682 100644 --- a/test/other/codesize/test_codesize_cxx_wasmfs.size +++ b/test/other/codesize/test_codesize_cxx_wasmfs.size @@ -1 +1 @@ -169526 +168682 diff --git a/test/other/codesize/test_codesize_files_js_fs.gzsize b/test/other/codesize/test_codesize_files_js_fs.gzsize index 5bfda2af7c553..414f2ba5b8205 100644 --- a/test/other/codesize/test_codesize_files_js_fs.gzsize +++ b/test/other/codesize/test_codesize_files_js_fs.gzsize @@ -1 +1 @@ -7717 +7771 diff --git a/test/other/codesize/test_codesize_files_js_fs.jssize b/test/other/codesize/test_codesize_files_js_fs.jssize index b132bf3ee0efe..3fe454fdc85fc 100644 --- a/test/other/codesize/test_codesize_files_js_fs.jssize +++ b/test/other/codesize/test_codesize_files_js_fs.jssize @@ -1 +1 @@ -18861 +19020 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 9870e4a2f07e9..bf2403c4da4e9 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.gzsize +++ b/test/other/codesize/test_codesize_files_wasmfs.gzsize @@ -1 +1 @@ -2984 +2983 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.jssize b/test/other/codesize/test_codesize_files_wasmfs.jssize index 8c77918b2ffbe..394a86d56efde 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.jssize +++ b/test/other/codesize/test_codesize_files_wasmfs.jssize @@ -1 +1 @@ -6324 +6354 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/other/codesize/test_codesize_files_wasmfs.size b/test/other/codesize/test_codesize_files_wasmfs.size index 8dbc1b508195f..00543b3195e2e 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.size +++ b/test/other/codesize/test_codesize_files_wasmfs.size @@ -1 +1 @@ -51157 +49892 diff --git a/test/other/codesize/test_codesize_hello_O0.exports b/test/other/codesize/test_codesize_hello_O0.exports index 46f6d0a6df26a..430c7650c243b 100644 --- a/test/other/codesize/test_codesize_hello_O0.exports +++ b/test/other/codesize/test_codesize_hello_O0.exports @@ -2,7 +2,6 @@ __indirect_function_table __wasm_call_ctors _emscripten_stack_alloc _emscripten_stack_restore -dynCall_jiji emscripten_stack_get_base emscripten_stack_get_current emscripten_stack_get_end diff --git a/test/other/codesize/test_codesize_hello_O0.funcs b/test/other/codesize/test_codesize_hello_O0.funcs index 7b3556720ebea..a1ff7c64739d8 100644 --- a/test/other/codesize/test_codesize_hello_O0.funcs +++ b/test/other/codesize/test_codesize_hello_O0.funcs @@ -25,9 +25,6 @@ $__wasi_syscall_ret $__wasm_call_ctors $_emscripten_stack_alloc $_emscripten_stack_restore -$_emscripten_tempret_get -$_emscripten_tempret_set -$dynCall_jiji $emscripten_stack_get_base $emscripten_stack_get_current $emscripten_stack_get_end @@ -42,7 +39,6 @@ $frexp $getint $getpid $init_pthread_self -$legalstub$dynCall_jiji $main $memchr $out diff --git a/test/other/codesize/test_codesize_hello_O0.gzsize b/test/other/codesize/test_codesize_hello_O0.gzsize index 052dc9241b3db..64595bbb74d9a 100644 --- a/test/other/codesize/test_codesize_hello_O0.gzsize +++ b/test/other/codesize/test_codesize_hello_O0.gzsize @@ -1 +1 @@ -8042 +8054 diff --git a/test/other/codesize/test_codesize_hello_O0.jssize b/test/other/codesize/test_codesize_hello_O0.jssize index 1f1ac91c270cf..930f0b8c8e2b3 100644 --- a/test/other/codesize/test_codesize_hello_O0.jssize +++ b/test/other/codesize/test_codesize_hello_O0.jssize @@ -1 +1 @@ -21457 +21519 diff --git a/test/other/codesize/test_codesize_hello_O0.size b/test/other/codesize/test_codesize_hello_O0.size index b55e8eb4cd221..04ebd2121f042 100644 --- a/test/other/codesize/test_codesize_hello_O0.size +++ b/test/other/codesize/test_codesize_hello_O0.size @@ -1 +1 @@ -14531 +15163 diff --git a/test/other/codesize/test_codesize_hello_O1.exports b/test/other/codesize/test_codesize_hello_O1.exports index 4f4b6313b5239..e8e129078e743 100644 --- a/test/other/codesize/test_codesize_hello_O1.exports +++ b/test/other/codesize/test_codesize_hello_O1.exports @@ -2,7 +2,6 @@ __indirect_function_table __wasm_call_ctors _emscripten_stack_alloc _emscripten_stack_restore -dynCall_jiji emscripten_stack_get_current main memory diff --git a/test/other/codesize/test_codesize_hello_O1.funcs b/test/other/codesize/test_codesize_hello_O1.funcs index f5073582b3f40..68623ee907e22 100644 --- a/test/other/codesize/test_codesize_hello_O1.funcs +++ b/test/other/codesize/test_codesize_hello_O1.funcs @@ -13,13 +13,9 @@ $__wasi_syscall_ret $__wasm_call_ctors $_emscripten_stack_alloc $_emscripten_stack_restore -$_emscripten_tempret_get -$_emscripten_tempret_set -$dynCall_jiji $emscripten_stack_get_current $fputs $fwrite -$legalstub$dynCall_jiji $main $puts $strlen diff --git a/test/other/codesize/test_codesize_hello_O1.gzsize b/test/other/codesize/test_codesize_hello_O1.gzsize index c1fe14e0295ce..9fe34ed6cff3e 100644 --- a/test/other/codesize/test_codesize_hello_O1.gzsize +++ b/test/other/codesize/test_codesize_hello_O1.gzsize @@ -1 +1 @@ -2818 +2804 diff --git a/test/other/codesize/test_codesize_hello_O1.jssize b/test/other/codesize/test_codesize_hello_O1.jssize index 68df7255b64b5..15a5a2a538976 100644 --- a/test/other/codesize/test_codesize_hello_O1.jssize +++ b/test/other/codesize/test_codesize_hello_O1.jssize @@ -1 +1 @@ -7080 +7066 diff --git a/test/other/codesize/test_codesize_hello_O1.size b/test/other/codesize/test_codesize_hello_O1.size index 48c6e93066ff9..4cbaed0a9e906 100644 --- a/test/other/codesize/test_codesize_hello_O1.size +++ b/test/other/codesize/test_codesize_hello_O1.size @@ -1 +1 @@ -2535 +2651 diff --git a/test/other/codesize/test_codesize_hello_O2.exports b/test/other/codesize/test_codesize_hello_O2.exports index 4f4b6313b5239..e8e129078e743 100644 --- a/test/other/codesize/test_codesize_hello_O2.exports +++ b/test/other/codesize/test_codesize_hello_O2.exports @@ -2,7 +2,6 @@ __indirect_function_table __wasm_call_ctors _emscripten_stack_alloc _emscripten_stack_restore -dynCall_jiji emscripten_stack_get_current main memory diff --git a/test/other/codesize/test_codesize_hello_O2.funcs b/test/other/codesize/test_codesize_hello_O2.funcs index a16df54d7de2c..2206a46aa8d98 100644 --- a/test/other/codesize/test_codesize_hello_O2.funcs +++ b/test/other/codesize/test_codesize_hello_O2.funcs @@ -8,5 +8,4 @@ $__wasm_call_ctors $_emscripten_stack_alloc $_emscripten_stack_restore $emscripten_stack_get_current -$legalstub$dynCall_jiji $main diff --git a/test/other/codesize/test_codesize_hello_O2.gzsize b/test/other/codesize/test_codesize_hello_O2.gzsize index 59780dc7b1e42..af426b209e493 100644 --- a/test/other/codesize/test_codesize_hello_O2.gzsize +++ b/test/other/codesize/test_codesize_hello_O2.gzsize @@ -1 +1 @@ -2492 +2479 diff --git a/test/other/codesize/test_codesize_hello_O2.jssize b/test/other/codesize/test_codesize_hello_O2.jssize index 08400af305374..02a304696e025 100644 --- a/test/other/codesize/test_codesize_hello_O2.jssize +++ b/test/other/codesize/test_codesize_hello_O2.jssize @@ -1 +1 @@ -5032 +5019 diff --git a/test/other/codesize/test_codesize_hello_O2.size b/test/other/codesize/test_codesize_hello_O2.size index b6ac305674cf9..d644427299908 100644 --- a/test/other/codesize/test_codesize_hello_O2.size +++ b/test/other/codesize/test_codesize_hello_O2.size @@ -1 +1 @@ -2047 +1999 diff --git a/test/other/codesize/test_codesize_hello_O3.gzsize b/test/other/codesize/test_codesize_hello_O3.gzsize index 1475ea901925a..3244ffd4e2090 100644 --- a/test/other/codesize/test_codesize_hello_O3.gzsize +++ b/test/other/codesize/test_codesize_hello_O3.gzsize @@ -1 +1 @@ -2404 +2419 diff --git a/test/other/codesize/test_codesize_hello_O3.jssize b/test/other/codesize/test_codesize_hello_O3.jssize index 94166f8c0392a..73e75f38e9717 100644 --- a/test/other/codesize/test_codesize_hello_O3.jssize +++ b/test/other/codesize/test_codesize_hello_O3.jssize @@ -1 +1 @@ -4878 +4940 diff --git a/test/other/codesize/test_codesize_hello_Os.gzsize b/test/other/codesize/test_codesize_hello_Os.gzsize index 1475ea901925a..3244ffd4e2090 100644 --- a/test/other/codesize/test_codesize_hello_Os.gzsize +++ b/test/other/codesize/test_codesize_hello_Os.gzsize @@ -1 +1 @@ -2404 +2419 diff --git a/test/other/codesize/test_codesize_hello_Os.jssize b/test/other/codesize/test_codesize_hello_Os.jssize index 94166f8c0392a..73e75f38e9717 100644 --- a/test/other/codesize/test_codesize_hello_Os.jssize +++ b/test/other/codesize/test_codesize_hello_Os.jssize @@ -1 +1 @@ -4878 +4940 diff --git a/test/other/codesize/test_codesize_hello_Oz.gzsize b/test/other/codesize/test_codesize_hello_Oz.gzsize index 1b4f1c3480a9e..65b7a7f809ae5 100644 --- a/test/other/codesize/test_codesize_hello_Oz.gzsize +++ b/test/other/codesize/test_codesize_hello_Oz.gzsize @@ -1 +1 @@ -2386 +2402 diff --git a/test/other/codesize/test_codesize_hello_Oz.jssize b/test/other/codesize/test_codesize_hello_Oz.jssize index b226a38b01177..420aeb9accfa4 100644 --- a/test/other/codesize/test_codesize_hello_Oz.jssize +++ b/test/other/codesize/test_codesize_hello_Oz.jssize @@ -1 +1 @@ -4845 +4907 diff --git a/test/other/codesize/test_codesize_hello_dylink.exports b/test/other/codesize/test_codesize_hello_dylink.exports index f1e9af5fcfbf2..99ba54eca755a 100644 --- a/test/other/codesize/test_codesize_hello_dylink.exports +++ b/test/other/codesize/test_codesize_hello_dylink.exports @@ -3,7 +3,6 @@ __wasm_call_ctors _emscripten_stack_alloc _emscripten_stack_restore calloc -dynCall_jiji emscripten_stack_get_current main setThrew diff --git a/test/other/codesize/test_codesize_hello_dylink.funcs b/test/other/codesize/test_codesize_hello_dylink.funcs index 2c23b988a7191..cfe13ffbf5f19 100644 --- a/test/other/codesize/test_codesize_hello_dylink.funcs +++ b/test/other/codesize/test_codesize_hello_dylink.funcs @@ -10,7 +10,6 @@ $_emscripten_stack_alloc $_emscripten_stack_restore $dlcalloc $emscripten_stack_get_current -$legalstub$dynCall_jiji $main $sbrk $setThrew diff --git a/test/other/codesize/test_codesize_hello_dylink.gzsize b/test/other/codesize/test_codesize_hello_dylink.gzsize index dcea0b8b886f4..fd5a2c9300cbd 100644 --- a/test/other/codesize/test_codesize_hello_dylink.gzsize +++ b/test/other/codesize/test_codesize_hello_dylink.gzsize @@ -1 +1 @@ -6294 +6162 diff --git a/test/other/codesize/test_codesize_hello_dylink.jssize b/test/other/codesize/test_codesize_hello_dylink.jssize index 180ee9baf7ffc..2767a6015c830 100644 --- a/test/other/codesize/test_codesize_hello_dylink.jssize +++ b/test/other/codesize/test_codesize_hello_dylink.jssize @@ -1 +1 @@ -13863 +13548 diff --git a/test/other/codesize/test_codesize_hello_dylink.size b/test/other/codesize/test_codesize_hello_dylink.size index a30e08ecfada3..e95ec6103f385 100644 --- a/test/other/codesize/test_codesize_hello_dylink.size +++ b/test/other/codesize/test_codesize_hello_dylink.size @@ -1 +1 @@ -9784 +9736 diff --git a/test/other/codesize/test_codesize_hello_export_nothing.gzsize b/test/other/codesize/test_codesize_hello_export_nothing.gzsize index 4f5ed40394465..3bc34dd48c47f 100644 --- a/test/other/codesize/test_codesize_hello_export_nothing.gzsize +++ b/test/other/codesize/test_codesize_hello_export_nothing.gzsize @@ -1 +1 @@ -1763 +1778 diff --git a/test/other/codesize/test_codesize_hello_export_nothing.jssize b/test/other/codesize/test_codesize_hello_export_nothing.jssize index a30e882a02394..7593b8931a87e 100644 --- a/test/other/codesize/test_codesize_hello_export_nothing.jssize +++ b/test/other/codesize/test_codesize_hello_export_nothing.jssize @@ -1 +1 @@ -3732 +3794 diff --git a/test/other/codesize/test_codesize_hello_wasmfs.gzsize b/test/other/codesize/test_codesize_hello_wasmfs.gzsize index 1475ea901925a..3244ffd4e2090 100644 --- a/test/other/codesize/test_codesize_hello_wasmfs.gzsize +++ b/test/other/codesize/test_codesize_hello_wasmfs.gzsize @@ -1 +1 @@ -2404 +2419 diff --git a/test/other/codesize/test_codesize_hello_wasmfs.jssize b/test/other/codesize/test_codesize_hello_wasmfs.jssize index 94166f8c0392a..73e75f38e9717 100644 --- a/test/other/codesize/test_codesize_hello_wasmfs.jssize +++ b/test/other/codesize/test_codesize_hello_wasmfs.jssize @@ -1 +1 @@ -4878 +4940 diff --git a/test/other/codesize/test_codesize_libcxxabi_message_O3.gzsize b/test/other/codesize/test_codesize_libcxxabi_message_O3.gzsize index ec3cc3d4023f1..568aaf43d83b2 100644 --- a/test/other/codesize/test_codesize_libcxxabi_message_O3.gzsize +++ b/test/other/codesize/test_codesize_libcxxabi_message_O3.gzsize @@ -1 +1 @@ -1969 +1984 diff --git a/test/other/codesize/test_codesize_libcxxabi_message_O3.jssize b/test/other/codesize/test_codesize_libcxxabi_message_O3.jssize index b055ba9e6e1c9..5045e5c2af3dc 100644 --- a/test/other/codesize/test_codesize_libcxxabi_message_O3.jssize +++ b/test/other/codesize/test_codesize_libcxxabi_message_O3.jssize @@ -1 +1 @@ -4109 +4171 diff --git a/test/other/codesize/test_codesize_libcxxabi_message_O3_standalone.gzsize b/test/other/codesize/test_codesize_libcxxabi_message_O3_standalone.gzsize index 8bd1af11bf283..9b3c23668cb43 100644 --- a/test/other/codesize/test_codesize_libcxxabi_message_O3_standalone.gzsize +++ b/test/other/codesize/test_codesize_libcxxabi_message_O3_standalone.gzsize @@ -1 +1 @@ -2000 +2015 diff --git a/test/other/codesize/test_codesize_libcxxabi_message_O3_standalone.jssize b/test/other/codesize/test_codesize_libcxxabi_message_O3_standalone.jssize index 694d7725287cb..31a1f807b4325 100644 --- a/test/other/codesize/test_codesize_libcxxabi_message_O3_standalone.jssize +++ b/test/other/codesize/test_codesize_libcxxabi_message_O3_standalone.jssize @@ -1 +1 @@ -4156 +4218 diff --git a/test/other/codesize/test_codesize_mem_O3.gzsize b/test/other/codesize/test_codesize_mem_O3.gzsize index 633e99ca46b94..5e33b0d47bda0 100644 --- a/test/other/codesize/test_codesize_mem_O3.gzsize +++ b/test/other/codesize/test_codesize_mem_O3.gzsize @@ -1 +1 @@ -2427 +2442 diff --git a/test/other/codesize/test_codesize_mem_O3.jssize b/test/other/codesize/test_codesize_mem_O3.jssize index 27f45130113cd..e792794d96133 100644 --- a/test/other/codesize/test_codesize_mem_O3.jssize +++ b/test/other/codesize/test_codesize_mem_O3.jssize @@ -1 +1 @@ -5020 +5082 diff --git a/test/other/codesize/test_codesize_mem_O3_grow.gzsize b/test/other/codesize/test_codesize_mem_O3_grow.gzsize index 58923f84404f7..c8ed3a2c9cfbe 100644 --- a/test/other/codesize/test_codesize_mem_O3_grow.gzsize +++ b/test/other/codesize/test_codesize_mem_O3_grow.gzsize @@ -1 +1 @@ -2571 +2587 diff --git a/test/other/codesize/test_codesize_mem_O3_grow.jssize b/test/other/codesize/test_codesize_mem_O3_grow.jssize index 0211f87ad8a6c..0dd296e9adb3f 100644 --- a/test/other/codesize/test_codesize_mem_O3_grow.jssize +++ b/test/other/codesize/test_codesize_mem_O3_grow.jssize @@ -1 +1 @@ -5302 +5365 diff --git a/test/other/codesize/test_codesize_mem_O3_grow_standalone.gzsize b/test/other/codesize/test_codesize_mem_O3_grow_standalone.gzsize index edf372fd24bbb..cc6f0ac7ecffd 100644 --- a/test/other/codesize/test_codesize_mem_O3_grow_standalone.gzsize +++ b/test/other/codesize/test_codesize_mem_O3_grow_standalone.gzsize @@ -1 +1 @@ -2266 +2283 diff --git a/test/other/codesize/test_codesize_mem_O3_grow_standalone.jssize b/test/other/codesize/test_codesize_mem_O3_grow_standalone.jssize index de4ba040ae5f1..307363083cc82 100644 --- a/test/other/codesize/test_codesize_mem_O3_grow_standalone.jssize +++ b/test/other/codesize/test_codesize_mem_O3_grow_standalone.jssize @@ -1 +1 @@ -4710 +4773 diff --git a/test/other/codesize/test_codesize_mem_O3_standalone.gzsize b/test/other/codesize/test_codesize_mem_O3_standalone.gzsize index 0e4a28666b93f..db88a8627f447 100644 --- a/test/other/codesize/test_codesize_mem_O3_standalone.gzsize +++ b/test/other/codesize/test_codesize_mem_O3_standalone.gzsize @@ -1 +1 @@ -2235 +2250 diff --git a/test/other/codesize/test_codesize_mem_O3_standalone.jssize b/test/other/codesize/test_codesize_mem_O3_standalone.jssize index f201ebe0c4417..b698f5e622c21 100644 --- a/test/other/codesize/test_codesize_mem_O3_standalone.jssize +++ b/test/other/codesize/test_codesize_mem_O3_standalone.jssize @@ -1 +1 @@ -4640 +4702 diff --git a/test/other/codesize/test_codesize_mem_O3_standalone_lib.gzsize b/test/other/codesize/test_codesize_mem_O3_standalone_lib.gzsize index ef0a2ad63226b..9eeb3efb08d7d 100644 --- a/test/other/codesize/test_codesize_mem_O3_standalone_lib.gzsize +++ b/test/other/codesize/test_codesize_mem_O3_standalone_lib.gzsize @@ -1 +1 @@ -1987 +2004 diff --git a/test/other/codesize/test_codesize_mem_O3_standalone_lib.jssize b/test/other/codesize/test_codesize_mem_O3_standalone_lib.jssize index c1a5f9617ccae..2a6bd4b524e61 100644 --- a/test/other/codesize/test_codesize_mem_O3_standalone_lib.jssize +++ b/test/other/codesize/test_codesize_mem_O3_standalone_lib.jssize @@ -1 +1 @@ -4160 +4222 diff --git a/test/other/codesize/test_codesize_mem_O3_standalone_narg.gzsize b/test/other/codesize/test_codesize_mem_O3_standalone_narg.gzsize index 8bd1af11bf283..9b3c23668cb43 100644 --- a/test/other/codesize/test_codesize_mem_O3_standalone_narg.gzsize +++ b/test/other/codesize/test_codesize_mem_O3_standalone_narg.gzsize @@ -1 +1 @@ -2000 +2015 diff --git a/test/other/codesize/test_codesize_mem_O3_standalone_narg.jssize b/test/other/codesize/test_codesize_mem_O3_standalone_narg.jssize index 694d7725287cb..31a1f807b4325 100644 --- a/test/other/codesize/test_codesize_mem_O3_standalone_narg.jssize +++ b/test/other/codesize/test_codesize_mem_O3_standalone_narg.jssize @@ -1 +1 @@ -4156 +4218 diff --git a/test/other/codesize/test_codesize_mem_O3_standalone_narg_flto.gzsize b/test/other/codesize/test_codesize_mem_O3_standalone_narg_flto.gzsize index 8bd1af11bf283..9b3c23668cb43 100644 --- a/test/other/codesize/test_codesize_mem_O3_standalone_narg_flto.gzsize +++ b/test/other/codesize/test_codesize_mem_O3_standalone_narg_flto.gzsize @@ -1 +1 @@ -2000 +2015 diff --git a/test/other/codesize/test_codesize_mem_O3_standalone_narg_flto.jssize b/test/other/codesize/test_codesize_mem_O3_standalone_narg_flto.jssize index 694d7725287cb..31a1f807b4325 100644 --- a/test/other/codesize/test_codesize_mem_O3_standalone_narg_flto.jssize +++ b/test/other/codesize/test_codesize_mem_O3_standalone_narg_flto.jssize @@ -1 +1 @@ -4156 +4218 diff --git a/test/other/codesize/test_codesize_minimal_O0.funcs b/test/other/codesize/test_codesize_minimal_O0.funcs index c5eb625aa803c..2b87bdddf10b9 100644 --- a/test/other/codesize/test_codesize_minimal_O0.funcs +++ b/test/other/codesize/test_codesize_minimal_O0.funcs @@ -7,8 +7,6 @@ $__unlockfile $__wasm_call_ctors $_emscripten_stack_alloc $_emscripten_stack_restore -$_emscripten_tempret_get -$_emscripten_tempret_set $add $emscripten_stack_get_base $emscripten_stack_get_current diff --git a/test/other/codesize/test_codesize_minimal_O0.gzsize b/test/other/codesize/test_codesize_minimal_O0.gzsize index 26d97f396bfab..51c4148133cf9 100644 --- a/test/other/codesize/test_codesize_minimal_O0.gzsize +++ b/test/other/codesize/test_codesize_minimal_O0.gzsize @@ -1 +1 @@ -6571 +6593 diff --git a/test/other/codesize/test_codesize_minimal_O0.jssize b/test/other/codesize/test_codesize_minimal_O0.jssize index 4705c7d0c2aad..d8bd5c715c198 100644 --- a/test/other/codesize/test_codesize_minimal_O0.jssize +++ b/test/other/codesize/test_codesize_minimal_O0.jssize @@ -1 +1 @@ -17606 +17684 diff --git a/test/other/codesize/test_codesize_minimal_O0.size b/test/other/codesize/test_codesize_minimal_O0.size index 37cdd416f157a..1afd47a2198fe 100644 --- a/test/other/codesize/test_codesize_minimal_O0.size +++ b/test/other/codesize/test_codesize_minimal_O0.size @@ -1 +1 @@ -975 +1121 diff --git a/test/other/codesize/test_codesize_minimal_O1.funcs b/test/other/codesize/test_codesize_minimal_O1.funcs index 891bb2f267dcb..819f7d5bf2b03 100644 --- a/test/other/codesize/test_codesize_minimal_O1.funcs +++ b/test/other/codesize/test_codesize_minimal_O1.funcs @@ -1,7 +1,5 @@ $__wasm_call_ctors $_emscripten_stack_alloc $_emscripten_stack_restore -$_emscripten_tempret_get -$_emscripten_tempret_set $add $emscripten_stack_get_current diff --git a/test/other/codesize/test_codesize_minimal_O1.gzsize b/test/other/codesize/test_codesize_minimal_O1.gzsize index f70509d547b9a..7e73f8fffa5b9 100644 --- a/test/other/codesize/test_codesize_minimal_O1.gzsize +++ b/test/other/codesize/test_codesize_minimal_O1.gzsize @@ -1 +1 @@ -1601 +1611 diff --git a/test/other/codesize/test_codesize_minimal_O1.jssize b/test/other/codesize/test_codesize_minimal_O1.jssize index ff743c815089f..54358f613df3e 100644 --- a/test/other/codesize/test_codesize_minimal_O1.jssize +++ b/test/other/codesize/test_codesize_minimal_O1.jssize @@ -1 +1 @@ -3795 +3848 diff --git a/test/other/codesize/test_codesize_minimal_O1.size b/test/other/codesize/test_codesize_minimal_O1.size index 100000a67875f..d1b9f6a9c4b4d 100644 --- a/test/other/codesize/test_codesize_minimal_O1.size +++ b/test/other/codesize/test_codesize_minimal_O1.size @@ -1 +1 @@ -376 +414 diff --git a/test/other/codesize/test_codesize_minimal_O2.gzsize b/test/other/codesize/test_codesize_minimal_O2.gzsize index 4b7816b5720e5..ac48d993bb8a5 100644 --- a/test/other/codesize/test_codesize_minimal_O2.gzsize +++ b/test/other/codesize/test_codesize_minimal_O2.gzsize @@ -1 +1 @@ -1452 +1462 diff --git a/test/other/codesize/test_codesize_minimal_O2.jssize b/test/other/codesize/test_codesize_minimal_O2.jssize index a8eeb4fcda930..5bbb2965b5797 100644 --- a/test/other/codesize/test_codesize_minimal_O2.jssize +++ b/test/other/codesize/test_codesize_minimal_O2.jssize @@ -1 +1 @@ -2893 +2936 diff --git a/test/other/codesize/test_codesize_minimal_O3.gzsize b/test/other/codesize/test_codesize_minimal_O3.gzsize index b03a71123e693..b322e68302d81 100644 --- a/test/other/codesize/test_codesize_minimal_O3.gzsize +++ b/test/other/codesize/test_codesize_minimal_O3.gzsize @@ -1 +1 @@ -1416 +1427 diff --git a/test/other/codesize/test_codesize_minimal_O3.jssize b/test/other/codesize/test_codesize_minimal_O3.jssize index 4f552a2c600bc..88236a9a64dbd 100644 --- a/test/other/codesize/test_codesize_minimal_O3.jssize +++ b/test/other/codesize/test_codesize_minimal_O3.jssize @@ -1 +1 @@ -2843 +2886 diff --git a/test/other/codesize/test_codesize_minimal_Os.gzsize b/test/other/codesize/test_codesize_minimal_Os.gzsize index b03a71123e693..b322e68302d81 100644 --- a/test/other/codesize/test_codesize_minimal_Os.gzsize +++ b/test/other/codesize/test_codesize_minimal_Os.gzsize @@ -1 +1 @@ -1416 +1427 diff --git a/test/other/codesize/test_codesize_minimal_Os.jssize b/test/other/codesize/test_codesize_minimal_Os.jssize index 4f552a2c600bc..88236a9a64dbd 100644 --- a/test/other/codesize/test_codesize_minimal_Os.jssize +++ b/test/other/codesize/test_codesize_minimal_Os.jssize @@ -1 +1 @@ -2843 +2886 diff --git a/test/other/codesize/test_codesize_minimal_Os_mr.gzsize b/test/other/codesize/test_codesize_minimal_Os_mr.gzsize index 6d26270b57e67..4438e30535f75 100644 --- a/test/other/codesize/test_codesize_minimal_Os_mr.gzsize +++ b/test/other/codesize/test_codesize_minimal_Os_mr.gzsize @@ -1 +1 @@ -283 +293 diff --git a/test/other/codesize/test_codesize_minimal_Os_mr.jssize b/test/other/codesize/test_codesize_minimal_Os_mr.jssize index ed4f162019058..5f3bb9813eade 100644 --- a/test/other/codesize/test_codesize_minimal_Os_mr.jssize +++ b/test/other/codesize/test_codesize_minimal_Os_mr.jssize @@ -1 +1 @@ -431 +474 diff --git a/test/other/codesize/test_codesize_minimal_Oz-ctors.gzsize b/test/other/codesize/test_codesize_minimal_Oz-ctors.gzsize index a11d586ce91d1..06cf2f9c460e0 100644 --- a/test/other/codesize/test_codesize_minimal_Oz-ctors.gzsize +++ b/test/other/codesize/test_codesize_minimal_Oz-ctors.gzsize @@ -1 +1 @@ -1407 +1417 diff --git a/test/other/codesize/test_codesize_minimal_Oz-ctors.jssize b/test/other/codesize/test_codesize_minimal_Oz-ctors.jssize index 45c22531f7d6c..8afc5d50c386e 100644 --- a/test/other/codesize/test_codesize_minimal_Oz-ctors.jssize +++ b/test/other/codesize/test_codesize_minimal_Oz-ctors.jssize @@ -1 +1 @@ -2828 +2871 diff --git a/test/other/codesize/test_codesize_minimal_Oz.gzsize b/test/other/codesize/test_codesize_minimal_Oz.gzsize index b03a71123e693..b322e68302d81 100644 --- a/test/other/codesize/test_codesize_minimal_Oz.gzsize +++ b/test/other/codesize/test_codesize_minimal_Oz.gzsize @@ -1 +1 @@ -1416 +1427 diff --git a/test/other/codesize/test_codesize_minimal_Oz.jssize b/test/other/codesize/test_codesize_minimal_Oz.jssize index 4f552a2c600bc..88236a9a64dbd 100644 --- a/test/other/codesize/test_codesize_minimal_Oz.jssize +++ b/test/other/codesize/test_codesize_minimal_Oz.jssize @@ -1 +1 @@ -2843 +2886 diff --git a/test/other/codesize/test_codesize_minimal_pthreads.gzsize b/test/other/codesize/test_codesize_minimal_pthreads.gzsize index 0f12704884a5d..74d3cdf25b782 100644 --- a/test/other/codesize/test_codesize_minimal_pthreads.gzsize +++ b/test/other/codesize/test_codesize_minimal_pthreads.gzsize @@ -1 +1 @@ -4208 +4275 diff --git a/test/other/codesize/test_codesize_minimal_pthreads.jssize b/test/other/codesize/test_codesize_minimal_pthreads.jssize index db6dfb1df8651..4614177a98ee6 100644 --- a/test/other/codesize/test_codesize_minimal_pthreads.jssize +++ b/test/other/codesize/test_codesize_minimal_pthreads.jssize @@ -1 +1 @@ -8703 +8858 diff --git a/test/other/codesize/test_codesize_minimal_wasmfs.gzsize b/test/other/codesize/test_codesize_minimal_wasmfs.gzsize index b03a71123e693..b322e68302d81 100644 --- a/test/other/codesize/test_codesize_minimal_wasmfs.gzsize +++ b/test/other/codesize/test_codesize_minimal_wasmfs.gzsize @@ -1 +1 @@ -1416 +1427 diff --git a/test/other/codesize/test_codesize_minimal_wasmfs.jssize b/test/other/codesize/test_codesize_minimal_wasmfs.jssize index 4f552a2c600bc..88236a9a64dbd 100644 --- a/test/other/codesize/test_codesize_minimal_wasmfs.jssize +++ b/test/other/codesize/test_codesize_minimal_wasmfs.jssize @@ -1 +1 @@ -2843 +2886 diff --git a/test/other/test_unoptimized_code_size.js.size b/test/other/test_unoptimized_code_size.js.size index 48f4d8dcae999..3c2a258e8c4b1 100644 --- a/test/other/test_unoptimized_code_size.js.size +++ b/test/other/test_unoptimized_code_size.js.size @@ -1 +1 @@ -54928 +55085 diff --git a/test/other/test_unoptimized_code_size.wasm.size b/test/other/test_unoptimized_code_size.wasm.size index b55e8eb4cd221..04ebd2121f042 100644 --- a/test/other/test_unoptimized_code_size.wasm.size +++ b/test/other/test_unoptimized_code_size.wasm.size @@ -1 +1 @@ -14531 +15163 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 3926438285887..70bb7b4360bb7 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 @@ -30574 +30621 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..eaf3650a32420 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 +12244 diff --git a/test/other/test_unoptimized_code_size_strict.js.size b/test/other/test_unoptimized_code_size_strict.js.size index 5c3cf64221739..a68ae6cbb0eea 100644 --- a/test/other/test_unoptimized_code_size_strict.js.size +++ b/test/other/test_unoptimized_code_size_strict.js.size @@ -1 +1 @@ -53724 +53842 diff --git a/test/other/test_unoptimized_code_size_strict.wasm.size b/test/other/test_unoptimized_code_size_strict.wasm.size index b55e8eb4cd221..04ebd2121f042 100644 --- a/test/other/test_unoptimized_code_size_strict.wasm.size +++ b/test/other/test_unoptimized_code_size_strict.wasm.size @@ -1 +1 @@ -14531 +15163 From 1f0232b11ddb664a075f3e54dd4a75ce5cf3e189 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 6 Dec 2024 16:08:04 -0800 Subject: [PATCH 09/32] update browser.test_small_js_flags size --- test/test_browser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_browser.py b/test/test_browser.py index b044613ef296e..f9c98df4d55fd 100644 --- a/test/test_browser.py +++ b/test/test_browser.py @@ -4207,7 +4207,7 @@ def test_small_js_flags(self): print('size:', size) # Note that this size includes test harness additions (for reporting the result, etc.). if not self.is_wasm64() and not self.is_2gb(): - self.assertLess(abs(size - 4477), 100) + self.assertLess(abs(size - 3377), 100) # Tests that it is possible to initialize and render WebGL content in a # pthread by using OffscreenCanvas. From b9c8be191a2a90d3d27c4b2a6f791ff922b7cc87 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 10 Dec 2024 21:27:02 -0800 Subject: [PATCH 10/32] fix WasmFS API --- src/library_wasmfs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/library_wasmfs.js b/src/library_wasmfs.js index 645f3ac597342..fd238bc2767bd 100644 --- a/src/library_wasmfs.js +++ b/src/library_wasmfs.js @@ -198,7 +198,7 @@ FS.init(); var bytesRead; if (seeking) { - bytesRead = __wasmfs_pread(stream.fd, dataBuffer, length, position); + bytesRead = __wasmfs_pread(stream.fd, dataBuffer, length, {{{ splitI64('position') }}}); } else { bytesRead = __wasmfs_read(stream.fd, dataBuffer, length); } @@ -222,7 +222,7 @@ FS.init(); var bytesRead; if (seeking) { - bytesRead = __wasmfs_pwrite(stream.fd, dataBuffer, length, position); + bytesRead = __wasmfs_pwrite(stream.fd, dataBuffer, length, {{{ splitI64('position') }}}); } else { bytesRead = __wasmfs_write(stream.fd, dataBuffer, length); } From 513ce148a7f8f28c468de3da996b3c7e5adfd807 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 10 Dec 2024 22:19:27 -0800 Subject: [PATCH 11/32] rebaseline --- test/code_size/embind_hello_wasm.json | 10 +++++----- test/code_size/embind_val_wasm.json | 8 ++++---- test/code_size/hello_wasm_worker_wasm.json | 4 ++-- 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/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_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.imports | 5 +++-- test/other/codesize/test_codesize_files_wasmfs.jssize | 2 +- test/other/codesize/test_codesize_files_wasmfs.sent | 5 +++-- test/other/codesize/test_codesize_files_wasmfs.size | 2 +- test/other/codesize/test_codesize_hello_O0.size | 2 +- test/other/codesize/test_codesize_hello_O1.size | 2 +- test/other/codesize/test_codesize_minimal_O0.size | 2 +- .../other/codesize/test_codesize_minimal_pthreads.size | 2 +- test/other/test_unoptimized_code_size.wasm.size | 2 +- .../test_unoptimized_code_size_no_asserts.wasm.size | 2 +- test/other/test_unoptimized_code_size_strict.wasm.size | 2 +- 32 files changed, 67 insertions(+), 62 deletions(-) diff --git a/test/code_size/embind_hello_wasm.json b/test/code_size/embind_hello_wasm.json index d05a5c69fa17c..c9addb6041924 100644 --- a/test/code_size/embind_hello_wasm.json +++ b/test/code_size/embind_hello_wasm.json @@ -2,9 +2,9 @@ "a.html": 552, "a.html.gz": 380, "a.js": 9879, - "a.js.gz": 4287, - "a.wasm": 7599, - "a.wasm.gz": 3432, - "total": 18030, - "total_gz": 8099 + "a.js.gz": 4288, + "a.wasm": 7580, + "a.wasm.gz": 3449, + "total": 18011, + "total_gz": 8117 } diff --git a/test/code_size/embind_val_wasm.json b/test/code_size/embind_val_wasm.json index 0ffc3b2d6ff8e..503050a61f0d1 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": 7153, "a.js.gz": 3042, - "a.wasm": 9465, - "a.wasm.gz": 4848, - "total": 17170, - "total_gz": 8270 + "a.wasm": 9493, + "a.wasm.gz": 4872, + "total": 17198, + "total_gz": 8294 } diff --git a/test/code_size/hello_wasm_worker_wasm.json b/test/code_size/hello_wasm_worker_wasm.json index 870b7172314c4..70feb27fdb040 100644 --- a/test/code_size/hello_wasm_worker_wasm.json +++ b/test/code_size/hello_wasm_worker_wasm.json @@ -6,7 +6,7 @@ "a.ww.js": 115, "a.ww.js.gz": 127, "a.wasm": 1881, - "a.wasm.gz": 1065, + "a.wasm.gz": 1068, "total": 3279, - "total_gz": 2031 + "total_gz": 2034 } diff --git a/test/code_size/hello_webgl2_wasm.json b/test/code_size/hello_webgl2_wasm.json index c944949a29c8c..13919b590d957 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": 4532, "a.js.gz": 2315, - "a.wasm": 10377, - "a.wasm.gz": 6694, - "total": 15363, - "total_gz": 9337 + "a.wasm": 10402, + "a.wasm.gz": 6703, + "total": 15388, + "total_gz": 9346 } diff --git a/test/code_size/hello_webgl2_wasm2js.json b/test/code_size/hello_webgl2_wasm2js.json index 62c056051c215..d54f14a652c99 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": 22232, - "a.js.gz": 11612, - "total": 22578, - "total_gz": 11874 + "a.js": 22200, + "a.js.gz": 11583, + "total": 22546, + "total_gz": 11845 } diff --git a/test/code_size/hello_webgl_wasm.json b/test/code_size/hello_webgl_wasm.json index f9432eddd1985..e619b3f3321c3 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": 4070, "a.js.gz": 2158, - "a.wasm": 10377, - "a.wasm.gz": 6694, - "total": 14901, - "total_gz": 9180 + "a.wasm": 10402, + "a.wasm.gz": 6703, + "total": 14926, + "total_gz": 9189 } diff --git a/test/code_size/hello_webgl_wasm2js.json b/test/code_size/hello_webgl_wasm2js.json index 01af46e9951c2..a01758dd16374 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": 21758, - "a.js.gz": 11442, - "total": 22104, - "total_gz": 11704 + "a.js": 21726, + "a.js.gz": 11413, + "total": 22072, + "total_gz": 11675 } diff --git a/test/code_size/random_printf_wasm.json b/test/code_size/random_printf_wasm.json index 3b0a3c6494de1..8548e41737392 100644 --- a/test/code_size/random_printf_wasm.json +++ b/test/code_size/random_printf_wasm.json @@ -1,6 +1,6 @@ { - "a.html": 12589, - "a.html.gz": 6888, - "total": 12589, - "total_gz": 6888 + "a.html": 12597, + "a.html.gz": 6882, + "total": 12597, + "total_gz": 6882 } diff --git a/test/code_size/random_printf_wasm2js.json b/test/code_size/random_printf_wasm2js.json index 335e5aa2294d8..b3fe0c465524e 100644 --- a/test/code_size/random_printf_wasm2js.json +++ b/test/code_size/random_printf_wasm2js.json @@ -1,6 +1,6 @@ { - "a.html": 17246, - "a.html.gz": 7510, - "total": 17246, - "total_gz": 7510 + "a.html": 17195, + "a.html.gz": 7478, + "total": 17195, + "total_gz": 7478 } diff --git a/test/other/codesize/test_codesize_cxx_ctors1.size b/test/other/codesize/test_codesize_cxx_ctors1.size index bf1bb352cd50d..ba9ed603120c5 100644 --- a/test/other/codesize/test_codesize_cxx_ctors1.size +++ b/test/other/codesize/test_codesize_cxx_ctors1.size @@ -1 +1 @@ -128645 +128911 diff --git a/test/other/codesize/test_codesize_cxx_ctors2.size b/test/other/codesize/test_codesize_cxx_ctors2.size index cc941834ec937..667c8d0f48ca4 100644 --- a/test/other/codesize/test_codesize_cxx_ctors2.size +++ b/test/other/codesize/test_codesize_cxx_ctors2.size @@ -1 +1 @@ -128061 +128360 diff --git a/test/other/codesize/test_codesize_cxx_except.size b/test/other/codesize/test_codesize_cxx_except.size index dcad1fdc1ca34..caf2ab90b0cf5 100644 --- a/test/other/codesize/test_codesize_cxx_except.size +++ b/test/other/codesize/test_codesize_cxx_except.size @@ -1 +1 @@ -170756 +171023 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm.size b/test/other/codesize/test_codesize_cxx_except_wasm.size index fa2b3d2f5868e..080b84612b71f 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm.size +++ b/test/other/codesize/test_codesize_cxx_except_wasm.size @@ -1 +1 @@ -141965 +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 4e0ff635f164d..9192383fe772e 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 @@ -144552 +144811 diff --git a/test/other/codesize/test_codesize_cxx_lto.size b/test/other/codesize/test_codesize_cxx_lto.size index 35c06c0dd209f..17c0af5d08801 100644 --- a/test/other/codesize/test_codesize_cxx_lto.size +++ b/test/other/codesize/test_codesize_cxx_lto.size @@ -1 +1 @@ -121928 +121868 diff --git a/test/other/codesize/test_codesize_cxx_mangle.size b/test/other/codesize/test_codesize_cxx_mangle.size index d7b5814d237cc..c450ac54a5ac6 100644 --- a/test/other/codesize/test_codesize_cxx_mangle.size +++ b/test/other/codesize/test_codesize_cxx_mangle.size @@ -1 +1 @@ -232437 +232669 diff --git a/test/other/codesize/test_codesize_cxx_noexcept.size b/test/other/codesize/test_codesize_cxx_noexcept.size index f2167772b31c6..ae8f088df4bb7 100644 --- a/test/other/codesize/test_codesize_cxx_noexcept.size +++ b/test/other/codesize/test_codesize_cxx_noexcept.size @@ -1 +1 @@ -131456 +131718 diff --git a/test/other/codesize/test_codesize_cxx_wasmfs.size b/test/other/codesize/test_codesize_cxx_wasmfs.size index 12673f5d1d11c..e0d846fd523cc 100644 --- a/test/other/codesize/test_codesize_cxx_wasmfs.size +++ b/test/other/codesize/test_codesize_cxx_wasmfs.size @@ -1 +1 @@ -168683 +168865 diff --git a/test/other/codesize/test_codesize_files_wasmfs.exports b/test/other/codesize/test_codesize_files_wasmfs.exports index b64e135c8e3cf..1b3d6ede9e560 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.exports +++ b/test/other/codesize/test_codesize_files_wasmfs.exports @@ -1,4 +1,4 @@ -p (memory) -q (__wasm_call_ctors) -r (main) -s (__indirect_function_table) +q (memory) +r (__wasm_call_ctors) +s (main) +t (__indirect_function_table) diff --git a/test/other/codesize/test_codesize_files_wasmfs.funcs b/test/other/codesize/test_codesize_files_wasmfs.funcs index 1fec0a5640720..c13be46f97079 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.funcs +++ b/test/other/codesize/test_codesize_files_wasmfs.funcs @@ -22,6 +22,8 @@ $__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 @@ -36,6 +38,7 @@ $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 ca6b28543d289..3737e3256a2fb 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.gzsize +++ b/test/other/codesize/test_codesize_files_wasmfs.gzsize @@ -1 +1 @@ -2930 +2948 diff --git a/test/other/codesize/test_codesize_files_wasmfs.imports b/test/other/codesize/test_codesize_files_wasmfs.imports index 519a7e0d06403..74ec884c2cde4 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.imports +++ b/test/other/codesize/test_codesize_files_wasmfs.imports @@ -11,5 +11,6 @@ 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 (_abort_js) -o (random_get) +n (_emscripten_memcpy_js) +o (_abort_js) +p (random_get) diff --git a/test/other/codesize/test_codesize_files_wasmfs.jssize b/test/other/codesize/test_codesize_files_wasmfs.jssize index 473dc4cba135f..c02b084198aab 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.jssize +++ b/test/other/codesize/test_codesize_files_wasmfs.jssize @@ -1 +1 @@ -6276 +6309 diff --git a/test/other/codesize/test_codesize_files_wasmfs.sent b/test/other/codesize/test_codesize_files_wasmfs.sent index 519a7e0d06403..74ec884c2cde4 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.sent +++ b/test/other/codesize/test_codesize_files_wasmfs.sent @@ -11,5 +11,6 @@ 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 (_abort_js) -o (random_get) +n (_emscripten_memcpy_js) +o (_abort_js) +p (random_get) diff --git a/test/other/codesize/test_codesize_files_wasmfs.size b/test/other/codesize/test_codesize_files_wasmfs.size index 00543b3195e2e..2a3e7ddec4326 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.size +++ b/test/other/codesize/test_codesize_files_wasmfs.size @@ -1 +1 @@ -49892 +50973 diff --git a/test/other/codesize/test_codesize_hello_O0.size b/test/other/codesize/test_codesize_hello_O0.size index 04ebd2121f042..b593ea0d0499e 100644 --- a/test/other/codesize/test_codesize_hello_O0.size +++ b/test/other/codesize/test_codesize_hello_O0.size @@ -1 +1 @@ -15163 +15130 diff --git a/test/other/codesize/test_codesize_hello_O1.size b/test/other/codesize/test_codesize_hello_O1.size index 4cbaed0a9e906..1c4c2ded8919d 100644 --- a/test/other/codesize/test_codesize_hello_O1.size +++ b/test/other/codesize/test_codesize_hello_O1.size @@ -1 +1 @@ -2651 +2634 diff --git a/test/other/codesize/test_codesize_minimal_O0.size b/test/other/codesize/test_codesize_minimal_O0.size index 1afd47a2198fe..0141c45d767b7 100644 --- a/test/other/codesize/test_codesize_minimal_O0.size +++ b/test/other/codesize/test_codesize_minimal_O0.size @@ -1 +1 @@ -1121 +1104 diff --git a/test/other/codesize/test_codesize_minimal_pthreads.size b/test/other/codesize/test_codesize_minimal_pthreads.size index 6dc04c8da057f..0a5bf4b2a51ac 100644 --- a/test/other/codesize/test_codesize_minimal_pthreads.size +++ b/test/other/codesize/test_codesize_minimal_pthreads.size @@ -1 +1 @@ -19491 +19487 diff --git a/test/other/test_unoptimized_code_size.wasm.size b/test/other/test_unoptimized_code_size.wasm.size index 04ebd2121f042..b593ea0d0499e 100644 --- a/test/other/test_unoptimized_code_size.wasm.size +++ b/test/other/test_unoptimized_code_size.wasm.size @@ -1 +1 @@ -15163 +15130 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 eaf3650a32420..019027c523bda 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 @@ -12244 +12211 diff --git a/test/other/test_unoptimized_code_size_strict.wasm.size b/test/other/test_unoptimized_code_size_strict.wasm.size index 04ebd2121f042..b593ea0d0499e 100644 --- a/test/other/test_unoptimized_code_size_strict.wasm.size +++ b/test/other/test_unoptimized_code_size_strict.wasm.size @@ -1 +1 @@ -15163 +15130 From 8185db17ee90a77f45ec07d092126b3f389c1e2e Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 12 Dec 2024 16:24:26 -0800 Subject: [PATCH 12/32] fix test expectations --- test/test_browser.py | 2 +- test/test_other.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_browser.py b/test/test_browser.py index 632fcabe33805..bbfeeffc317f6 100644 --- a/test/test_browser.py +++ b/test/test_browser.py @@ -4204,7 +4204,7 @@ def test_small_js_flags(self): print('size:', size) # Note that this size includes test harness additions (for reporting the result, etc.). if not self.is_wasm64() and not self.is_2gb(): - self.assertLess(abs(size - 3377), 100) + self.assertLess(abs(size - 4592), 100) # Tests that it is possible to initialize and render WebGL content in a # pthread by using OffscreenCanvas. diff --git a/test/test_other.py b/test/test_other.py index 341a364dbf06a..6c6c1e358f682 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -8544,7 +8544,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 1 has a larger maximum size 800 than the module's declared maximum", out) + self.assertContained("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']) From dd34e39fd1ea2c5797890bd8b5451245077109c3 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 13 Dec 2024 14:20:02 -0800 Subject: [PATCH 13/32] set WASM_BIGINT setting, fix tests --- src/settings.js | 2 +- test/test_browser.py | 2 +- test/test_core.py | 2 ++ test/test_other.py | 2 +- tools/link.py | 8 +++++--- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/settings.js b/src/settings.js index 6610dc1e781d2..c838823a12e18 100644 --- a/src/settings.js +++ b/src/settings.js @@ -1498,7 +1498,7 @@ var DYNCALLS = false; // i64 is used. If WASM_BIGINT is present, the default minimum supported browser // versions will be increased to the min version that supports BigInt. // [link] -var WASM_BIGINT = false; +var WASM_BIGINT = true; // WebAssembly defines a "producers section" which compilers and tools can // annotate themselves in, and LLVM emits this by default. diff --git a/test/test_browser.py b/test/test_browser.py index bbfeeffc317f6..551b0a04399bf 100644 --- a/test/test_browser.py +++ b/test/test_browser.py @@ -4204,7 +4204,7 @@ def test_small_js_flags(self): print('size:', size) # Note that this size includes test harness additions (for reporting the result, etc.). if not self.is_wasm64() and not self.is_2gb(): - self.assertLess(abs(size - 4592), 100) + self.assertLess(abs(size - 4486), 100) # Tests that it is possible to initialize and render WebGL content in a # pthread by using OffscreenCanvas. diff --git a/test/test_core.py b/test/test_core.py index e2dff6a558a1d..760a0beec2f24 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -7005,6 +7005,7 @@ def test_EXPORTED_RUNTIME_METHODS(self): '': [], 'minimal_runtime': ['-sMINIMAL_RUNTIME=1'] }) + @no_wasm2js('wasm2js incompatible with Bigint') def test_dyncall_specific(self, *args): if self.get_setting('MEMORY64'): self.skipTest('not compatible with MEMORY64') @@ -8428,6 +8429,7 @@ def test_wasm2js(self): if self.is_wasm2js(): self.skipTest('redundant to test wasm2js in wasm2js* mode') self.set_setting('WASM', 0) + self.set_setting('WASM_BIGINT', 0) self.do_core_test('test_hello_world.c') self.assertNotExists('test_hello_world.js.mem') diff --git a/test/test_other.py b/test/test_other.py index 6c6c1e358f682..939ad488586c1 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -12902,7 +12902,7 @@ def test_wasm2js_no_dylink(self): self.assertContained('WASM2JS is not compatible with relocatable output', err) def test_wasm2js_standalone(self): - self.do_run_in_out_file_test('hello_world.c', emcc_args=['-sSTANDALONE_WASM', '-sWASM=0']) + self.do_run_in_out_file_test('hello_world.c', emcc_args=['-sSTANDALONE_WASM', '-sWASM=0', '-sWASM_BIGINT=0']) def test_oformat(self): self.run_process([EMCC, test_file('hello_world.c'), '--oformat=wasm', '-o', 'out.foo']) diff --git a/tools/link.py b/tools/link.py index 032208ded3caa..e501d996192c5 100644 --- a/tools/link.py +++ b/tools/link.py @@ -797,11 +797,13 @@ def phase_linker_setup(options, state, newargs): # noqa: C901, PLR0912, PLR0915 settings.WASM2JS = 1 # Wasm bigint doesn't make sense with wasm2js, since it controls how the # wasm and JS interact. - if settings.WASM_BIGINT: - exit_with_error('WASM_BIGINT is not compatible with WASM=0') + settings.WASM_BIGINT = 0 + feature_matrix.disable_feature(feature_matrix.Feature.JS_BIGINT_INTEGRATION) if settings.WASM == 2: # Requesting both Wasm and Wasm2JS support settings.WASM2JS = 1 + settings.WASM_BIGINT = 0 + feature_matrix.disable_feature(feature_matrix.Feature.JS_BIGINT_INTEGRATION) if options.oformat == OFormat.WASM and not settings.SIDE_MODULE: # if the output is just a wasm file, it will normally be a standalone one, @@ -1764,7 +1766,7 @@ def get_full_import_name(name): exit_with_error('wasm2js does not support source maps yet (debug in wasm for now)') if settings.MEMORY64: exit_with_error('wasm2js does not support MEMORY64') - if settings.WASM_BIGINT and 'WASM_BIGINT' in user_settings: + if settings.WASM_BIGINT: exit_with_error('wasm2js does not support WASM_BIGINT') if settings.CAN_ADDRESS_2GB: exit_with_error('wasm2js does not support >2gb address space') From 308872698818e18263481a91c30fcb21b015e7b7 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 13 Dec 2024 15:09:12 -0800 Subject: [PATCH 14/32] fix doc, disable bigint with old node --- site/source/docs/tools_reference/settings_reference.rst | 5 ++--- test/common.py | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/site/source/docs/tools_reference/settings_reference.rst b/site/source/docs/tools_reference/settings_reference.rst index 902920c03c9b4..5c092e15408a8 100644 --- a/site/source/docs/tools_reference/settings_reference.rst +++ b/site/source/docs/tools_reference/settings_reference.rst @@ -2186,10 +2186,9 @@ WASM_BIGINT WebAssembly integration with JavaScript BigInt. When enabled we don't need to legalize i64s into pairs of i32s, as the wasm VM will use a BigInt where an -i64 is used. If WASM_BIGINT is present, the default minimum supported browser -versions will be increased to the min version that supports BigInt. +i64 is used. -Default value: false +Default value: true .. _emit_producers_section: diff --git a/test/common.py b/test/common.py index ecb50a93f243a..5be21fc4bcc51 100644 --- a/test/common.py +++ b/test/common.py @@ -37,7 +37,7 @@ from tools.shared import get_canonical_temp_dir, path_from_root from tools.utils import MACOS, WINDOWS, read_file, read_binary, write_binary, exit_with_error from tools.settings import COMPILE_TIME_SETTINGS -from tools import shared, line_endings, building, config, utils +from tools import shared, feature_matrix, line_endings, building, config, utils logger = logging.getLogger('common') @@ -1085,6 +1085,8 @@ def setUp(self): if node_version < emcc_min_node_version: self.emcc_args += building.get_emcc_node_flags(node_version) self.emcc_args.append('-Wno-transpile') + if node_version < feature_matrix.min_browser_versions[feature_matrix.Feature.JS_BIGINT_INTEGRATION] + self.emcc_args.append('-sWASM_BIGINT=0') self.v8_args = ['--wasm-staging'] self.env = {} From f81e0da6888e06b3f0b7a955c40d06e7040449ff Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 13 Dec 2024 15:29:21 -0800 Subject: [PATCH 15/32] fix old node --- test/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/common.py b/test/common.py index 5be21fc4bcc51..40459d8cd979b 100644 --- a/test/common.py +++ b/test/common.py @@ -1085,7 +1085,7 @@ def setUp(self): if node_version < emcc_min_node_version: self.emcc_args += building.get_emcc_node_flags(node_version) self.emcc_args.append('-Wno-transpile') - if node_version < feature_matrix.min_browser_versions[feature_matrix.Feature.JS_BIGINT_INTEGRATION] + if node_version[0] < feature_matrix.min_browser_versions[feature_matrix.Feature.JS_BIGINT_INTEGRATION]['node'] / 10000: self.emcc_args.append('-sWASM_BIGINT=0') self.v8_args = ['--wasm-staging'] From 833c2125bce6ce0f072bd23ee8f8b63def046754 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 13 Dec 2024 16:45:14 -0800 Subject: [PATCH 16/32] don't upgrade browser versions based on bigint after it's the default --- tools/feature_matrix.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index 6966eb3f2dc41..2eb4388eca053 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -152,8 +152,6 @@ def disable_feature(feature): # a user requests a feature that we know is only supported in browsers # from a specific version and above, we can assume that browser version. def apply_min_browser_versions(): - if settings.WASM_BIGINT: - enable_feature(Feature.JS_BIGINT_INTEGRATION, 'WASM_BIGINT') if settings.PTHREADS: enable_feature(Feature.THREADS, 'pthreads') enable_feature(Feature.BULK_MEMORY, 'pthreads') From 4004df6fe2011a7f49d2a079affee21f8c5c0717 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 13 Dec 2024 17:08:23 -0800 Subject: [PATCH 17/32] update settings doc --- site/source/docs/tools_reference/settings_reference.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site/source/docs/tools_reference/settings_reference.rst b/site/source/docs/tools_reference/settings_reference.rst index 5c092e15408a8..f89d622dcf579 100644 --- a/site/source/docs/tools_reference/settings_reference.rst +++ b/site/source/docs/tools_reference/settings_reference.rst @@ -2186,7 +2186,8 @@ WASM_BIGINT WebAssembly integration with JavaScript BigInt. When enabled we don't need to legalize i64s into pairs of i32s, as the wasm VM will use a BigInt where an -i64 is used. +i64 is used. If WASM_BIGINT is present, the default minimum supported browser +versions will be increased to the min version that supports BigInt. Default value: true From c2627fd1b5e5691280b1a3dcbb3c6d0b4bd0024b Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 13 Dec 2024 18:08:50 -0800 Subject: [PATCH 18/32] fix checking of BIGINT against explicit version --- tools/feature_matrix.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index 2eb4388eca053..03875fc600bc1 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -128,6 +128,11 @@ def enable_feature(feature, reason, override=False): """ if override: enable_override_features.add(feature) + if check_feature(feature, reason): + # If no conflict, bump the minimum version to accommodate the feature. + setattr(settings, name, min_version) + +def check_feature(feature, reason): for name, min_version in min_browser_versions[feature].items(): name = f'MIN_{name.upper()}_VERSION' if settings[name] < min_version: @@ -137,9 +142,10 @@ def enable_feature(feature, reason, override=False): 'compatibility', f'{name}={user_settings[name]} is not compatible with {reason} ' f'({min_version} or above required)') + return False else: - # Otherwise we bump the minimum version to accommodate the feature. - setattr(settings, name, min_version) + return True + def disable_feature(feature): @@ -152,6 +158,9 @@ def disable_feature(feature): # a user requests a feature that we know is only supported in browsers # from a specific version and above, we can assume that browser version. def apply_min_browser_versions(): + if settings.WASM_BIGINT: + # WASM_BIGINT is enabled by default, so don't use it to enable other features. + check_feature(Feature.JS_BIGINT_INTEGRATION, 'WASM_BIGINT') if settings.PTHREADS: enable_feature(Feature.THREADS, 'pthreads') enable_feature(Feature.BULK_MEMORY, 'pthreads') From 382211e8bc02ea8eab130daa745be5b3f85c2ca4 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 16 Dec 2024 12:54:24 -0800 Subject: [PATCH 19/32] fix TODOs to point to the right bug --- src/shell.js | 2 +- test/test_other.py | 5 +++-- tools/feature_matrix.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/shell.js b/src/shell.js index f672b2a6f7757..9f7a43940a5cb 100644 --- a/src/shell.js +++ b/src/shell.js @@ -35,7 +35,7 @@ var Module = typeof {{{ EXPORT_NAME }}} != 'undefined' ? {{{ EXPORT_NAME }}} : { #if POLYFILL #if WASM_BIGINT && MIN_SAFARI_VERSION < 140100 -// TODO(features): Fix this back to 150000 +// TODO(https://github.com/emscripten-core/emscripten/issues/23184): Fix this back to 150000 // See https://caniuse.com/mdn-javascript_builtins_bigint64array #include "polyfill/bigint64array.js" #endif diff --git a/test/test_other.py b/test/test_other.py index 0a76d9b0bcf0b..882bb251d1f1a 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -12396,7 +12396,8 @@ def fail(args, details): # plain -O0 legalization_message = 'to disable int64 legalization (which requires changes after link) use -sWASM_BIGINT' fail(['-sWASM_BIGINT=0'], legalization_message) - fail(['-sMIN_SAFARI_VERSION=140000'], legalization_message) # TODO(features): change this back to 140100 after 15 is default + # TODO(https://github.com/emscripten-core/emscripten/issues/23184): change this back to 140100 after 15 is default + fail(['-sMIN_SAFARI_VERSION=140000'], legalization_message) # optimized builds even without legalization optimization_message = '-O2+ optimizations always require changes, build with -O0 or -O1 instead' fail(['-O2'], optimization_message) @@ -14470,7 +14471,7 @@ def test_reproduce(self): def test_min_browser_version(self): err = self.expect_fail([EMCC, test_file('hello_world.c'), '-Wno-transpile', '-Werror', '-sWASM_BIGINT', '-sMIN_SAFARI_VERSION=120000']) - # TODO(features): fix back to 15000 once Safari 15 is default + # TODO(# TODO(https://github.com/emscripten-core/emscripten/issues/23184): change this back to 140100 after 15 is default): fix back to 15000 once Safari 15 is default self.assertContained('emcc: error: MIN_SAFARI_VERSION=120000 is not compatible with WASM_BIGINT (140100 or above required)', err) err = self.expect_fail([EMCC, test_file('hello_world.c'), '-Wno-transpile', '-Werror', '-pthread', '-sMIN_CHROME_VERSION=73']) diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index 03875fc600bc1..21d8b89561ab5 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -66,7 +66,7 @@ class Feature(IntEnum): Feature.JS_BIGINT_INTEGRATION: { 'chrome': 67, 'firefox': 68, - 'safari': 140100, # TODO(features): set this back to 15 after we update the default targets. + 'safari': 140100, # TODO(https://github.com/emscripten-core/emscripten/issues/23184): set this back to 15 after we update the default targets. 'node': 130000, }, Feature.THREADS: { From 2cc1703b952e6dbecde830cc53af18bda163942d Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 16 Dec 2024 15:18:49 -0800 Subject: [PATCH 20/32] fix copypasta --- test/test_other.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_other.py b/test/test_other.py index e39f7e67ae576..301a291ff721b 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -14471,7 +14471,7 @@ def test_reproduce(self): def test_min_browser_version(self): err = self.expect_fail([EMCC, test_file('hello_world.c'), '-Wno-transpile', '-Werror', '-sWASM_BIGINT', '-sMIN_SAFARI_VERSION=120000']) - # TODO(# TODO(https://github.com/emscripten-core/emscripten/issues/23184): change this back to 140100 after 15 is default): fix back to 15000 once Safari 15 is default + # TODO(https://github.com/emscripten-core/emscripten/issues/23184): fix back to 15000 once Safari 15 is default self.assertContained('emcc: error: MIN_SAFARI_VERSION=120000 is not compatible with WASM_BIGINT (140100 or above required)', err) err = self.expect_fail([EMCC, test_file('hello_world.c'), '-Wno-transpile', '-Werror', '-pthread', '-sMIN_CHROME_VERSION=73']) From a8372fcae092bba23aa1782f62fdac2df1b76ca0 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 16 Dec 2024 15:19:28 -0800 Subject: [PATCH 21/32] remove unneeded disabling of BIGINT, update comment, add explicit conflict check --- test/test_core.py | 3 +-- tools/link.py | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/test_core.py b/test/test_core.py index 941010e3ebd14..ebff8aa7ba3b1 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -1951,7 +1951,7 @@ def test_em_js(self, args, force_c): self.do_core_test('test_em_js.cpp', force_c=force_c) self.assertContained("no args returning int", read_file('test_em_js.js')) - @no_wasm2js('WASM_BIGINT is not compatible with wasm2js') + @no_wasm2js('using 64-bit arguments in EM_JS function without WASM_BIGINT is not yet fully supported') def test_em_js_i64(self): err = self.expect_fail([EMCC, '-Werror', '-sWASM_BIGINT=0', test_file('core/test_em_js_i64.c')]) self.assertContained('emcc: error: using 64-bit arguments in EM_JS function without WASM_BIGINT is not yet fully supported: `foo`', err) @@ -8432,7 +8432,6 @@ def test_wasm2js(self): if self.is_wasm2js(): self.skipTest('redundant to test wasm2js in wasm2js* mode') self.set_setting('WASM', 0) - self.set_setting('WASM_BIGINT', 0) self.do_core_test('test_hello_world.c') self.assertNotExists('test_hello_world.js.mem') diff --git a/tools/link.py b/tools/link.py index 9c4dd5bc8549b..f6218531bb86c 100644 --- a/tools/link.py +++ b/tools/link.py @@ -797,11 +797,15 @@ def phase_linker_setup(options, state, newargs): # noqa: C901, PLR0912, PLR0915 settings.WASM2JS = 1 # Wasm bigint doesn't make sense with wasm2js, since it controls how the # wasm and JS interact. + if user_settings.get('WASM_BIGINT'): + exit_with_error('WASM_BIGINT=1 is not compatible with WASM=0 (wasm2js)') settings.WASM_BIGINT = 0 feature_matrix.disable_feature(feature_matrix.Feature.JS_BIGINT_INTEGRATION) if settings.WASM == 2: # Requesting both Wasm and Wasm2JS support settings.WASM2JS = 1 + if user_settings.get('WASM_BIGINT'): + exit_with_error('WASM_BIGINT=1 is not compatible with WASM=0 (wasm2js)') settings.WASM_BIGINT = 0 feature_matrix.disable_feature(feature_matrix.Feature.JS_BIGINT_INTEGRATION) From cb4503ed7f1e4131186bbae750b048c101086ad8 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 16 Dec 2024 15:26:45 -0800 Subject: [PATCH 22/32] rebaseline --- test/other/codesize/test_codesize_cxx_except.size | 2 +- test/other/codesize/test_codesize_cxx_except_wasm.size | 2 +- test/other/codesize/test_codesize_cxx_except_wasm_exnref.size | 2 +- test/other/codesize/test_codesize_cxx_mangle.size | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/other/codesize/test_codesize_cxx_except.size b/test/other/codesize/test_codesize_cxx_except.size index 5e9025ceba612..73c58b4a185e1 100644 --- a/test/other/codesize/test_codesize_cxx_except.size +++ b/test/other/codesize/test_codesize_cxx_except.size @@ -1 +1 @@ -171001 +171079 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm.size b/test/other/codesize/test_codesize_cxx_except_wasm.size index ae8b17960326f..286117922882e 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm.size +++ b/test/other/codesize/test_codesize_cxx_except_wasm.size @@ -1 +1 @@ -142216 +142280 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 b74fe3016e262..a4468bd19b6c4 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 @@ -144803 +144867 diff --git a/test/other/codesize/test_codesize_cxx_mangle.size b/test/other/codesize/test_codesize_cxx_mangle.size index 8b4ec7827908c..076882e044bc1 100644 --- a/test/other/codesize/test_codesize_cxx_mangle.size +++ b/test/other/codesize/test_codesize_cxx_mangle.size @@ -1 +1 @@ -232510 +232746 From ed8906a0d4344541f1ae785a984b6c7dbb05aa18 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 16 Dec 2024 17:23:05 -0800 Subject: [PATCH 23/32] review comments, fix error check --- test/return64bit/testbind.js | 12 ++++++++---- .../{testbind_bigint.js => testbind_nobigint.js} | 12 ++++-------- test/test_core.py | 13 +++++++------ test/test_other.py | 6 +++--- tools/link.py | 6 +++--- 5 files changed, 25 insertions(+), 24 deletions(-) rename test/return64bit/{testbind_bigint.js => testbind_nobigint.js} (57%) diff --git a/test/return64bit/testbind.js b/test/return64bit/testbind.js index 9ca30d0d18977..cd21d62a82967 100644 --- a/test/return64bit/testbind.js +++ b/test/return64bit/testbind.js @@ -4,14 +4,18 @@ // returned via the accessor method getTempRet0() Module['runtest'] = function() { - var low = _test_return64(0x11223344, 0xaabbccdd); - var high = getTempRet0(); + // Use eval to create BigInt, as no support for Xn notation yet in JS + // optimizer. + var bigint = _test_return64(eval('0xaabbccdd11223344n')); + var low = Number(bigint & 0xffffffffn); + var high = Number(bigint >> 32n); console.log("low = " + low); console.log("high = " + high); var ptr = _get_func_ptr(); - low = dynCall_jj(ptr, 0x12345678, 0xabcdef19); - high = getTempRet0(); + bigint = dynCall('jj', ptr, [eval('0xabcdef1912345678n')]); + low = Number(bigint & 0xffffffffn); + high = Number(bigint >> 32n); console.log("low = " + low); console.log("high = " + high); }; diff --git a/test/return64bit/testbind_bigint.js b/test/return64bit/testbind_nobigint.js similarity index 57% rename from test/return64bit/testbind_bigint.js rename to test/return64bit/testbind_nobigint.js index cd21d62a82967..9ca30d0d18977 100644 --- a/test/return64bit/testbind_bigint.js +++ b/test/return64bit/testbind_nobigint.js @@ -4,18 +4,14 @@ // returned via the accessor method getTempRet0() Module['runtest'] = function() { - // Use eval to create BigInt, as no support for Xn notation yet in JS - // optimizer. - var bigint = _test_return64(eval('0xaabbccdd11223344n')); - var low = Number(bigint & 0xffffffffn); - var high = Number(bigint >> 32n); + var low = _test_return64(0x11223344, 0xaabbccdd); + var high = getTempRet0(); console.log("low = " + low); console.log("high = " + high); var ptr = _get_func_ptr(); - bigint = dynCall('jj', ptr, [eval('0xabcdef1912345678n')]); - low = Number(bigint & 0xffffffffn); - high = Number(bigint >> 32n); + low = dynCall_jj(ptr, 0x12345678, 0xabcdef19); + high = getTempRet0(); console.log("low = " + low); console.log("high = " + high); }; diff --git a/test/test_core.py b/test/test_core.py index ebff8aa7ba3b1..c40630d3ab975 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -7008,14 +7008,15 @@ def test_EXPORTED_RUNTIME_METHODS(self): '': [], 'minimal_runtime': ['-sMINIMAL_RUNTIME=1'] }) - @no_wasm2js('wasm2js incompatible with Bigint') def test_dyncall_specific(self, *args): if self.get_setting('MEMORY64'): self.skipTest('not compatible with MEMORY64') - # define DYNCALLS because this test does test calling them directly, and - # in WASM_BIGINT mode we do not enable them by default (since we can do - # more without them - we don't need to legalize) - args = list(args) + ['-sDYNCALLS', '-DWASM_BIGINT'] + if self.get_setting('WASM_BIGINT'): + print('bigint on') + # define DYNCALLS because this test does test calling them directly, and + # in WASM_BIGINT mode we do not enable them by default (since we can do + # more without them - we don't need to legalize) + args = list(args) + ['-sDYNCALLS', '-DWASM_BIGINT'] cases = [ ('DIRECT', []), ('DYNAMIC_SIG', ['-sDYNCALLS']), @@ -8463,7 +8464,7 @@ def test_wasm2js_fallback(self, args): if self.is_wasm2js(): self.skipTest('redundant to test wasm2js in wasm2js* mode') - cmd = [EMCC, test_file('small_hello_world.c'), '-sWASM=2', '-sWASM_BIGINT=0'] + args + cmd = [EMCC, test_file('small_hello_world.c'), '-sWASM=2'] + args self.run_process(cmd) # First run with WebAssembly support enabled diff --git a/test/test_other.py b/test/test_other.py index 301a291ff721b..aab4ba9eced50 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -8048,8 +8048,8 @@ def test_malloc_multithreading(self, allocator, args): self.do_other_test('test_malloc_multithreading.cpp', emcc_args=args) @parameterized({ - '': ([], 'testbind_bigint.js'), - 'nobigint': (['-sWASM_BIGINT=0'], 'testbind.js'), + '': ([], 'testbind.js'), + 'nobigint': (['-sWASM_BIGINT=0'], 'testbind_nobigint.js'), }) @requires_node def test_i64_return_value(self, args, bind_js): @@ -12894,7 +12894,7 @@ def test_wasm2js_no_dylink(self): self.assertContained('WASM2JS is not compatible with relocatable output', err) def test_wasm2js_standalone(self): - self.do_run_in_out_file_test('hello_world.c', emcc_args=['-sSTANDALONE_WASM', '-sWASM=0', '-sWASM_BIGINT=0']) + self.do_run_in_out_file_test('hello_world.c', emcc_args=['-sSTANDALONE_WASM', '-sWASM=0']) def test_oformat(self): self.run_process([EMCC, test_file('hello_world.c'), '--oformat=wasm', '-o', 'out.foo']) diff --git a/tools/link.py b/tools/link.py index f6218531bb86c..823c17c7c1d1a 100644 --- a/tools/link.py +++ b/tools/link.py @@ -797,15 +797,15 @@ def phase_linker_setup(options, state, newargs): # noqa: C901, PLR0912, PLR0915 settings.WASM2JS = 1 # Wasm bigint doesn't make sense with wasm2js, since it controls how the # wasm and JS interact. - if user_settings.get('WASM_BIGINT'): + if user_settings.get('WASM_BIGINT') and settings.WASM_BIGINT: exit_with_error('WASM_BIGINT=1 is not compatible with WASM=0 (wasm2js)') settings.WASM_BIGINT = 0 feature_matrix.disable_feature(feature_matrix.Feature.JS_BIGINT_INTEGRATION) if settings.WASM == 2: # Requesting both Wasm and Wasm2JS support settings.WASM2JS = 1 - if user_settings.get('WASM_BIGINT'): - exit_with_error('WASM_BIGINT=1 is not compatible with WASM=0 (wasm2js)') + if user_settings.get('WASM_BIGINT') and settings.WASM_BIGINT: + exit_with_error('WASM_BIGINT=1 is not compatible with WASM=2 (wasm2js)') settings.WASM_BIGINT = 0 feature_matrix.disable_feature(feature_matrix.Feature.JS_BIGINT_INTEGRATION) From 88775c60500549af47fc904cab198b0864ba6a8d Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 16 Dec 2024 17:44:28 -0800 Subject: [PATCH 24/32] change disabling text --- 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 c40630d3ab975..5042e0c3b766e 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -1951,7 +1951,7 @@ def test_em_js(self, args, force_c): self.do_core_test('test_em_js.cpp', force_c=force_c) self.assertContained("no args returning int", read_file('test_em_js.js')) - @no_wasm2js('using 64-bit arguments in EM_JS function without WASM_BIGINT is not yet fully supported') + @no_wasm2js('test depends on WASM_BIGINT which is not compatible with wasm2js') def test_em_js_i64(self): err = self.expect_fail([EMCC, '-Werror', '-sWASM_BIGINT=0', test_file('core/test_em_js_i64.c')]) self.assertContained('emcc: error: using 64-bit arguments in EM_JS function without WASM_BIGINT is not yet fully supported: `foo`', err) From 2ee2ce317dd5f1733aaeec69682a07a5e7b36987 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 17 Dec 2024 16:34:18 -0800 Subject: [PATCH 25/32] remove debug print --- test/test_core.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test_core.py b/test/test_core.py index 602571a775874..fea4c1dafb793 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -6920,7 +6920,6 @@ def test_dyncall_specific(self, *args): if self.get_setting('MEMORY64'): self.skipTest('not compatible with MEMORY64') if self.get_setting('WASM_BIGINT'): - print('bigint on') # define DYNCALLS because this test does test calling them directly, and # in WASM_BIGINT mode we do not enable them by default (since we can do # more without them - we don't need to legalize) From 759de04b6f120bc534bd4b73c862c6b6a579ee97 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 17 Dec 2024 16:49:09 -0800 Subject: [PATCH 26/32] fix sanity.test_binaryen_version --- test/test_sanity.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_sanity.py b/test/test_sanity.py index 17b95aac6824a..b89f02a7d2493 100644 --- a/test/test_sanity.py +++ b/test/test_sanity.py @@ -777,10 +777,10 @@ def test_binaryen_version(self): f.write('\nBINARYEN_ROOT = "' + self.in_dir('fake') + '"') make_fake_tool(self.in_dir('fake', 'bin', 'wasm-opt'), 'foo') - self.check_working([EMCC, test_file('hello_world.c')], 'error parsing binaryen version (wasm-opt version foo). Please check your binaryen installation') + self.check_working([EMCC, test_file('hello_world.c'), '-O3'], 'error parsing binaryen version (wasm-opt version foo). Please check your binaryen installation') make_fake_tool(self.in_dir('fake', 'bin', 'wasm-opt'), '70') - self.check_working([EMCC, test_file('hello_world.c')], 'unexpected binaryen version: 70 (expected ') + self.check_working([EMCC, test_file('hello_world.c'), '-O3'], 'unexpected binaryen version: 70 (expected ') def test_bootstrap(self): restore_and_set_up() From f3c20a3b662b7fe7365d8f04a01ebdad712455e3 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 17 Dec 2024 16:58:16 -0800 Subject: [PATCH 27/32] fix test_dyncall_specific --- 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 fea4c1dafb793..5b83e4c9f7e88 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -6919,7 +6919,7 @@ def test_EXPORTED_RUNTIME_METHODS(self): def test_dyncall_specific(self, *args): if self.get_setting('MEMORY64'): self.skipTest('not compatible with MEMORY64') - if self.get_setting('WASM_BIGINT'): + if self.get_setting('WASM_BIGINT', 1) != 0: # define DYNCALLS because this test does test calling them directly, and # in WASM_BIGINT mode we do not enable them by default (since we can do # more without them - we don't need to legalize) From 4abe5fb7f40bed9bf793d44b2c1c48fed2ce11fa Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 17 Dec 2024 17:39:49 -0800 Subject: [PATCH 28/32] fix test_binaryen, fix min_browser_version --- test/test_sanity.py | 4 ++-- tools/feature_matrix.py | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/test/test_sanity.py b/test/test_sanity.py index b89f02a7d2493..801ad5f36e609 100644 --- a/test/test_sanity.py +++ b/test/test_sanity.py @@ -777,10 +777,10 @@ def test_binaryen_version(self): f.write('\nBINARYEN_ROOT = "' + self.in_dir('fake') + '"') make_fake_tool(self.in_dir('fake', 'bin', 'wasm-opt'), 'foo') - self.check_working([EMCC, test_file('hello_world.c'), '-O3'], 'error parsing binaryen version (wasm-opt version foo). Please check your binaryen installation') + self.check_working([EMCC, test_file('hello_world.c'), '-O2'], 'error parsing binaryen version (wasm-opt version foo). Please check your binaryen installation') make_fake_tool(self.in_dir('fake', 'bin', 'wasm-opt'), '70') - self.check_working([EMCC, test_file('hello_world.c'), '-O3'], 'unexpected binaryen version: 70 (expected ') + self.check_working([EMCC, test_file('hello_world.c'), '-O2'], 'unexpected binaryen version: 70 (expected ') def test_bootstrap(self): restore_and_set_up() diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index e94a8a6449649..c318f1d2c8c92 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -128,10 +128,6 @@ def enable_feature(feature, reason, override=False): """ if override: enable_override_features.add(feature) - return check_feature(feature, reason, enable=True) - - -def check_feature(feature, reason, enable=False): for name, min_version in min_browser_versions[feature].items(): name = f'MIN_{name.upper()}_VERSION' if settings[name] < min_version: @@ -141,7 +137,7 @@ def check_feature(feature, reason, enable=False): 'compatibility', f'{name}={user_settings[name]} is not compatible with {reason} ' f'({min_version} or above required)') - elif enable: + else: # If no conflict, bump the minimum version to accommodate the feature. setattr(settings, name, min_version) @@ -156,9 +152,9 @@ def disable_feature(feature): # a user requests a feature that we know is only supported in browsers # from a specific version and above, we can assume that browser version. def apply_min_browser_versions(): - if settings.WASM_BIGINT: + if settings.WASM_BIGINT and 'WASM_BIGINT' in user_settings: # WASM_BIGINT is enabled by default, so don't use it to enable other features. - check_feature(Feature.JS_BIGINT_INTEGRATION, 'WASM_BIGINT') + enable_feature(Feature.JS_BIGINT_INTEGRATION, 'WASM_BIGINT') if settings.PTHREADS: enable_feature(Feature.THREADS, 'pthreads') enable_feature(Feature.BULK_MEMORY, 'pthreads') From b7d960a0bb83d869b57d523705316b95f9be5342 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 18 Dec 2024 09:01:14 -0800 Subject: [PATCH 29/32] add changelog, fix dyncall_specific again --- ChangeLog.md | 3 +++ test/test_core.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 05d25fe02c842..358491b95e93b 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -20,6 +20,9 @@ See docs/process.md for more on how version tagging works. 3.1.75 (in development) ----------------------- +- The `WASM_BIGINT` feature has been enabled by default. This has the effect that + Wasm i64 values are passed and returned between Wasm and JS as BigInt values + rather than being split by Binaryen into pairs of Numbers. - `PATH.basename()` no longer calls `PATH.normalize()`, so that `PATH.basename("a/.")` returns `"."` instead of `"a"` and `PATH.basename("a/b/..")` returns `".."` instead of `"a"`. This is in line with diff --git a/test/test_core.py b/test/test_core.py index 5b83e4c9f7e88..9bacd4b66334a 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -6919,7 +6919,7 @@ def test_EXPORTED_RUNTIME_METHODS(self): def test_dyncall_specific(self, *args): if self.get_setting('MEMORY64'): self.skipTest('not compatible with MEMORY64') - if self.get_setting('WASM_BIGINT', 1) != 0: + if self.get_setting('WASM_BIGINT') != 0 and not self.is_wasm2js(): # define DYNCALLS because this test does test calling them directly, and # in WASM_BIGINT mode we do not enable them by default (since we can do # more without them - we don't need to legalize) From d9fb51c462373e384c5213bb29cccee5456090da Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 18 Dec 2024 12:53:17 -0800 Subject: [PATCH 30/32] clarify comment --- tools/feature_matrix.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index c318f1d2c8c92..372d17c4ae332 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -153,7 +153,8 @@ def disable_feature(feature): # from a specific version and above, we can assume that browser version. def apply_min_browser_versions(): if settings.WASM_BIGINT and 'WASM_BIGINT' in user_settings: - # WASM_BIGINT is enabled by default, so don't use it to enable other features. + # WASM_BIGINT is enabled by default, don't use it to enable other features + # unless the user explicitly enabled it. enable_feature(Feature.JS_BIGINT_INTEGRATION, 'WASM_BIGINT') if settings.PTHREADS: enable_feature(Feature.THREADS, 'pthreads') From 8e5ba19aac26a3ce41fa68cbc1e635b71e401b47 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 18 Dec 2024 14:34:33 -0800 Subject: [PATCH 31/32] rebaseline test_small_js_flags, and test_INCOMING_MODULE_JS_API --- test/browser/test_small_js_flags.js.size | 2 +- test/other/test_INCOMING_MODULE_JS_API.js.size | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/browser/test_small_js_flags.js.size b/test/browser/test_small_js_flags.js.size index 555bb91567fa6..6502cf0229698 100644 --- a/test/browser/test_small_js_flags.js.size +++ b/test/browser/test_small_js_flags.js.size @@ -1 +1 @@ -4297 +4380 diff --git a/test/other/test_INCOMING_MODULE_JS_API.js.size b/test/other/test_INCOMING_MODULE_JS_API.js.size index 9b8a4c307c7a1..791d82540e015 100644 --- a/test/other/test_INCOMING_MODULE_JS_API.js.size +++ b/test/other/test_INCOMING_MODULE_JS_API.js.size @@ -1 +1 @@ -3710 +3772 From 02bc4621b0c63cb01155347856aa10cc8e03d020 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 18 Dec 2024 14:36:20 -0800 Subject: [PATCH 32/32] add PR number to changelog --- ChangeLog.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index c56f0049c6316..7bbade9d415c2 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -4,7 +4,7 @@ Note that version numbers do not necessarily reflect the amount of changes between versions. A version number reflects a release that is known to pass all tests, and versions may be tagged more or less frequently at different times. -Note that there is *no* ABI compatibility guarantee between versions - the ABI +nNote that there is *no* ABI compatibility guarantee between versions - the ABI may change, so that we can keep improving and optimizing it. The compiler will automatically invalidate system caches when the version number updates, so that libc etc. are rebuilt for you. You should also rebuild object files and @@ -22,7 +22,7 @@ See docs/process.md for more on how version tagging works. ----------------------- - The `WASM_BIGINT` feature has been enabled by default. This has the effect that Wasm i64 values are passed and returned between Wasm and JS as BigInt values - rather than being split by Binaryen into pairs of Numbers. + rather than being split by Binaryen into pairs of Numbers. (#22993) - When using `-sMODULARIZE` we now assert if the factory function is called with the JS `new` keyword. e.g. `a = new Module()` rather than `b = Module()`. This paves the way for marking the function as `async` which does not allow