diff options
Diffstat (limited to 'src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/InteropHelpers.cs')
-rw-r--r-- | src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/InteropHelpers.cs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/InteropHelpers.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/InteropHelpers.cs index 8e383b44d85..f5367d848d4 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/InteropHelpers.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/InteropHelpers.cs @@ -9,6 +9,7 @@ using System.Reflection; using System.Runtime; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Runtime.InteropServices.ObjectiveC; using System.Runtime.Loader; using System.Text; using System.Threading; @@ -342,6 +343,17 @@ namespace Internal.Runtime.CompilerHelpers byte* methodName = (byte*)pCell->MethodName; IntPtr pTarget; +#if FEATURE_OBJCMARSHAL +#pragma warning disable CA1416 + if (pCell->IsObjectiveCMessageSend && ObjectiveCMarshal.TryGetGlobalMessageSendCallback(pCell->ObjectiveCMessageSendFunction, out pTarget)) + { + Debug.Assert(pTarget != IntPtr.Zero); + pCell->Target = pTarget; + return; + } +#pragma warning restore CA1416 +#endif + #if TARGET_WINDOWS CharSet charSetMangling = pCell->CharSetMangling; if (charSetMangling == 0) @@ -613,7 +625,11 @@ namespace Internal.Runtime.CompilerHelpers public IntPtr Target; public IntPtr MethodName; public ModuleFixupCell* Module; - public CharSet CharSetMangling; + private int Flags; + + public CharSet CharSetMangling => (CharSet)(Flags & MethodFixupCellFlagsConstants.CharSetMask); + public bool IsObjectiveCMessageSend => (Flags & MethodFixupCellFlagsConstants.IsObjectiveCMessageSendMask) != 0; + public int ObjectiveCMessageSendFunction => (Flags & MethodFixupCellFlagsConstants.ObjectiveCMessageSendFunctionMask) >> MethodFixupCellFlagsConstants.ObjectiveCMessageSendFunctionShift; } internal unsafe struct CustomMarshallerKey : IEquatable<CustomMarshallerKey> |