Skip to content

Fix running enter/exit hooks on start functions#3001

Merged
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:better-enter-exit
Jun 21, 2021
Merged

Fix running enter/exit hooks on start functions#3001
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:better-enter-exit

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

This commit fixes running the store's enter/exit hooks into wasm which
accidentally weren't run for an instance's start function. The fix
here was mostly to just sink the enter/exit hook much lower in the code
to invoke_wasm_and_catch_traps, which is the common entry point for
all wasm calls.

This did involve propagating the StoreContext<T> generic rather than
using StoreOpaque unfortunately, but it is overally not too too much
code and we generally wanted most of it inlined anyway.

This commit fixes running the store's enter/exit hooks into wasm which
accidentally weren't run for an instance's `start` function. The fix
here was mostly to just sink the enter/exit hook much lower in the code
to `invoke_wasm_and_catch_traps`, which is the common entry point for
all wasm calls.

This did involve propagating the `StoreContext<T>` generic rather than
using `StoreOpaque` unfortunately, but it is overally not too too much
code and we generally wanted most of it inlined anyway.
@github-actions github-actions Bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label Jun 18, 2021
@github-actions
Copy link
Copy Markdown

Subscribe to Label Action

cc @peterhuene

Details This issue or pull request has been labeled: "wasmtime:api"

Thus the following users have been cc'd because of the following labels:

  • peterhuene: wasmtime:api

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@alexcrichton alexcrichton merged commit 8760bcc into bytecodealliance:main Jun 21, 2021
@alexcrichton alexcrichton deleted the better-enter-exit branch June 21, 2021 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasmtime:api Related to the API of the `wasmtime` crate itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants