mirror of
https://github.com/encounter/wasmtime.git
synced 2026-07-11 06:18:52 -07:00
0dee5a7f4d
* Enhance `typed-funcrefs.wast` test with more cases Have the same function with slightly different variations to compare codegen between the possible strategies. * Skip type checks on tables that don't need it This commit implements an optimization to skip type checks in `call_indirect` for tables that don't require it. With the function-references proposal it's possible to have tables of a single type of function as opposed to today's default `funcref` which is a heterogenous set of functions. In this situation it's possible that a `call_indirect`'s type tag matches the type tag of a `table`-of-typed-`funcref`-values, meaning that it's impossible for the type check to fail. The type check of a function pointer in `call_indirect` is refactored here to take the table's type into account. Various things are shuffled around to ensure that the right traps still show up in the right places but the important part is that, when possible, the type check is omitted entirely. * Update crates/cranelift/src/func_environ.rs Co-authored-by: Jamey Sharp <jamey@minilop.net> --------- Co-authored-by: Jamey Sharp <jamey@minilop.net>