[ReflectionBlocked]
public struct OpenMethodResolver : IEquatable<OpenMethodResolver>
{
+ // Lazy initialized to point to the type loader method when the first `GVMResolve` resolver is created
+ private static unsafe delegate*<object, RuntimeMethodHandle, nint> s_lazyGvmLookupForSlot;
+
public const short DispatchResolve = 0;
public const short GVMResolve = 1;
public const short OpenNonVirtualResolve = 2;
_handle = handle;
_readerGCHandle = readerGCHandle;
_nonVirtualOpenInvokeCodePointer = IntPtr.Zero;
+
+ if (s_lazyGvmLookupForSlot == null)
+ s_lazyGvmLookupForSlot = &TypeLoaderExports.GVMLookupForSlot;
}
public OpenMethodResolver(RuntimeTypeHandle declaringType, IntPtr codePointer, GCHandle readerGCHandle, int handle)
}
else if (_resolveType == GVMResolve)
{
- return TypeLoaderExports.GVMLookupForSlot(thisObject, GVMMethodHandle);
+ return s_lazyGvmLookupForSlot(thisObject, GVMMethodHandle);
}
else
{