-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Fix unboxing stubs on wasm #120153
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
Fix unboxing stubs on wasm #120153
Conversation
Tagging subscribers to this area: @mangod9 |
This allows following code to run
|
Co-authored-by: Jan Kotas <[email protected]> Co-authored-by: Aaron Robinson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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
|
Co-authored-by: Jan Kotas <[email protected]>
Co-authored-by: Jan Kotas <[email protected]>
// need to free the Stub allocation now. | ||
pStub->DecRef(); | ||
} | ||
#endif // !FEATURE_PORTABLE_ENTRYPOINTS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#endif // !FEATURE_PORTABLE_ENTRYPOINTS | |
#endif // FEATURE_PORTABLE_ENTRYPOINTS |
_ASSERTE(ilStubInterpData != NULL); | ||
SetInterpreterCode((InterpByteCodeStart*)ilStubInterpData); | ||
SetCodeEntryPoint(pCode); | ||
#else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#else | |
#else // FEATURE_PORTABLE_ENTRYPOINTS |
Fix #120092