Stream: git-wasmtime

Topic: wasmtime / PR #5055 component model: async host function ...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 14 2022 at 00:41):

pchickey opened PR #5055 from pch/component_model_async to main:

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Oct 17 2022 at 21:45):

pchickey updated PR #5055 from pch/component_model_async to main.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 17 2022 at 23:45):

pchickey updated PR #5055 from pch/component_model_async to main.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 17 2022 at 23:51):

pchickey edited PR #5055 from pch/component_model_async to main:

Based on #5065.

This PR adds the async suite of variations on Linker::wrap_func, Func::call, TypedFunc::call, and the various instantiate functions, for use in async Rust contexts.

This ends up being pretty simple: all of the async store machinery from core wasmtime is straightforward to reuse here.

I created a new test suite at tests/all/component_model/async.rs to smoke test the new functionality.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 17 2022 at 23:52):

pchickey updated PR #5055 from pch/component_model_async to main.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2022 at 14:53):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2022 at 14:53):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2022 at 14:53):

alexcrichton created PR review comment:

One day in the future it might be best to conditionally do the fiber business here since many functions might not have a post_return in which case going through all this for a stack is largely overkill. Put another way the stack is only needed here for the crate::Func::call_unchecked_raw call, but this is an optimization we can deal with later.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2022 at 14:53):

alexcrichton created PR review comment:

You can simplify this a bit with:

(component
  (import "i" (func $f))

  (core module $m
    (import "" "" (func $i))
    (func (export "thunk") call $i)
  )

  (core func $f (canon lower (func $f)))
  (core instance $i (instantiate $m
    (with "" (instance
      (export "" (func $f))
    ))
  ))
  (func (export "thunk")
    (canon lift (core func $i "thunk"))
  )
)

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2022 at 16:31):

pchickey updated PR #5055 from pch/component_model_async to main.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2022 at 16:31):

pchickey submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2022 at 16:31):

pchickey created PR review comment:

Noted!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2022 at 16:31):

pchickey submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2022 at 16:31):

pchickey created PR review comment:

Thanks, done!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2022 at 16:32):

pchickey updated PR #5055 from pch/component_model_async to main.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2022 at 16:32):

pchickey has marked PR #5055 as ready for review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2022 at 17:03):

pchickey updated PR #5055 from pch/component_model_async to main.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2022 at 20:40):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2022 at 20:40):

alexcrichton merged PR #5055.


Last updated: Nov 22 2024 at 17:03 UTC