Skip to content
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

Update handling of unreachable code and heap types #1734

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

alexcrichton
Copy link
Member

This commit updates validation of wasm modules with unreachable code using gc/heap types. It notably fixes cases with the shared-everything-threads proposal where existing instructions are polymorphic over shared and not and wasn't supported before. Specifically code was refactored to use MaybeType a bit more to propagate the bottom-ness and the MaybeType::HeapBot variant has grown a new AbstractHeapType payload for various instructions to use such as any.convert_extern.

This commit updates validation of wasm modules with unreachable code
using gc/heap types. It notably fixes cases with the
shared-everything-threads proposal where existing instructions are
polymorphic over `shared` and not and wasn't supported before.
Specifically code was refactored to use `MaybeType` a bit more to
propagate the bottom-ness and the `MaybeType::HeapBot` variant has grown
a new `AbstractHeapType` payload for various instructions to use such as
`any.convert_extern`.
@alexcrichton
Copy link
Member Author

I should also mention this is a product of the discussion on WebAssembly/shared-everything-threads#80

@alexcrichton alexcrichton added this pull request to the merge queue Aug 21, 2024
Copy link
Collaborator

@abrown abrown left a comment

Choose a reason for hiding this comment

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

Discussed elsewhere: swapping out Bot, HeapBot and Type with Unknown, PartialRef, and Known could clarify the use of MaybeType a bit.

Merged via the queue into bytecodealliance:main with commit 848e4de Aug 21, 2024
28 checks passed
@alexcrichton alexcrichton deleted the new-heap-bot branch August 21, 2024 21:49
abrown added a commit that referenced this pull request Aug 22, 2024
This tweaks #1734 to use terms I consider a bit more clear. It also
updates the documentation to explain some more of the context that I
currently have paged in but may not later.
github-merge-queue bot pushed a commit that referenced this pull request Sep 9, 2024
* Rename `MaybeType` variants, tweak documentation

This tweaks #1734 to use terms I consider a bit more clear. It also
updates the documentation to explain some more of the context that I
currently have paged in but may not later.

* review: tweak naming for @fitzgen
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.

3 participants