-
Notifications
You must be signed in to change notification settings - Fork 825
[threads] ref.i31_shared #6735
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
[threads] ref.i31_shared #6735
Conversation
src/wasm.h
Outdated
| RefI31() = default; | ||
| RefI31(MixedArena& allocator) {} | ||
|
|
||
| Shareability share; |
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.
Can this not be part of the type? We don't seem to have such a field on anything else.
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.
Hmm, I guess it could.
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.
See the last commmit for this change.
Implement `ref.i31_shared` the new instruction for creating references to shared i31s. Implement binary and text parsing and emitting as well as interpretation. Copy the upstream spec test for i31 and modify it so that all the heap types are shared. Comment out some parts that we do not yet support.
6fadc97 to
f05017d
Compare
src/passes/Print.cpp
Outdated
| void visitRefI31(RefI31* curr) { printMedium(o, "ref.i31"); } | ||
| void visitRefI31(RefI31* curr) { | ||
| printMedium( | ||
| o, curr->type.getHeapType().isShared() ? "ref.i31_shared" : "ref.i31"); |
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 think you may need to guard here against curr->type being unreachable (when the i32 child is unreachable), in which case getHeapType errors.
Implement
ref.i31_sharedthe new instruction for creating referencesto shared i31s. Implement binary and text parsing and emitting as well
as interpretation. Copy the upstream spec test for i31 and modify it so
that all the heap types are shared. Comment out some parts that we do
not yet support.