forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for inter-instance stack switching (#108)
There is a currently a conceptual error in the implementation, where the chain of active stacks (= continuations + the main stack) is stored per `Instance`/`VMContext`. This means that when a function `$f` calls an imported function `$g`, where `$f` and `$g` are not part of the same instance, their stack chains are completely separate. For example, it is not possible to `suspend` to a tag `$t` in `$g` and handle this in a resume block in `$f` (assuming that the underlying modules import and export the tag `$t` so that it is shared between the two). This PR rectifies this situation by sharing a single `StackChain` object between all instances of the same `Store`. The `VMContext` then contains merely a pointer to this shared chain, rather than a chain of its own. This fully mirrors how the `VMRuntimeLimits` are already shared between all instances of a `Store`.
- Loading branch information
1 parent
4df0bc5
commit 82d8569
Showing
9 changed files
with
193 additions
and
51 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
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.