Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
9eaa392
[WIP] Enable WASM_BIGINT by default
dschuff Nov 15, 2024
5532f29
review comments; fix name section emission
dschuff Nov 22, 2024
5d13302
one more debuginfo test works now
dschuff Nov 22, 2024
152c205
fix more tests, use explicit need_name_section in finalize
dschuff Nov 23, 2024
4a6588e
Use i53abi for one more wasmfs function
dschuff Nov 27, 2024
52fedfd
update node version for bigint
dschuff Nov 27, 2024
01d5e34
dont use i53 in the wrong place
dschuff Dec 6, 2024
e19febb
Merge branch 'main' into bigint_on
dschuff Dec 6, 2024
2c1b640
rebaseline size tests
dschuff Dec 6, 2024
c0f2c4a
Merge branch 'main' into bigint_on
dschuff Dec 6, 2024
1f0232b
update browser.test_small_js_flags size
dschuff Dec 7, 2024
3cbc37c
Merge branch 'main' into bigint_on
dschuff Dec 10, 2024
b9c8be1
fix WasmFS API
dschuff Dec 11, 2024
fb50f90
Merge branch 'main' into bigint_on
dschuff Dec 11, 2024
513ce14
rebaseline
dschuff Dec 11, 2024
8185db1
fix test expectations
dschuff Dec 13, 2024
22165af
rebaseline
dschuff Dec 13, 2024
dd34e39
set WASM_BIGINT setting, fix tests
dschuff Dec 13, 2024
166dcc7
Merge branch 'main' into bigint_on
dschuff Dec 13, 2024
3088726
fix doc, disable bigint with old node
dschuff Dec 13, 2024
f81e0da
fix old node
dschuff Dec 13, 2024
833c212
don't upgrade browser versions based on bigint after it's the default
dschuff Dec 14, 2024
4004df6
update settings doc
dschuff Dec 14, 2024
faa22bb
Merge branch 'main' into bigint_on
dschuff Dec 14, 2024
c2627fd
fix checking of BIGINT against explicit version
dschuff Dec 14, 2024
382211e
fix TODOs to point to the right bug
dschuff Dec 16, 2024
b05455c
Merge branch 'main' into bigint_on
dschuff Dec 16, 2024
2d5fd55
Merge branch 'main' into bigint_on
dschuff Dec 16, 2024
2cc1703
fix copypasta
dschuff Dec 16, 2024
a8372fc
remove unneeded disabling of BIGINT, update comment, add explicit con…
dschuff Dec 16, 2024
cb4503e
rebaseline
dschuff Dec 16, 2024
ed8906a
review comments, fix error check
dschuff Dec 17, 2024
88775c6
change disabling text
dschuff Dec 17, 2024
dd73366
Merge branch 'main' into bigint_on
dschuff Dec 17, 2024
b70d46a
Merge branch 'main' into bigint_on
dschuff Dec 17, 2024
2ee2ce3
remove debug print
dschuff Dec 18, 2024
759de04
fix sanity.test_binaryen_version
dschuff Dec 18, 2024
f3c20a3
fix test_dyncall_specific
dschuff Dec 18, 2024
4abe5fb
fix test_binaryen, fix min_browser_version
dschuff Dec 18, 2024
b7d960a
add changelog, fix dyncall_specific again
dschuff Dec 18, 2024
8a3df8f
Merge branch 'main' into bigint_on
dschuff Dec 18, 2024
d9fb51c
clarify comment
dschuff Dec 18, 2024
ff8c662
Merge branch 'main' into bigint_on
dschuff Dec 18, 2024
9194564
Merge branch 'main' into bigint_on
dschuff Dec 18, 2024
8e5ba19
rebaseline test_small_js_flags, and test_INCOMING_MODULE_JS_API
dschuff Dec 18, 2024
02bc462
add PR number to changelog
dschuff Dec 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/library_wasmfs_jsimpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
3 changes: 2 additions & 1 deletion src/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 7 additions & 9 deletions test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1954,10 +1954,8 @@ def test_em_js(self, args, force_c):

@no_wasm2js('WASM_BIGINT is not compatible with wasm2js')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment maybe needs updating or removing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment updated.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any change here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's in a8372fc

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')

Expand Down Expand Up @@ -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']),
Expand Down Expand Up @@ -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')

Expand Down Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tools/feature_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Feature(IntEnum):
Feature.JS_BIGINT_INTEGRATION: {
'chrome': 67,
'firefox': 68,
'safari': 150000,
'safari': 140100,
},
Feature.THREADS: {
'chrome': 74,
Expand Down
6 changes: 6 additions & 0 deletions tools/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
Loading