-
Notifications
You must be signed in to change notification settings - Fork 295
Update some async intrinsic signatures #2116
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
Update some async intrinsic signatures #2116
Conversation
* `future.new` - takes a pointer parameter instead of returning a result. * `future.close-{readable,writable}` - drop the `error-context` argument second field.
This is intended to encompass upstream issues such as WebAssembly/component-model#474 and WebAssembly/component-model#475. Not complete as more changes may be necessary. I hope to add intrinsics for task cancellation soon to. Nevertheless I'm using this in my wit-bindgen refactor. cc @dicej |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I think this is good to go @dicej, just some minor changes here and I'll follow-up later with task cancellation intrinsics in a future PR.
(import {module:?} "[future-new-{i}]{name}" (func (result i32))) | ||
(import {module:?} "[future-new-{i}]{name}" (func (result i64))) | ||
(import {module:?} "[future-read-{i}]{name}" (func (param i32 i32) (result i32))) | ||
(import {module:?} "[future-write-{i}]{name}" (func (param i32 i32) (result i32))) | ||
(import {module:?} "[future-cancel-read-{i}]{name}" (func (param i32) (result i32))) | ||
(import {module:?} "[future-cancel-write-{i}]{name}" (func (param i32) (result i32))) | ||
(import {module:?} "[future-close-readable-{i}]{name}" (func (param i32 i32))) | ||
(import {module:?} "[future-close-writable-{i}]{name}" (func (param i32 i32))) | ||
(import {module:?} "[future-close-readable-{i}]{name}" (func (param i32))) | ||
(import {module:?} "[future-close-writable-{i}]{name}" (func (param i32))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a basic summary of the changes here, notably:
{future,stream}.new
intrinsics return a two 32-bit handles as a result packed into a 64-bit integer. It kind of sucks we don't have multi-value and I also didn't want to go the route of adding canonopts to these intrinsics just to write values into memory. It's a bit wonky since bit packing doesn't happen anywhere else in the canonical ABI but it happens in other async intrinsics so maybe ok?- For
{future,stream}.close-{readable,writable}
the only change is to drop the error-context parameter.
future.new
- returns a 64-bit value instead of a 32-bit valuefuture.close-{readable,writable}
- drop theerror-context
argument second field.