dhil opened PR #14052 from dhil:resume-throw-ref to bytecodealliance:main:
This patch "completes" the implementation of stack switching in the sense that it adds the two missing instructions
resume_throwandresume_throw_ref.It builds on the previous trap patch. The idea is to "bubble" exceptions up through continuation stacks until they either reach a suitable exception handler or a host/engine boundary.
There is one special case: cancelling a fresh continuation, i.e. a continuation that has never been started. In this case, we inject the exception into the current context, because the Rust-wrapper around the funcref used to create the continuation expects to receive the arguments of the funcref and forward them accordingly.
prtest:full
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
dhil requested alexcrichton for a review on PR #14052.
dhil requested wasmtime-compiler-reviewers for a review on PR #14052.
dhil requested wasmtime-core-reviewers for a review on PR #14052.
dhil converted PR #14052 [stack-switching] Codegen for resume_throw and resume_throw_ref. to a draft
alexcrichton commented on PR #14052:
This all looks reasonable to me and looks like CI is passing, thanks! Happy to r+ and merge when you feel it's ready
This all looks reasonable to me and looks like CI is passing, thanks! Happy to r+ and merge when you feel it's ready
Yes sure! I think it is good to go now. I will look into adding a few more tests next week.
Though, I plan to work on the GC <-> stack switching interaction next.
dhil has marked PR #14052 as ready for review.
:thumbs_up: alexcrichton submitted PR review.
alexcrichton added PR #14052 [stack-switching] Codegen for resume_throw and resume_throw_ref. to the merge queue
:check: alexcrichton merged PR #14052.
alexcrichton removed PR #14052 [stack-switching] Codegen for resume_throw and resume_throw_ref. from the merge queue
Last updated: Aug 30 2026 at 09:07 UTC