-
Notifications
You must be signed in to change notification settings - Fork 871
Updated waitqueue support #8672
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
base: main
Are you sure you want to change the base?
Changes from all commits
ec73bbe
7cacf10
0d52cee
3d0ee2f
7a01e72
84e0adf
6689195
38127ac
5806dd5
8afc250
f4c3d54
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 |
|---|---|---|
|
|
@@ -1037,21 +1037,15 @@ template<typename Subtype> struct ChildTyper : OverriddenVisitor<Subtype> { | |
| } | ||
|
|
||
| note(&curr->ref, Type(*ht, Nullable)); | ||
| note(&curr->waitqueue, Type(HeapType::waitqueue, Nullable)); | ||
|
Member
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. The waitqueue heap type should be shared here. |
||
| note(&curr->expected, Type(Type::BasicType::i32)); | ||
| note(&curr->timeout, Type(Type::BasicType::i64)); | ||
| } | ||
|
|
||
| void visitStructNotify(StructNotify* curr, | ||
| std::optional<HeapType> ht = std::nullopt) { | ||
| if (!ht) { | ||
| if (!curr->ref->type.isStruct()) { | ||
| self().noteUnknown(); | ||
| return; | ||
| } | ||
| ht = curr->ref->type.getHeapType(); | ||
| } | ||
| void visitWaitqueueNew(WaitqueueNew* curr) {} | ||
|
|
||
| note(&curr->ref, Type(*ht, Nullable)); | ||
| void visitWaitqueueNotify(WaitqueueNotify* curr) { | ||
| note(&curr->waitqueue, Type(HeapType::waitqueue, Nullable)); | ||
|
Member
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. And here. |
||
| note(&curr->count, Type(Type::BasicType::i32)); | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -454,7 +454,10 @@ struct CodeScanner : PostWalker<CodeScanner> { | |
| void visitStructGet(StructGet* curr) { info.note(curr->ref->type); } | ||
| void visitStructSet(StructSet* curr) { info.note(curr->ref->type); } | ||
| void visitStructWait(StructWait* curr) { info.note(curr->ref->type); } | ||
| void visitStructNotify(StructNotify* curr) { info.note(curr->ref->type); } | ||
| void visitWaitqueueNew(WaitqueueNew* curr) { info.note(curr->type); } | ||
| void visitWaitqueueNotify(WaitqueueNotify* curr) { | ||
| info.note(curr->waitqueue->type); | ||
| } | ||
|
Comment on lines
+457
to
+460
Member
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. No need to have visitors for waitqueue.new and waitqueue.notify. They don't have type immediates in the binary or text formats and they don't use any defined types that we have to make sure to keep around. |
||
| void visitArrayGet(ArrayGet* curr) { info.note(curr->ref->type); } | ||
| void visitArraySet(ArraySet* curr) { info.note(curr->ref->type); } | ||
| void visitContBind(ContBind* curr) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,6 +47,7 @@ struct GenerativityScanner : public PostWalker<GenerativityScanner> { | |
| void visitArrayNewElem(ArrayNewElem* curr) { generative = true; } | ||
| void visitArrayNewFixed(ArrayNewFixed* curr) { generative = true; } | ||
| void visitContNew(ContNew* curr) { generative = true; } | ||
| void visitWaitqueueNew(WaitqueueNew* curr) { generative = true; } | ||
|
Member
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. notify should probably also be considered generative, since calling it more than once can produce different results each time. Although it looks like the linear memory notify is not considered generative... Maybe just a TODO for now, then. |
||
| }; | ||
|
|
||
| } // anonymous namespace | ||
|
|
@@ -73,7 +74,7 @@ bool isShallowlyGenerative(Expression* curr, Function* func, Module& wasm) { | |
| static bool isValidInConstantExpression(Module& wasm, Expression* expr) { | ||
| if (isSingleConstantExpression(expr) || expr->is<StructNew>() || | ||
| expr->is<ArrayNew>() || expr->is<ArrayNewFixed>() || expr->is<RefI31>() || | ||
| expr->is<StringConst>()) { | ||
| expr->is<StringConst>() || expr->is<WaitqueueNew>()) { | ||
| return true; | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.