Skip to content

Conversation

@kripken
Copy link
Member

@kripken kripken commented Oct 10, 2025

In that case we need to consider subtypes.

@kripken kripken requested a review from tlively October 10, 2025 00:41
// The descriptor is abstract, but it has a subtype that is not
// (which we want to optimize to). We know this will only succeed if
// we receive the subtype of the described type, so that that
// descriptor is fetched. Add a cast so that we validate.
Copy link
Member

Choose a reason for hiding this comment

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

As a follow-up, we can get rid of this cast (and if I'm not mistaken, this entire visitor) by inferring that a described type must not be instantiated if its descriptor type is uninstantiated.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was thinking that, yeah, we can infer abstractness from descriptors to described...

Copy link
Member Author

Choose a reason for hiding this comment

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

I suspect though that other optimizations handle this (if the descriptor is not instantiated, eventually we infer all creations of the described receive null descriptors and hence trap, get removed, and the type becomes abstract).

Copy link
Member

Choose a reason for hiding this comment

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

Yep, but I think cutting down on the iterations required to reach a good state is still useful, especially when it can make our code simpler as well.

@kripken kripken enabled auto-merge (squash) October 10, 2025 00:59
@kripken kripken merged commit c326e66 into WebAssembly:main Oct 10, 2025
16 checks passed
@kripken kripken deleted the atr.sub.inex branch October 10, 2025 01:26
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