In #38357, a new calling convention value is added to function signatures. Mono should not crash when we see this value in assemblies.
The runtime should basically treat it the same as cdecl on non-Windows platforms (and on Windows for .net 5, too).
When the execution engine sees the calli fsig IL instruction, we will need to look for unmanaged in fsig and do a GC transition around the call.
Next, a modopt on the return type of the signature will encode details of the calling convention #34805
Finally, if the unmanaged calling convention modopts have CallConvSuppressGCTransition as one of the options, we can drop the GC transition around the indirect call.
Tasks:
In #38357, a new calling convention value is added to function signatures. Mono should not crash when we see this value in assemblies.
The runtime should basically treat it the same as cdecl on non-Windows platforms (and on Windows for .net 5, too).
When the execution engine sees the
calli fsigIL instruction, we will need to look forunmanagedinfsigand do a GC transition around the call.Next, a
modopton the return type of the signature will encode details of the calling convention #34805Finally, if the unmanaged calling convention modopts have
CallConvSuppressGCTransitionas one of the options, we can drop the GC transition around the indirect call.Tasks:
ikdasmandmonodiswork correctlypinvokebit on signatures that encodeunmanagedcalling convention (PR [Mono][jit] Emit GC transitions for "calli unmanaged" instructions #46491)calliinstruction that has pinvoke set. (PR [Mono][jit] Emit GC transitions for "calli unmanaged" instructions #46491)delegate* unmanaged[SuppressGCTransition]- [Mono] Implement support for CallConvSuppressGCTransition #46451 (PR Mono: support CallConvSuppressGCTransition #47006)calliinstructions with the pinvoke bit set. (PR [interp] Add wrapper for calli to native pointer #57119)