Skip to content

Conversation

@kripken
Copy link
Member

@kripken kripken commented Dec 9, 2025

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 kripken requested a review from tlively December 9, 2025 23:50
Comment on lines 451 to 452
// Subtyping info.
SubTypes* subTypes;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a reference here to make it impossible to fail to initialize this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@kripken kripken merged commit 2d61760 into WebAssembly:main Dec 11, 2025
17 checks passed
@kripken kripken deleted the gufa.func.sub branch December 11, 2025 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants