Stream: git-wasmtime

Topic: wasmtime / PR #1491 Optimize codegen in `Func::wrap`


view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2020 at 19:23):

alexcrichton opened PR #1491 from optimize-func-wrap to master:

This commit optimizes the codegen of Func::wrap such that if you do
something like Func::wrap(&store, || {}) then the shim generated
contains zero code (as expected). In general this means that the extra
tidbits generated by wasmtime are all eligible to be entirely optimized
away so long as you don't actually rely on something.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 10 2020 at 16:28):

alexcrichton requested fitzgen for a review on PR #1491.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 10 2020 at 17:35):

fitzgen submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 10 2020 at 17:35):

fitzgen submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 10 2020 at 17:35):

fitzgen created PR Review Comment:

Seems a little simpler/more concise as

debug_assert!(state.is::<(F, Store)>());
let (func, store) = &*(state as *const _ as *const (F, Store));

view this post on Zulip Wasmtime GitHub notifications bot (Apr 10 2020 at 17:51):

alexcrichton updated PR #1491 from optimize-func-wrap to master:

This commit optimizes the codegen of Func::wrap such that if you do
something like Func::wrap(&store, || {}) then the shim generated
contains zero code (as expected). In general this means that the extra
tidbits generated by wasmtime are all eligible to be entirely optimized
away so long as you don't actually rely on something.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 10 2020 at 17:52):

alexcrichton merged PR #1491.


Last updated: Nov 22 2024 at 16:03 UTC