Skip to content

Conversation

@tlively
Copy link
Member

@tlively tlively commented Feb 5, 2026

Take into account the implicit casts and conversions that happen on the
boundary with JS as well as the fact that JS can essentially read the
first field on descriptors with configured prototypes.

@tlively tlively marked this pull request as draft February 5, 2026 07:14
Take into account the implicit casts and conversions that happen on the
boundary with JS as well as the fact that JS can essentially read the
first field on descriptors with configured prototypes.
@tlively tlively force-pushed the fix-gto-unsubypting-configure-all branch from 3d31e7e to 224c6c9 Compare February 9, 2026 23:54
@tlively tlively marked this pull request as ready for review February 9, 2026 23:55
@tlively tlively requested a review from kripken February 9, 2026 23:55
@tlively tlively changed the title [WIP] Fix Unsubtyping and GTO for configureAll Fix Unsubtyping and GTO for configureAll Feb 10, 2026

// Whether this is a struct type whose first field is immutable and a subtype
// of externref.
bool hasPossibleJSPrototypeField() const;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like a somewhat specific property beyond the core type system - perhaps it can go in struct-utils.h?

if (!curr->value->type.isRef()) {
return;
}
auto exact = curr->value->type.getExactness();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can move this into the if.

return;
}
for (auto func : Intrinsics(wasm).getConfigureAllFunctions()) {
for (auto type : wasm.getFunction(func)->getResults()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add a comment here as to why only the results matter?

// This descriptor will expose a prototype to JS, so we must keep
// it.
noteDescriptor(heapType, *desc);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the cast symmetric in params and results, but the prototype only appears for the results?

collectedInfo.casts.insert({src, dst});
}
dsts.clear();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an unrelated fix?

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