Fix unboxing stubs on wasm#120153
Merged
radekdoulik merged 13 commits intodotnet:mainfrom Sep 28, 2025
Merged
Conversation
Contributor
|
Tagging subscribers to this area: @mangod9 |
Member
Author
|
This allows following code to run |
jkotas
reviewed
Sep 26, 2025
Co-authored-by: Jan Kotas <jkotas@microsoft.com> Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes unboxing stubs on WebAssembly by restructuring the IL stub generation to work properly with portable entrypoints. The fix addresses issue #120092 by modifying how unboxing stubs are created and handled in the CoreCLR runtime.
- Renamed and generalized the unboxing IL stub creation function to work with all value type methods, not just shared generic ones
- Added proper handling for portable entrypoints in the unboxing stub code path
- Added WebAssembly-specific assertion for unsupported shuffle array generation
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/coreclr/vm/prestub.cpp | Core changes to unboxing stub generation, function renaming, and portable entrypoint handling |
| src/coreclr/vm/comdelegate.cpp | Added WebAssembly assertion for unimplemented shuffle array generation |
| src/coreclr/clrdefinitions.cmake | Updated feature flag condition to exclude portable shuffle thunks when portable entrypoints are enabled |
jkotas
reviewed
Sep 26, 2025
Member
Author
|
I also added new thunk for the IL stub. I wonder if we can avoid that later. By replacing calli with call inside the stub? The compiled stub |
jkotas
reviewed
Sep 26, 2025
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
jkotas
reviewed
Sep 26, 2025
jkotas
reviewed
Sep 26, 2025
jkotas
reviewed
Sep 26, 2025
jkotas
approved these changes
Sep 26, 2025
This was referenced Sep 28, 2025
Member
jkotas
reviewed
Sep 28, 2025
| // need to free the Stub allocation now. | ||
| pStub->DecRef(); | ||
| } | ||
| #endif // !FEATURE_PORTABLE_ENTRYPOINTS |
Member
There was a problem hiding this comment.
Suggested change
| #endif // !FEATURE_PORTABLE_ENTRYPOINTS | |
| #endif // FEATURE_PORTABLE_ENTRYPOINTS |
| _ASSERTE(ilStubInterpData != NULL); | ||
| SetInterpreterCode((InterpByteCodeStart*)ilStubInterpData); | ||
| SetCodeEntryPoint(pCode); | ||
| #else |
Member
There was a problem hiding this comment.
Suggested change
| #else | |
| #else // FEATURE_PORTABLE_ENTRYPOINTS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #120092