[threads] Simplify and generalize reftype writing without GC#6766
Merged
[threads] Simplify and generalize reftype writing without GC#6766
Conversation
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.
kripken
reviewed
Jul 18, 2024
src/wasm/wasm-binary.cpp
Outdated
| return; | ||
| auto ht = type.getHeapType(); | ||
| if (ht.isBasic() && ht.getBasic(Unshared) == HeapType::string) { | ||
| // Do not overgeneralize stringref to anyref. |
Member
Author
There was a problem hiding this comment.
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.
Member
There was a problem hiding this comment.
Sounds good. Please add a comment though as the special-casing here looks surprising. lgtm with that.
kripken
approved these changes
Jul 18, 2024
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.