-
Notifications
You must be signed in to change notification settings - Fork 786
[Shared-Everything] ArrayRMW and ArrayCmpxchg #7632
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
Changes from 29 commits
778aa2e
8e66d70
f3c90a9
e23e196
0635303
4d7c7e2
53b910e
0c7a6f3
ca42d28
b22b456
20516a7
2b1b84c
e362037
33b2c2e
fe2611a
cc6fd35
1102d33
a98365d
03070b7
4cc3063
4f3defa
086fc0b
560d7db
41f0a82
7584e2b
ad2f5a5
5ba60b3
bced169
d56bf77
347595c
af6dea2
5db6b29
be927ff
2e650b8
10e8a84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -399,6 +399,21 @@ struct SubtypingDiscoverer : public OverriddenVisitor<SubType> { | |
auto* seg = self()->getModule()->getElementSegment(curr->segment); | ||
self()->noteSubtype(seg->type, array.element.type); | ||
} | ||
void visitArrayRMW(ArrayRMW* curr) { | ||
if (!curr->ref->type.isArray()) { | ||
return; | ||
} | ||
auto array = curr->ref->type.getHeapType().getArray(); | ||
self()->noteSubtype(curr->value, array.element.type); | ||
} | ||
void visitArrayCmpxchg(ArrayCmpxchg* curr) { | ||
if (!curr->ref->type.isArray()) { | ||
return; | ||
} | ||
auto array = curr->ref->type.getHeapType().getArray(); | ||
self()->noteSubtype(curr->expected, array.element.type); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't seem right. The expected value should be allowed to be a supertype of the element type, so it should only be required to be a subtype of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed both. Though it seems the spec could be more strict here..? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This way is actually better for us. See the discussion at WebAssembly/shared-everything-threads#92. |
||
self()->noteSubtype(curr->replacement, array.element.type); | ||
} | ||
void visitRefAs(RefAs* curr) { | ||
if (curr->op == RefAsNonNull) { | ||
self()->noteCast(curr->value, curr); | ||
|
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.
This should be
eqref
iftype
is a reference andtype
otherwise. I see this is wrong forStructCmpxchg
as well.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.
Fixed both.