Repository navigation
Define postMessage of shared Memory - #90
Conversation
With the WebAssembly threads proposal, a single Memory can be shared between multiple agents within an agent cluster. This patch associates a WebAssembly store with an agent cluster, rather than an agent, and updates the WebAssembly JS API to define the store for an agent as the store for its surrounding agent cluster.
The semantics here are - forStorage serialization is disallowed - Transfers are only permitted within an agent cluster - Transfer of Memory backed by SharedArrayBuffers makes the buffer available in the source and the destination, with no resulting detached buffer. - Transfer of Memory backed by ArrayBuffers is disallowed. This specification attempts to be well-integrated with HTML by defining n terms of the serialization behavior of Memory as a platform object, and using the sub-serialization of the underlying SharedArrayBuffer to check for transferring within an agent cluster, and not to IndexedDB. Based on the earlier PR at WebAssembly/design#1074
|
This patch is missing tests; we should follow up with those. But it looks like there are a lot of missing tests compared to the current specification, so maybe this shouldn't block landing. Feel free to merge this patch if you feel it's appropriate; I don't have any other planned changes. |
|
LGTM too. There's an implementation of (what purports to be) this algorithm in Firefox Nightly. I do have some test cases - using the FF test harness - in https://dxr.mozilla.org/mozilla-central/source/js/src/jit-test/tests/wasm/memory-*.js. |
|
@lars-t-hansen Are you facing any sort of barrier to developing these as web-platform-tests rather than using the Firefox test harness? |
|
It's a lame excuse, but I can write jit-tests in my sleep while wpt requires a larger time investment... Also the jit-tests run in the spidermonkey shell, which is important for development speed, I don't want to rebuild Firefox in order to test. |
|
Cool, I'm OK with landing tests in another PR. |
* Rename "index type" to "address type" across the spec * Update "index type" to "address type" in the spec interpreter * Update section underlines It is very important that you have precisely the correct number of dots. It would be too much work for the computer otherwise. * Rename "address type" to "addr type" in the spec interpreter * Revert one stray interpreter update
…bAssembly#94) "index" was renamed to "address". Without this change, all JS tests generated from the core tests will fail.
[spec] Normative: Store is per agent cluster
With the WebAssembly threads proposal, a single Memory can be shared between
multiple agents within an agent cluster. This patch associates a WebAssembly
store with an agent cluster, rather than an agent, and updates the WebAssembly
JS API to define the store for an agent as the store for its surrounding
agent cluster.
[spec] Normative: Define serialization for SAB Memory
The semantics here are
the source and the destination, with no resulting detached buffer.
This specification attempts to be well-integrated with HTML by defining
n terms of the serialization behavior of Memory as a platform object, and
using the sub-serialization of the underlying SharedArrayBuffer to check
for transferring within an agent cluster, and not to IndexedDB.
Based on the earlier PR at WebAssembly/design#1074