-
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
Introduce CallConvSuppressGCTransition type to enable suppressing the transition frame for unmanaged function pointer calls #46343
Introduce CallConvSuppressGCTransition type to enable suppressing the transition frame for unmanaged function pointer calls #46343
Conversation
…s for IL stub callconv when SuppressGCTransition in use.
…n for modopts (Coreclr and crossgen1).
… non-inlinable calli.
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. |
src/tests/Interop/PInvoke/Attributes/SuppressGCTransition/SuppressGCTransitionTest.cs
Show resolved
Hide resolved
cc: @BrzVlad for the Mono interpreter failures on the updated test. |
@jkoritzinsky @BrzVlad @SamMonoRT I created #46451 to track Mono support for Edit: it's not really an interp failure, I think. I think it's the interop/marshaling code - the call to |
@lambdageek The crash happens because interp thinks it is doing a normal managed calli. In order to fix this, we would first need for the runtime to handle the unmanaged call convention (#38480). Setting pinvoke = TRUE for this type of signatures fixes the crash. We aren't trying to generate any m2n wrappers at this point, so further fixes would still be needed on interp side. |
38a9451
to
15c530e
Compare
@AaronRobinsonMSFT @jkotas @elinor-fung can you take another review pass? |
@@ -1384,16 +1387,6 @@ private void findSig(CORINFO_MODULE_STRUCT_* module, uint sigTOK, CORINFO_CONTEX | |||
|
|||
Get_CORINFO_SIG_INFO(methodSig, sig); | |||
|
|||
// TODO: Replace this with a public mechanism to mark calli with SuppressGCTransition once it becomes available. |
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.
I do not think that the replacement for this is part of this change, but it only affects nativeaot compiler. It is ok - we will fix in in the nativeaot branch.
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.
LGTM. Thanks!
Hello @jkoritzinsky! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
I added the flags back to the cache since it seems that they’re required to disambiguate between some stubs. |
Fixes #38134 for CoreCLR and crossgen2. This PR does not provide an implementation for Mono.