Skip to content

[ASYNCIFY] Avoid dependency on the names of exports #24382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2025

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented May 20, 2025

This change moves from using export names to function identity to track the functions in the resumption stack.

The upside of this is that we can wrap non-exports, such as table entire, which we currently avoid by enabling -sDYNCALLS whenever ASYNCIFY=1 is used.

It also means we can potentially make ASYNCIFY=1 work with the wasmExports global existing (i.e. in WASM_ESM_INTEGRATION mode.

@sbc100 sbc100 requested review from kripken and brendandahl May 20, 2025 20:44
@sbc100
Copy link
Collaborator Author

sbc100 commented May 20, 2025

@kripken .. the one test that fails with this change is test_emscripten_lazy_load_code.

This is because test_emscripten_lazy_load_code relies on the asyncify resume stack containing names that are then looked in up the dynamically updates wasmExports map.

I can think of some ways I might be able to make ASYNCIFY_LAZY_LOAD_CODE work in with this patch.. but I'm also tempted to simple remove it? WDYT?

@sbc100 sbc100 force-pushed the asyncify_no_wasmExports branch from 212561b to d10207a Compare May 20, 2025 21:39
@sbc100
Copy link
Collaborator Author

sbc100 commented May 20, 2025

I managed to make ASYNCIFY_LAZY_LOAD_CODE in a way that wasn't too offensive I think

@sbc100 sbc100 force-pushed the asyncify_no_wasmExports branch from d10207a to eee7240 Compare May 20, 2025 21:41
@sbc100 sbc100 requested a review from kripken May 20, 2025 21:41
@sbc100 sbc100 force-pushed the asyncify_no_wasmExports branch from eee7240 to c27badd Compare May 20, 2025 23:53
@sbc100 sbc100 enabled auto-merge (squash) May 20, 2025 23:53
This change moves from using export names to function identity to track
the function in the resumption stack.

The upside of this is that we can wrap non-exports, such as table
entire, which we currently avoid by enabling `-sDYNCALLS` whenever
`ASYNCIFY=1` is used.

It also means we can potentially make `ASYNCIFY=1` work with the
`wasmExports` global existing (i.e. in `WASM_ESM_INTEGRATION` mode.
@sbc100 sbc100 force-pushed the asyncify_no_wasmExports branch from c27badd to 371489c Compare May 21, 2025 01:24
@sbc100 sbc100 merged commit 2f78716 into emscripten-core:main May 21, 2025
30 checks passed
@sbc100 sbc100 deleted the asyncify_no_wasmExports branch May 21, 2025 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants