[Stack Switching] GUFA: Fix closed world analysis of continuation functions#7844
[Stack Switching] GUFA: Fix closed world analysis of continuation functions#7844kripken merged 9 commits intoWebAssembly:mainfrom
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.
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.
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.
This should never happen, unless I'm missing something special about GUFA?
There was a problem hiding this comment.
This is similar to the logic for call_indirect/ref:
binaryen/src/ir/possible-contents.cpp
Lines 815 to 821 in 920ea76
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.
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.