forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backtrace support, part 2: Shadow VMRuntimeLimits for each stack (#99)
As of PR #98, each `ContinuationObject` contains an object of type `StackLimits`. In addition, there exists such an object for the main stack, it is stored in the `VMContext` and the `StackChain::MainStack` variant at the list of currently active continuations points to it. These `StackLimits` objects contain counterparts of the stack-related fields in `VMRuntimeLimits`, namely `stack_limit` and the various `last_wasm_*` fields. As of PR #98, the actual contents of these `StackLimits` are unused (and not updated). This changes in this PR: While the `VMRuntimeLimits` continue to contain the stack-related information for the currently executing stack (either the main stack or a continuation), we ensure that for stacks that are *not* currently running, their corresponding `StackLimits` object now contains accurate values about their stack limits. The doc comment on `wasmtime_continuations::StackChain` describes the exact invariants that we maintain. To ensure that these invariants hold, we need to copy some fields between the `VMRuntimeLimits` and `StackLimits` objects when stack switching occurs. In particular, the `tc_resume` libcall now takes an additional argument: A pointer to the `StackLimits` object of the *parent* of the continuation that is about to be resume. Note that this needs to happen in the libcall itself, in order to obtain accurate values for the `last_wasm_exit_*` values in the `VMRuntimeLimits`.
- Loading branch information
1 parent
ceb9967
commit e8078a5
Showing
6 changed files
with
202 additions
and
8 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