-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Start implementing `Store::call_hook` (#1083) * Add the `Store::call_hook` function, which stores a call hook in `Store` * Create tests to verify call hook behavior * Let call hooks return any `wasmi::Error` * Changed signature of call hooks to return a `wasmi::Error` instead of a `TrapCode`. * Use `assert_eq!` instead of `assert!` for tests, cosmetic change * Invoke call hooks on function calls * An `invoke_call_hook` function in Store to avoid problems with the borrow checker - we need a reference to the underlying data and the stored call hook * Invoke call hook on host -> wasm and wasm -> host calls * Clarified documentation on error propagation for call hooks * Fixed attribute placement and clippy errors * Placed attributes after doc comments * Added hint to allow complex type for `generate_error_after_n_calls` * Fixed clippy warnings on implicit conversion of ! to () in call_hook tests * Help the compiler optimize function calls for the no call hook scenario * Inline `Store::invoke_call_hook` to avoid extra function call * Add a `Store::invoke_call_hook_impl` function that is `#[cold]` to hint that the compiler should optimize for the scenario that there are no call hooks * Update crates/wasmi/src/store.rs Co-authored-by: Robin Freyler <robbepop@web.de> --------- Co-authored-by: Robin Freyler <robbepop@web.de>
- Loading branch information
Showing
6 changed files
with
356 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.