Skip to content

Commit

Permalink
[switch] comment fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
frank-emrich committed Nov 29, 2024
1 parent af09380 commit f0b9690
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions crates/cranelift/src/wasmfx/optimized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1570,7 +1570,7 @@ pub(crate) fn vmctx_store_payloads<'a>(
/// continuations beginning at `start`.
///
/// The flag `search_suspend_handlers` determines whether we search for a
/// suspend or switch handlers. Concretely, this influences which part of each
/// suspend or switch handler. Concretely, this influences which part of each
/// handler list we will search.
///
/// We trap if no handler was found.
Expand Down Expand Up @@ -1857,7 +1857,9 @@ pub(crate) fn translate_resume<'a>(

let vmctx = tc::VMContext::new(env.vmctx_val(&mut builder.cursor()), env.pointer_type());

// Split the resumetable into suspend handlers (each represented by the tag index and handler block) and the switch handlers (represented just by the tag index).
// Split the resumetable into suspend handlers (each represented by the tag
// index and handler block) and the switch handlers (represented just by the
// tag index). Note that we currently don't remove duplicate tags.
let (suspend_handlers, switch_tags): (Vec<(u32, Block)>, Vec<u32>) = resumetable
.iter()
.partition_map(|(tag_index, block_opt)| match block_opt {
Expand Down
9 changes: 5 additions & 4 deletions crates/wasmtime/src/runtime/vm/continuation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ pub mod optimized {
/// Note that this is *not* used for tag payloads.
pub args: Payloads,

/// Once a continuation is suspended, this buffer is used to hold
/// payloads provided by cont.bind and resume and received at the
/// suspend site. In particular, this may not be used while the
/// continuation's state is `Fresh`.
/// Once a continuation has been suspended (using suspend or switch),
/// this buffer is used to hold payloads provided by cont.bind, resume,
/// and switch. They are received at the suspend site (i.e., the
/// corrsponding suspend or switch instruction). In particular, this may
/// not be used while the continuation's state is `Fresh`.
pub values: Payloads,

/// Revision counter.
Expand Down

0 comments on commit f0b9690

Please sign in to comment.