-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[Wasm64] Add support for threads #18705
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
Conversation
ac08c6f to
2019e26
Compare
Logically the code make more sense here in processLibraryFunction, but its also important that the wasm64 wrapper is the outermost one. Without this the wasm64 adapter is applied to the inner, non-proxied function only. Split out from #18705
d828324 to
51a7fd7
Compare
51a7fd7 to
b9b2587
Compare
Split out from #18705 I noticed while working on #18705 that the exports returned by `instantiateWasm` (which is used in pthreads to load the wasm module) ere not the same (potentially wrapped/modified) exports that were created during `receiveInstance`. I guess someone else must have noticed this and added the extra call to `Asyncify.instrumentWasmExports`. This should not be necessary since `receiveInstance` already takes care of that.
Split out from #18705 I noticed while working on #18705 that the exports returned by `instantiateWasm` (which is used in pthreads to load the wasm module) ere not the same (potentially wrapped/modified) exports that were created during `receiveInstance`. I guess someone else must have noticed this and added the extra call to `Asyncify.instrumentWasmExports`. This should not be necessary since `receiveInstance` already takes care of that.
Split out from #18705 I noticed while working on #18705 that the exports returned by `instantiateWasm` (which is used in pthreads to load the wasm module) ere not the same (potentially wrapped/modified) exports that were created during `receiveInstance`. I guess someone else must have noticed this and added the extra call to `Asyncify.instrumentWasmExports`. This should not be necessary since `receiveInstance` already takes care of that.
Split out from #18705 I noticed while working on #18705 that the exports returned by `instantiateWasm` (which is used in pthreads to load the wasm module) ere not the same (potentially wrapped/modified) exports that were created during `receiveInstance`. I guess someone else must have noticed this and added the extra call to `Asyncify.instrumentWasmExports`. This should not be necessary since `receiveInstance` already takes care of that.
…18711) Split out from #18705 I noticed while working on #18705 that the exports returned by `instantiateWasm` (which is used in pthreads to load the wasm module) ere not the same (potentially wrapped/modified) exports that were created during `receiveInstance`. I guess someone else must have noticed this and added the extra call to `Asyncify.instrumentWasmExports`. This should not be necessary since `receiveInstance` already takes care of that.
b9b2587 to
1da0ceb
Compare
Testing wasm64 with threads requires a nightly build of node (since it depends on some very recent fixes on the v8 side).
1da0ceb to
a619e29
Compare
|
PTAL, this should be fairly straight forward review now! |
|
Reviewing. Since this is clearly a collection of several changes, can you add a commit description saying at a high level what those changes are? |
Funnily enough I already split out least 3 changes out of this one :) But yes I will add more color to the PR description. The one change I could still potentially split out is the testing under node canary. |
Done |
|
Yeah, splitting out changes when possible is good, but there will always be a place for more descriptive commit descriptions :) |
|
Cool! What's still needed to support exceptions with wasm64? |
Its emscripten exceptions that are not supported.. so I think we decided no to prioritize it. Having said that, I think it would require changing something in the emscripten EH ABI from int32 to intptr width.. so it would require an llvm change IIRC. |
Testing wasm64 with threads requires a nightly build of node (since it depends on some very recent fixes on the v8 side).
This change consists of the following:
__sigattributes to bunch of library functions that were missing them.create_wasm64_wrappers.makeDynCallused for thread entry pointI64_ADDopcode inwebassembly.pypthread_attr_tto uselongfor__smember (the__smember is used to hold pointer-sized things).