Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Feb 10, 2023

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:

  • Enable testing with a canary/nightly build of node that has the latest wasm64 fixes.
  • Add __sig attributes to bunch of library functions that were missing them.
  • Add signature to a few more native exports in create_wasm64_wrappers.
  • Fix signature of makeDynCall used for thread entry point
  • Fix wasm64-only compile errors in a bunch of test code
  • Fix incorrect I64_ADD opcode in webassembly.py
  • Update pthread_attr_t to use long for __s member (the __s member is used to hold pointer-sized things).

sbc100 added a commit that referenced this pull request Feb 10, 2023
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
@sbc100 sbc100 force-pushed the wasm64_pthreads branch 3 times, most recently from d828324 to 51a7fd7 Compare February 10, 2023 22:03
sbc100 added a commit that referenced this pull request Feb 10, 2023
…ing (#18707)

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
sbc100 added a commit that referenced this pull request Feb 11, 2023
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.
sbc100 added a commit that referenced this pull request Feb 11, 2023
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.
sbc100 added a commit that referenced this pull request Feb 11, 2023
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.
sbc100 added a commit that referenced this pull request Feb 13, 2023
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.
sbc100 added a commit that referenced this pull request Feb 13, 2023
…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.
Testing wasm64 with threads requires a nightly build of node (since
it depends on some very recent fixes on the v8 side).
@sbc100
Copy link
Collaborator Author

sbc100 commented Feb 14, 2023

PTAL, this should be fairly straight forward review now!

@dschuff
Copy link
Member

dschuff commented Feb 15, 2023

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?

@sbc100
Copy link
Collaborator Author

sbc100 commented Feb 15, 2023

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.

@sbc100
Copy link
Collaborator Author

sbc100 commented Feb 15, 2023

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?

Done

@dschuff
Copy link
Member

dschuff commented Feb 15, 2023

Yeah, splitting out changes when possible is good, but there will always be a place for more descriptive commit descriptions :)

@dschuff
Copy link
Member

dschuff commented Feb 15, 2023

Cool! What's still needed to support exceptions with wasm64?

@sbc100
Copy link
Collaborator Author

sbc100 commented Feb 15, 2023

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.

@sbc100 sbc100 merged commit 009c171 into main Feb 15, 2023
@sbc100 sbc100 deleted the wasm64_pthreads branch February 15, 2023 19:34
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