Stream: git-wasmtime

Topic: wasmtime / PR #14052 [stack-switching] Codegen for `resum...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 31 2026 at 17:07):

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_throw and resume_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:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Jul 31 2026 at 17:07):

dhil requested alexcrichton for a review on PR #14052.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 31 2026 at 17:07):

dhil requested wasmtime-compiler-reviewers for a review on PR #14052.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 31 2026 at 17:07):

dhil requested wasmtime-core-reviewers for a review on PR #14052.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 31 2026 at 17:07):

dhil converted PR #14052 [stack-switching] Codegen for resume_throw and resume_throw_ref. to a draft

view this post on Zulip Wasmtime GitHub notifications bot (Jul 31 2026 at 18:43):

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

view this post on Zulip Wasmtime GitHub notifications bot (Jul 31 2026 at 20:00):

dhil 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

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.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 31 2026 at 20:00):

dhil has marked PR #14052 as ready for review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 31 2026 at 20:11):

:thumbs_up: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 31 2026 at 20:11):

alexcrichton added PR #14052 [stack-switching] Codegen for resume_throw and resume_throw_ref. to the merge queue

view this post on Zulip Wasmtime GitHub notifications bot (Jul 31 2026 at 20:36):

:check: alexcrichton merged PR #14052.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 31 2026 at 20:36):

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