rylev opened PR #7065 from rylev:type-check-handle
to bytecodealliance:main
:
Paired with @alexcrichton
This fixes an issue that makes it impossible to call another component's exported function from the body of wrapped function import (using something like
Instance::func_new
) even when that exported function has the same structural signature as the wrapped import.That's because type checking was done assuming that the types in question were coming from the same component (or more specifically the same types arena). This changes to first try to do the quick and inexpensive call of pointer equality followed by a more expensive walk of two types for structural equality.
rylev requested pchickey for a review on PR #7065.
rylev requested wasmtime-core-reviewers for a review on PR #7065.
rylev created PR review comment:
One thing I was unsure of: are flags types with names in different orders the same type?
rylev submitted PR review.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
s/self/other/
alexcrichton submitted PR review:
:+1:
alexcrichton submitted PR review:
:+1:
alexcrichton created PR review comment:
For the purposes of equivalence here in Wasmtime we'll need to require that the fields are in the exact same order. Lifting/lowering relies on this right now since the
HashMap
reordering of fields isn't really implemented anywhere except adapter trampolines, and even that's on its way out sorta.
alexcrichton created PR review comment:
Same thing about order as above
alexcrichton created PR review comment:
More-or-less yes it's ok to reorder but for the component model MVP we're going to require exact equivalence
alexcrichton created PR review comment:
Like above we'll need to check the cases in order
alexcrichton created PR review comment:
Truncated comment?
rylev updated PR #7065.
rylev requested alexcrichton for a review on PR #7065.
alexcrichton submitted PR review.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
oh here we'll still want to check field names as opposed to just types
rylev updated PR #7065.
rylev submitted PR review.
rylev created PR review comment:
Gah sorry - made the change too quickly... Fixed.
rylev requested alexcrichton for a review on PR #7065.
alexcrichton submitted PR review.
alexcrichton merged PR #7065.
Last updated: Dec 23 2024 at 12:05 UTC