binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

[GC] GUFA: Handle function subtyping

Open kripken opened this issue 2 months ago • 0 comments

We were ignoring subtyping entirely, that is, the pass didn't realize that an indirect call to a type might call something of a subtype. That situation seems to not be common in practice, given we've never gotten a bug report.

We could fully optimize this as we do data reads and writes: we could consider the type of the flowing reference in CallRef (but not CallIndirect), etc. However, for now do the far simpler thing and use the static type to connect results to subtypes as needed.

For params, do something even simpler: Just hook them up at the type level, which ignores exactness (as this would require even more work to optimize, see TODO in the code).

kripken avatar Dec 09 '25 23:12 kripken