Skip to content

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented 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 sbc100 requested a review from kripken February 11, 2023 00:32
@sbc100 sbc100 changed the title When exports are correctly handled when instantiateWasm is present Ensure exports are correctly handled when instantiateWasm is present Feb 11, 2023
@sbc100 sbc100 force-pushed the instantiateWasm_return_value branch 2 times, most recently from 5aa3d13 to b466ba4 Compare February 11, 2023 01:21
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 sbc100 force-pushed the instantiateWasm_return_value branch from b466ba4 to 52123b3 Compare February 13, 2023 20:47
@sbc100 sbc100 enabled auto-merge (squash) February 13, 2023 20:48
@sbc100 sbc100 merged commit e04f291 into main Feb 13, 2023
@sbc100 sbc100 deleted the instantiateWasm_return_value branch February 13, 2023 22:09
sbc100 added a commit that referenced this pull request Oct 14, 2024
There are a two different fixes here, neither of which are needed except
in the nightly version of chrome.

1. In the `instantiateWasm` override used in audio worklets return the
result of `receiveInstance` rather then directly returning the wasm
exports. This means that the resulting object has the needed wrappers
applied. This was causing an exception even on older version of chrome,
but the tests still passed regardless. With newer versions of chrome the
exception seems to cause the worklet creation to fail. (see #18711)
2. Using BigInt when indexing the wasm table. I would have prefered to
use `toIndexType` here but that doesn't work in `audio_worklet.js`.
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