Skip to content

Conversation

kripken
Copy link
Member

@kripken kripken commented Sep 18, 2025

No description provided.

Copy link
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

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

It's not enough to check that we have a single global for the descriptor type; we must also check that there are no allocations of that descriptor type besides the initializer for that one global.

@kripken
Copy link
Member Author

kripken commented Sep 19, 2025

That is something the pass verifies,

// We cannot optimize types that appear in a struct.new in a function, which
// we just collected and merge now.
HeapTypes unoptimizable;

Unless I misunderstood you?

@tlively
Copy link
Member

tlively commented Sep 19, 2025

Great, I had forgotten we already did that.

@kripken
Copy link
Member Author

kripken commented Sep 19, 2025

There are some TODOs here, but the larger question is whether this seems worthwhile. I see a 1% code size regression on j2cl for example - do we expect the benefit to be larger than that? @tlively @jakobkummerow

@tlively
Copy link
Member

tlively commented Sep 19, 2025

This is primarily a performance improvement. ref.cast_desc is faster than other casts.

@kripken
Copy link
Member Author

kripken commented Sep 19, 2025

Makes sense, but do we think it is fast enough to justify a 1% size regression? Given that iiuc we think the VM can do much of this too.

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