-
Notifications
You must be signed in to change notification settings - Fork 816
[Stack Switching] GUFA: Fix closed world analysis of continuation functions #7844
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
Conversation
// The function reference that is passed in here will be called, just as if | ||
// we were a call_ref, except at a potentially later time. |
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.
Alternatively we could collect funcref contents used to allocate each continuation type (using a heap type location?), then only mark them as called when we see a resume
on their continuation 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.
Yes, this could definitely be improved. The TODOs are for that. What makes this kind of annoying to do is that cont.bind changes the types... so that will need some care.
if (!targetType.isSignature()) { | ||
assert(targetType.isBottom()); |
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 never happen, unless I'm missing something special about GUFA?
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 is similar to the logic for call_indirect/ref:
binaryen/src/ir/possible-contents.cpp
Lines 815 to 821 in 920ea76
template<typename T> void handleIndirectCall(T* curr, HeapType targetType) { | |
// If the heap type is not a signature, which is the case for a bottom type | |
// (null) then nothing can be called. | |
if (!targetType.isSignature()) { | |
assert(targetType.isBottom()); | |
return; | |
} |
It handles the case of (cont.new (ref.null))
. Given we've ruled out unreachable earlier, all that is left is either a proper Signature type, or a null/bottom.
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.
Oh I see, we're looking at the operand's function type rather than getting the function type from the continuation type.
As #7841 but for GUFA.