Skip to content

Conversation

tlively
Copy link
Member

@tlively tlively commented Jul 17, 2024

Similar to #6765, but for types instead of heap types. Generalize the
logic for transforming written reference types to types that are
supported without GC so that it will automatically handle shared types
and other new types correctly.

Similar to #6765, but for types instead of heap types. Generalize the logic for transforming written reference types to types that are supported without GC so that it will automatically handle shared types and other new types correctly.
@tlively tlively requested a review from kripken July 17, 2024 23:57
return;
auto ht = type.getHeapType();
if (ht.isBasic() && ht.getBasic(Unshared) == HeapType::string) {
// Do not overgeneralize stringref to anyref.
Copy link
Member

Choose a reason for hiding this comment

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

Why not?

Copy link
Member Author

Choose a reason for hiding this comment

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

We actually already have a couple tests for this case, and I wanted to avoid breaking them. It's admittedly a little odd (i.e. definitely wrong) that we're ok generalizing none to any even in cases where it is used for null strings, but we're not ok with generalizing stringref itself to anyref, but I don't think it's a big deal in practice since stringref effectively does not exist.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good. Please add a comment though as the special-casing here looks surprising. lgtm with that.

@tlively tlively requested a review from kripken July 18, 2024 16:58
@tlively tlively merged commit 0843618 into main Jul 18, 2024
@tlively tlively deleted the threads-write-type-no-gc branch July 18, 2024 17:54
@gkdn gkdn mentioned this pull request Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants