Skip to content

wasmparser(CM+GC): Allow declaring a core function type when lowering #2166

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

Merged
merged 2 commits into from
Apr 29, 2025

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Apr 28, 2025

When lowering a component function into a core function, allow the declaration of which core function type the lowered function (or lowered CM intrinsic) should have. Right now, this is effectively just double checking that the declared type matches the actual lowered type. After future PRs, this will allow declaring a Wasm GC-using function type, and lowering will adjust accordingly. This also lets the Wasm declare which of the "equivalent" function types it wants to lower to in the case that there are multiple rec groups containing the "same" function type, or in the face of function type subtyping. Again, subsequent PRs will start adding support for rec groups and subtyping and such to CM core types.

When lowering a component function into a core function, allow the declaration
of which core function type the lowered function (or lowered CM intrinsic)
should have. Right now, this is effectively just double checking that the
declared type matches the actual lowered type. After future PRs, this will allow
declaring a Wasm GC-using function type, and lowering will adjust
accordingly. This also lets the Wasm declare which of the "equivalent" function
types it wants to lower to in the case that there are multiple rec groups
containing the "same" function type, or in the face of function type
subtyping. Again, subsequent PRs will start adding support for rec groups and
subtyping and such to CM core types.
@fitzgen fitzgen requested a review from alexcrichton April 28, 2025 23:32
@alexcrichton
Copy link
Member

Ah the test failures are something I was slightly worried about where this is peeking for just core and not core type which is ambiguous with (core func ...) and I wasn't sure if we used that anywhere, but looks like we do in task.return

@fitzgen
Copy link
Member Author

fitzgen commented Apr 28, 2025

Yeah I am renaming the canonical option to core-type to work around this

@fitzgen fitzgen enabled auto-merge April 29, 2025 00:00
@fitzgen fitzgen added this pull request to the merge queue Apr 29, 2025
Merged via the queue into bytecodealliance:main with commit 7133059 Apr 29, 2025
32 checks passed
@fitzgen fitzgen deleted the core-type-canonical-option branch April 29, 2025 00:11
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