Uh oh!
There was an error while loading. Please reload this page.
Support ByRefLike types as Generic parameters - #67783
Conversation
ghost
commented
Apr 8, 2022
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. |
Uh oh!
There was an error while loading. Please reload this page.
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
ac38c26CompareUh oh!
There was an error while loading. Please reload this page.
This reverts commit 92bd7af.
Rev Crossgen minor version. Update NativeAOT boxing helpers.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Remove new JIT helper. Special case ByRefLike types in the JIT during boxing.
AaronRobinsonMSFT
commented
Apr 15, 2022
@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. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jkotas
commented
Apr 15, 2022
Looks better than before |
jakobbotsch
left a comment
There was a problem hiding this comment.
A few nits and one question.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
AaronRobinsonMSFT
commented
Apr 18, 2022
@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. |
jakobbotsch
left a comment
There was a problem hiding this comment.
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?
AaronRobinsonMSFT
commented
Apr 18, 2022
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