-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add an instance API for invoking the WASI start functions. #1516
Conversation
This adds support for the WASI reactor ABI proposed in WebAssembly/WASI#256, as well as the existing _start ABI for commands. This also implements the semantics that command instances should not persist after their _start function is called. As a safety measure, this includes a check that the instance refcount is 1, so that other references to the instance don't hold it live. Implementing that prompted a change to how the main Instance API works. Instead having instances eagerly compute a Vec of Externs, and bumping the refcount for each Extern, compute Externs on demand. This also means that the closure returned by `get0` and friends now holds an `InstanceHandle` to dynamically hold the instance live rather than being scoped to a lifetime.
Subscribe to Label Actioncc @peterhuene
This issue or pull request has been labeled: "wasmtime:api", "wasmtime:c-api"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
Make `Module::exports` and `Module::imports` return iterators instead of slices, and compute them on demand rather than eagerly. Also, compute them from wasmtime_environ's data structures, rather than re-decoding the wasm bytes. To support this, change wasmtime_environ::Module hold a single imports array rather than having per-type arrays.
Ok, I've now updated |
Subscribe to Label Actioncc @fitzgen
This issue or pull request has been labeled: "fuzzing"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
Looking at where this PR ended up, there's a lot of refactoring here mixed in with a new feature, so I'm going to split this PR into pieces. |
This adds support for the WASI reactor ABI proposed in
WebAssembly/WASI#256, as well as the existing
_start ABI for commands.
This also implements the semantics that command instances should not
persist after their _start function is called. As a safety measure,
this includes a check that the instance refcount is 1, so that other
references to the instance don't hold it live.
Implementing that prompted a change to how the main Instance API works.
Instead having instances eagerly compute a Vec of Externs, and bumping
the refcount for each Extern, compute Externs on demand.
This also means that the closure returned by
get0
and friends nowholds an
InstanceHandle
to dynamically hold the instance live ratherthan being scoped to a lifetime.
This is a draft PR for now while I think more about whether this is a good
approach.