-
Notifications
You must be signed in to change notification settings - Fork 756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store HeapTypes in Tags #7220
Store HeapTypes in Tags #7220
Conversation
Tags in WebAssembly syntactically refer to function heap types, but Binaryen IR was previously storing signatures instead and reconstructing heap types as necessary when emitting binaries. Before WasmGC this was not a problem because the reconstructed types would be the same as the original types, but with WasmGC round tripping function types through Signature could lose information such as the rec group, the declared supertype, and the finality from the original type. Store the original heap type in the IR instead to stop losing this information. Fixes #7219.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm % comments
o << ')' << maybeNewLine; | ||
} | ||
|
||
void PrintSExpression::printTagType(HeapType type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like handleSignature
(used for Function) is similar - can we share this code perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take another look at it. At first glance the existence of parameter names for functions made it seem writing separate code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I think it's more trouble than it's worth right now.
Co-authored-by: Alon Zakai <azakai@google.com>
Tags in WebAssembly syntactically refer to function heap types, but
Binaryen IR was previously storing signatures instead and reconstructing
heap types as necessary when emitting binaries. Before WasmGC this was
not a problem because the reconstructed types would be the same as the
original types, but with WasmGC round tripping function types through
Signature could lose information such as the rec group, the declared
supertype, and the finality from the original type. Store the original
heap type in the IR instead to stop losing this information.
Fixes #7219.