Skip to content

Conversation

kripken
Copy link
Member

@kripken kripken commented Aug 19, 2025

As #7841 but for GUFA.

@kripken kripken requested a review from tlively August 19, 2025 16:32
Comment on lines +1279 to +1280
// 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.
Copy link
Member

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.

Copy link
Member Author

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.

Comment on lines +1285 to +1286
if (!targetType.isSignature()) {
assert(targetType.isBottom());
Copy link
Member

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?

Copy link
Member Author

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:

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.

Copy link
Member

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.

@kripken kripken merged commit 00aae63 into WebAssembly:main Aug 19, 2025
16 checks passed
@kripken kripken deleted the cont.rume branch August 19, 2025 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants