Skip to content

Commit

Permalink
add component-model-async/lift.wast test
Browse files Browse the repository at this point in the history
This is another piece of bytecodealliance#9582 which I'm splitting out to make review easier.

This test includes two components: one which exports a function using the
async-with-callback ABI, and another which uses the async-without-callback ABI.
It doesn't actually instantiate or run either component yet.

The rest of the changes fill in some TODOs to make the test pass.

Signed-off-by: Joel Dice <[email protected]>
  • Loading branch information
dicej committed Jan 24, 2025
1 parent 167e590 commit 54d77a4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/wasmtime/src/runtime/vm/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,15 @@ impl ComponentInstance {
}
}

/// Same as `set_runtime_memory` but for async callback function pointers.
pub fn set_runtime_callback(&mut self, idx: RuntimeCallbackIndex, ptr: NonNull<VMFuncRef>) {
unsafe {
let storage = self.vmctx_plus_offset_mut(self.offsets.runtime_callback(idx));
debug_assert!(*storage as usize == INVALID_PTR);
*storage = ptr.as_ptr();
}
}

/// Same as `set_runtime_memory` but for post-return function pointers.
pub fn set_runtime_post_return(
&mut self,
Expand Down

0 comments on commit 54d77a4

Please sign in to comment.