-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Support ByRefLike types as Generic parameters #67783
Support ByRefLike types as Generic parameters #67783
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Update CrossGen/NativeAOT type system to not block on ByRefLike generic. JITHelper for optimized box updated to branch if target is ByRefLike - Defer to slow JIT_Box that will throw.
Currently disabled for Mono.
b6d8b93
to
ac38c26
Compare
This reverts commit 92bd7af.
Rev Crossgen minor version. Update NativeAOT boxing helpers.
Remove new JIT helper. Special case ByRefLike types in the JIT during boxing.
@jakobbotsch and @jkotas Can you please take another look. Big thanks to @jakobbotsch for the offline help and code examples of what to do in the JIT. Very much appreciated. |
Looks better than before |
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.
A few nits and one question.
@jakobbotsch Any other feedback here? I'd appreciate a sign-off from the JIT side just so there is awareness on the changes in this code path. |
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.
JIT changes LGTM.
There is CORINFO_THIS_TRANSFORM::CORINFO_BOX_THIS
. Do we need to do anything special for it or will the VM never return it for byref-like types?
Nothing special. This should just fail naturally in the same way it has always failed since it is not valid for ByRefLike types. This is back to the general solution I originally envisioned vs the narrow approach we are now taking given what we actually need. |
* Add flag for ByRefLike generic constraint * Update ILAsm/ILDasm to support byreflike keyword * Runtime and Libraries tests * Cast defined int constant until managed API is approved.
Design - #67129
Contributes to #65112
Proposed managed API surface for this work - #68002