diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimePropertyInfo.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimePropertyInfo.cs index 2d542fb78ee101..51b1f84864b1a9 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimePropertyInfo.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimePropertyInfo.cs @@ -107,7 +107,7 @@ internal bool EqualsSig(RuntimePropertyInfo target) Debug.Assert(this != target); Debug.Assert(this.ReflectedType == target.ReflectedType); - return Signature.CompareSig(this.Signature, target.Signature); + return Signature.AreEqual(this.Signature, target.Signature); } internal BindingFlags BindingFlags => m_bindingFlags; #endregion diff --git a/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs b/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs index 236078b88c5679..a1907fd90df765 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs @@ -514,11 +514,45 @@ internal static IntroducedMethodEnumerator GetIntroducedMethods(RuntimeType type [MethodImpl(MethodImplOptions.InternalCall)] private static extern void GetNextIntroducedMethod(ref RuntimeMethodHandleInternal method); - [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern bool GetFields(RuntimeType type, IntPtr* result, int* count); + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetFields")] + private static partial Interop.BOOL GetFields(MethodTable* pMT, Span data, ref int usedCount); - [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern Type[]? GetInterfaces(RuntimeType type); + internal static bool GetFields(RuntimeType type, Span buffer, out int count) + { + Debug.Assert(!IsGenericVariable(type)); + + TypeHandle typeHandle = type.GetNativeTypeHandle(); + if (typeHandle.IsTypeDesc) + { + count = 0; + return true; + } + + int countLocal = buffer.Length; + bool success = GetFields(typeHandle.AsMethodTable(), buffer, ref countLocal) != Interop.BOOL.FALSE; + GC.KeepAlive(type); + count = countLocal; + return success; + } + + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetInterfaces")] + private static unsafe partial void GetInterfaces(MethodTable* pMT, ObjectHandleOnStack result); + + internal static Type[] GetInterfaces(RuntimeType type) + { + Debug.Assert(!IsGenericVariable(type)); + + TypeHandle typeHandle = type.GetNativeTypeHandle(); + if (typeHandle.IsTypeDesc) + { + return []; + } + + Type[] result = []; + GetInterfaces(typeHandle.AsMethodTable(), ObjectHandleOnStack.Create(ref result)); + GC.KeepAlive(type); + return result; + } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetConstraints")] private static partial void GetConstraints(QCallTypeHandle handle, ObjectHandleOnStack types); @@ -1859,10 +1893,11 @@ internal static int GetMDStreamVersion(RuntimeModule module) public int MDStreamVersion => GetMDStreamVersion(GetRuntimeModule()); } - internal sealed unsafe class Signature + internal sealed unsafe partial class Signature { #region FCalls [MemberNotNull(nameof(m_arguments))] + [MemberNotNull(nameof(m_declaringType))] [MemberNotNull(nameof(m_returnTypeORfieldType))] [MethodImpl(MethodImplOptions.InternalCall)] private extern void GetSignature( @@ -1875,7 +1910,7 @@ private extern void GetSignature( // Keep the layout in sync with SignatureNative in the VM // internal RuntimeType[] m_arguments; - internal RuntimeType? m_declaringType; + internal RuntimeType m_declaringType; internal RuntimeType m_returnTypeORfieldType; internal object? m_keepalive; internal void* m_sig; @@ -1923,8 +1958,17 @@ public Signature(void* pCorSig, int cCorSig, RuntimeType declaringType) internal RuntimeType ReturnType => m_returnTypeORfieldType; internal RuntimeType FieldType => m_returnTypeORfieldType; - [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern bool CompareSig(Signature sig1, Signature sig2); + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Signature_AreEqual")] + private static partial Interop.BOOL AreEqual( + void* sig1, int csig1, QCallTypeHandle type1, + void* sig2, int csig2, QCallTypeHandle type2); + + internal static bool AreEqual(Signature sig1, Signature sig2) + { + return AreEqual( + sig1.m_sig, sig1.m_csig, new QCallTypeHandle(ref sig1.m_declaringType), + sig2.m_sig, sig2.m_csig, new QCallTypeHandle(ref sig2.m_declaringType)) != Interop.BOOL.FALSE; + } internal Type[] GetCustomModifiers(int parameterIndex, bool required) => GetCustomModifiersAtOffset(GetParameterOffset(parameterIndex), required); diff --git a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs index b73f8263782e90..d1591d88036b28 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs @@ -826,30 +826,21 @@ private RuntimeFieldInfo[] PopulateFields(Filter filter) #endregion #region Populate Literal Fields on Interfaces + Type[] interfaces; if (ReflectedType.IsGenericParameter) { - Type[] interfaces = ReflectedType.BaseType!.GetInterfaces(); - - for (int i = 0; i < interfaces.Length; i++) - { - // Populate literal fields defined on any of the interfaces implemented by the declaring type - PopulateLiteralFields(filter, (RuntimeType)interfaces[i], ref list); - PopulateRtFields(filter, (RuntimeType)interfaces[i], ref list); - } + interfaces = ReflectedType.BaseType!.GetInterfaces(); } else { - Type[]? interfaces = RuntimeTypeHandle.GetInterfaces(ReflectedType); + interfaces = RuntimeTypeHandle.GetInterfaces(ReflectedType); + } - if (interfaces != null) - { - for (int i = 0; i < interfaces.Length; i++) - { - // Populate literal fields defined on any of the interfaces implemented by the declaring type - PopulateLiteralFields(filter, (RuntimeType)interfaces[i], ref list); - PopulateRtFields(filter, (RuntimeType)interfaces[i], ref list); - } - } + foreach (Type iface in interfaces) + { + // Populate literal fields defined on any of the interfaces implemented by the declaring type + PopulateLiteralFields(filter, (RuntimeType)iface, ref list); + PopulateRtFields(filter, (RuntimeType)iface, ref list); } #endregion @@ -858,25 +849,22 @@ private RuntimeFieldInfo[] PopulateFields(Filter filter) private unsafe void PopulateRtFields(Filter filter, RuntimeType declaringType, ref ListBuilder list) { - IntPtr* pResult = stackalloc IntPtr[64]; - int count = 64; - - if (!RuntimeTypeHandle.GetFields(declaringType, pResult, &count)) + Span result = stackalloc IntPtr[64]; + int count; + while (!RuntimeTypeHandle.GetFields(declaringType, result, out count)) { - fixed (IntPtr* pBigResult = new IntPtr[count]) - { - RuntimeTypeHandle.GetFields(declaringType, pBigResult, &count); - PopulateRtFields(filter, pBigResult, count, declaringType, ref list); - } + Debug.Assert(count > result.Length); + result = new IntPtr[count]; } - else if (count > 0) + + if (count > 0) { - PopulateRtFields(filter, pResult, count, declaringType, ref list); + PopulateRtFields(filter, result.Slice(0, count), declaringType, ref list); } } private unsafe void PopulateRtFields(Filter filter, - IntPtr* ppFieldHandles, int count, RuntimeType declaringType, ref ListBuilder list) + ReadOnlySpan fieldHandles, RuntimeType declaringType, ref ListBuilder list) { Debug.Assert(declaringType != null); Debug.Assert(ReflectedType != null); @@ -884,9 +872,9 @@ private unsafe void PopulateRtFields(Filter filter, bool needsStaticFieldForGeneric = declaringType.IsGenericType && !RuntimeTypeHandle.ContainsGenericVariables(declaringType); bool isInherited = declaringType != ReflectedType; - for (int i = 0; i < count; i++) + foreach (IntPtr handle in fieldHandles) { - RuntimeFieldHandleInternal runtimeFieldHandle = new RuntimeFieldHandleInternal(ppFieldHandles[i]); + RuntimeFieldHandleInternal runtimeFieldHandle = new RuntimeFieldHandleInternal(handle); if (filter.RequiresStringComparison()) { @@ -1017,23 +1005,19 @@ private RuntimeType[] PopulateInterfaces(Filter filter) if (!RuntimeTypeHandle.IsGenericVariable(declaringType)) { - Type[]? ifaces = RuntimeTypeHandle.GetInterfaces(declaringType); - - if (ifaces != null) + Type[] ifaces = RuntimeTypeHandle.GetInterfaces(declaringType); + foreach (Type iface in ifaces) { - for (int i = 0; i < ifaces.Length; i++) - { - RuntimeType interfaceType = (RuntimeType)ifaces[i]; - - if (filter.RequiresStringComparison()) - { - if (!filter.Match(RuntimeTypeHandle.GetUtf8Name(interfaceType))) - continue; - } + RuntimeType interfaceType = (RuntimeType)iface; - Debug.Assert(interfaceType.IsInterface); - list.Add(interfaceType); + if (filter.RequiresStringComparison()) + { + if (!filter.Match(RuntimeTypeHandle.GetUtf8Name(interfaceType))) + continue; } + + Debug.Assert(interfaceType.IsInterface); + list.Add(interfaceType); } if (ReflectedType.IsSZArray) diff --git a/src/coreclr/vm/callhelpers.cpp b/src/coreclr/vm/callhelpers.cpp index 3906d396c87f54..d926ff9d8d62c7 100644 --- a/src/coreclr/vm/callhelpers.cpp +++ b/src/coreclr/vm/callhelpers.cpp @@ -11,10 +11,6 @@ // To include declaration of "AppDomainTransitionExceptionFilter" #include "excep.h" - -// To include declaration of "SignatureNative" -#include "runtimehandles.h" - #include "invokeutil.h" #include "argdestination.h" diff --git a/src/coreclr/vm/ecalllist.h b/src/coreclr/vm/ecalllist.h index 5aff25d5caa72c..87e1178e0e97e9 100644 --- a/src/coreclr/vm/ecalllist.h +++ b/src/coreclr/vm/ecalllist.h @@ -91,8 +91,6 @@ FCFuncStart(gCOMTypeHandleFuncs) FCFuncElement("GetArrayRank", RuntimeTypeHandle::GetArrayRank) FCFuncElement("GetToken", RuntimeTypeHandle::GetToken) FCFuncElement("GetUtf8NameInternal", RuntimeTypeHandle::GetUtf8Name) - FCFuncElement("GetFields", RuntimeTypeHandle::GetFields) - FCFuncElement("GetInterfaces", RuntimeTypeHandle::GetInterfaces) FCFuncElement("GetAttributes", RuntimeTypeHandle::GetAttributes) FCFuncElement("GetNumVirtuals", RuntimeTypeHandle::GetNumVirtuals) FCFuncElement("CanCastTo", RuntimeTypeHandle::CanCastTo) @@ -135,7 +133,6 @@ FCFuncEnd() FCFuncStart(gSignatureNative) FCFuncElement("GetSignature", SignatureNative::GetSignature) - FCFuncElement("CompareSig", SignatureNative::CompareSig) FCFuncElement("GetParameterOffsetInternal", SignatureNative::GetParameterOffsetInternal) FCFuncElement("GetTypeParameterOffset", SignatureNative::GetTypeParameterOffset) FCFuncElement("GetCustomModifiersAtOffset", SignatureNative::GetCustomModifiersAtOffset) diff --git a/src/coreclr/vm/qcallentrypoints.cpp b/src/coreclr/vm/qcallentrypoints.cpp index a60d16dfb22218..f4f733d855c2c2 100644 --- a/src/coreclr/vm/qcallentrypoints.cpp +++ b/src/coreclr/vm/qcallentrypoints.cpp @@ -125,12 +125,14 @@ static const Entry s_QCall[] = DllImportEntry(RuntimeTypeHandle_GetModuleSlow) DllImportEntry(RuntimeTypeHandle_GetNumVirtualsAndStaticVirtuals) DllImportEntry(RuntimeTypeHandle_GetMethodAt) + DllImportEntry(RuntimeTypeHandle_GetFields) DllImportEntry(RuntimeTypeHandle_VerifyInterfaceIsImplemented) DllImportEntry(RuntimeTypeHandle_GetInterfaceMethodImplementation) DllImportEntry(RuntimeTypeHandle_GetDeclaringTypeHandleForGenericVariable) DllImportEntry(RuntimeTypeHandle_GetDeclaringTypeHandle) DllImportEntry(RuntimeTypeHandle_IsVisible) DllImportEntry(RuntimeTypeHandle_ConstructName) + DllImportEntry(RuntimeTypeHandle_GetInterfaces) DllImportEntry(RuntimeTypeHandle_GetInstantiation) DllImportEntry(RuntimeTypeHandle_Instantiate) DllImportEntry(RuntimeTypeHandle_GetGenericTypeDefinition) @@ -186,6 +188,7 @@ static const Entry s_QCall[] = DllImportEntry(ModuleHandle_GetPEKind) DllImportEntry(ModuleHandle_GetDynamicMethod) DllImportEntry(AssemblyHandle_GetManifestModuleSlow) + DllImportEntry(Signature_AreEqual) DllImportEntry(TypeBuilder_DefineGenericParam) DllImportEntry(TypeBuilder_DefineType) DllImportEntry(TypeBuilder_SetParentType) diff --git a/src/coreclr/vm/runtimehandles.cpp b/src/coreclr/vm/runtimehandles.cpp index 932c69fa34eb5a..42f1772e37d8c7 100644 --- a/src/coreclr/vm/runtimehandles.cpp +++ b/src/coreclr/vm/runtimehandles.cpp @@ -455,55 +455,39 @@ extern "C" MethodDesc* QCALLTYPE RuntimeTypeHandle_GetMethodAt(MethodTable* pMT, return pRetMethod; } -FCIMPL3(FC_BOOL_RET, RuntimeTypeHandle::GetFields, ReflectClassBaseObject *pTypeUNSAFE, INT32 **result, INT32 *pCount) { - CONTRACTL { - FCALL_CHECK; - } - CONTRACTL_END; - - REFLECTCLASSBASEREF refType = (REFLECTCLASSBASEREF)ObjectToOBJECTREF(pTypeUNSAFE); - if (refType == NULL) - FCThrowRes(kArgumentNullException, W("Arg_InvalidHandle")); - - TypeHandle typeHandle = refType->GetType(); - - if (!pCount || !result) - FCThrow(kArgumentNullException); +extern "C" BOOL QCALLTYPE RuntimeTypeHandle_GetFields(MethodTable* pMT, intptr_t* result, INT32* pCount) +{ + QCALL_CONTRACT; - if (typeHandle.IsGenericVariable()) - FCThrowRes(kArgumentException, W("Arg_InvalidHandle")); + _ASSERTE(pMT != NULL); + _ASSERTE(result != NULL); + _ASSERTE(pCount != NULL); - if (typeHandle.IsTypeDesc() || typeHandle.IsArray()) { - *pCount = 0; - FC_RETURN_BOOL(TRUE); - } + BOOL retVal = FALSE; - MethodTable *pMT= typeHandle.GetMethodTable(); - if (!pMT) - FCThrowRes(kArgumentException, W("Arg_InvalidHandle")); + BEGIN_QCALL; - BOOL retVal = FALSE; - HELPER_METHOD_FRAME_BEGIN_RET_1(refType); - // Check this approximation - we may be losing exact type information EncApproxFieldDescIterator fdIterator(pMT, ApproxFieldDescIterator::ALL_FIELDS, TRUE); INT32 count = (INT32)fdIterator.Count(); if (count > *pCount) { *pCount = count; + retVal = FALSE; } else { - for(INT32 i = 0; i < count; i ++) - result[i] = (INT32*)fdIterator.Next(); + for(INT32 i = 0; i < count; ++i) + result[i] = (intptr_t)fdIterator.Next(); *pCount = count; retVal = TRUE; } - HELPER_METHOD_FRAME_END(); - FC_RETURN_BOOL(retVal); + + END_QCALL; + + return retVal; } -FCIMPLEND extern "C" void QCALLTYPE RuntimeMethodHandle_ConstructInstantiation(MethodDesc * pMethod, DWORD format, QCall::StringHandleOnStack retString) { @@ -531,7 +515,50 @@ extern "C" void QCALLTYPE RuntimeTypeHandle_ConstructName(QCall::TypeHandle pTyp END_QCALL; } -PTRARRAYREF CopyRuntimeTypeHandles(TypeHandle * prgTH, INT32 numTypeHandles, BinderClassID arrayElemType) +extern "C" void QCALLTYPE RuntimeTypeHandle_GetInterfaces(MethodTable* pMT, QCall::ObjectHandleOnStack result) +{ + QCALL_CONTRACT; + + _ASSERTE(pMT != NULL); + + BEGIN_QCALL; + + INT32 ifaceCount = pMT->GetNumInterfaces(); + // Allocate the array + if (ifaceCount > 0) + { + GCX_COOP(); + + struct + { + PTRARRAYREF Types; + } gc; + gc.Types = NULL; + GCPROTECT_BEGIN(gc); + TypeHandle arrayHandle = ClassLoader::LoadArrayTypeThrowing(TypeHandle(g_pRuntimeTypeClass), ELEMENT_TYPE_SZARRAY); + gc.Types = (PTRARRAYREF)AllocateSzArray(arrayHandle, ifaceCount); + + UINT i = 0; + + // Populate type array + MethodTable::InterfaceMapIterator it = pMT->IterateInterfaceMap(); + while (it.Next()) + { + _ASSERTE(i < (UINT)ifaceCount); + OBJECTREF refInterface = it.GetInterface(pMT)->GetManagedClassObject(); + gc.Types->SetAt(i, refInterface); + _ASSERTE(gc.Types->GetAt(i) != NULL); + i++; + } + + result.Set(gc.Types); + GCPROTECT_END(); + } + + END_QCALL; +} + +static PTRARRAYREF CopyRuntimeTypeHandles(TypeHandle * prgTH, INT32 numTypeHandles, BinderClassID arrayElemType) { CONTRACTL { THROWS; @@ -595,61 +622,6 @@ extern "C" void QCALLTYPE RuntimeTypeHandle_GetConstraints(QCall::TypeHandle pTy return; } -FCIMPL1(PtrArray*, RuntimeTypeHandle::GetInterfaces, ReflectClassBaseObject *pTypeUNSAFE) { - CONTRACTL { - FCALL_CHECK; - } - CONTRACTL_END; - - REFLECTCLASSBASEREF refType = (REFLECTCLASSBASEREF)ObjectToOBJECTREF(pTypeUNSAFE); - - if (refType == NULL) - FCThrowRes(kArgumentNullException, W("Arg_InvalidHandle")); - - TypeHandle typeHandle = refType->GetType(); - - if (typeHandle.IsGenericVariable()) - FCThrowRes(kArgumentNullException, W("Arg_InvalidHandle")); - - INT32 ifaceCount = 0; - - PTRARRAYREF refRetVal = NULL; - HELPER_METHOD_FRAME_BEGIN_RET_2(refRetVal, refType); - { - if (typeHandle.IsTypeDesc()) - { - ifaceCount = 0; - } - else - { - ifaceCount = typeHandle.GetMethodTable()->GetNumInterfaces(); - } - - // Allocate the array - if (ifaceCount > 0) - { - TypeHandle arrayHandle = ClassLoader::LoadArrayTypeThrowing(TypeHandle(g_pRuntimeTypeClass), ELEMENT_TYPE_SZARRAY); - refRetVal = (PTRARRAYREF)AllocateSzArray(arrayHandle, ifaceCount); - - // populate type array - UINT i = 0; - - MethodTable::InterfaceMapIterator it = typeHandle.GetMethodTable()->IterateInterfaceMap(); - while (it.Next()) - { - OBJECTREF refInterface = it.GetInterface(typeHandle.GetMethodTable())->GetManagedClassObject(); - refRetVal->SetAt(i, refInterface); - _ASSERTE(refRetVal->GetAt(i) != NULL); - i++; - } - } - } - HELPER_METHOD_FRAME_END(); - - return (PtrArray*)OBJECTREFToObject(refRetVal); -} -FCIMPLEND - FCIMPL1(INT32, RuntimeTypeHandle::GetAttributes, ReflectClassBaseObject *pTypeUNSAFE) { CONTRACTL { FCALL_CHECK; @@ -1856,32 +1828,25 @@ FCIMPL6(void, SignatureNative::GetSignature, } FCIMPLEND -FCIMPL2(FC_BOOL_RET, SignatureNative::CompareSig, SignatureNative* pLhsUNSAFE, SignatureNative* pRhsUNSAFE) +extern "C" BOOL QCALLTYPE Signature_AreEqual( + PCCOR_SIGNATURE sig1, INT32 cSig1, QCall::TypeHandle handle1, + PCCOR_SIGNATURE sig2, INT32 cSig2, QCall::TypeHandle handle2) { - FCALL_CONTRACT; + QCALL_CONTRACT; - INT32 ret = 0; + BOOL ret = FALSE; - struct - { - SIGNATURENATIVEREF pLhs; - SIGNATURENATIVEREF pRhs; - } gc; + BEGIN_QCALL; - gc.pLhs = (SIGNATURENATIVEREF)pLhsUNSAFE; - gc.pRhs = (SIGNATURENATIVEREF)pRhsUNSAFE; + ret = MetaSig::CompareMethodSigs( + sig1, cSig1, handle1.AsTypeHandle().GetModule(), NULL, + sig2, cSig2, handle2.AsTypeHandle().GetModule(), NULL, + FALSE); - HELPER_METHOD_FRAME_BEGIN_RET_PROTECT(gc); - { - ret = MetaSig::CompareMethodSigs( - gc.pLhs->GetCorSig(), gc.pLhs->GetCorSigSize(), gc.pLhs->GetModule(), NULL, - gc.pRhs->GetCorSig(), gc.pRhs->GetCorSigSize(), gc.pRhs->GetModule(), NULL, - FALSE); - } - HELPER_METHOD_FRAME_END(); - FC_RETURN_BOOL(ret); + END_QCALL; + + return ret; } -FCIMPLEND extern "C" void QCALLTYPE RuntimeMethodHandle_GetMethodInstantiation(MethodDesc * pMethod, QCall::ObjectHandleOnStack retTypes, BOOL fAsRuntimeTypeArray) { diff --git a/src/coreclr/vm/runtimehandles.h b/src/coreclr/vm/runtimehandles.h index 30683f5c2a8e70..5dd2f5ff5676e9 100644 --- a/src/coreclr/vm/runtimehandles.h +++ b/src/coreclr/vm/runtimehandles.h @@ -137,11 +137,8 @@ class RuntimeTypeHandle static FCDECL2(FC_BOOL_RET, CompareCanonicalHandles, PTR_ReflectClassBaseObject pLeft, PTR_ReflectClassBaseObject pRight); - static FCDECL1(PtrArray*, GetInterfaces, ReflectClassBaseObject *pType); - static FCDECL1(EnregisteredTypeHandle, GetElementTypeHandle, EnregisteredTypeHandle th); static FCDECL1(INT32, GetNumVirtuals, ReflectClassBaseObject *pType); - static FCDECL3(FC_BOOL_RET, GetFields, ReflectClassBaseObject *pType, INT32 **result, INT32 *pCount); static FCDECL1(MethodDesc *, GetFirstIntroducedMethod, ReflectClassBaseObject* pType); static FCDECL1(void, GetNextIntroducedMethod, MethodDesc **ppMethod); @@ -180,6 +177,7 @@ extern "C" void QCALLTYPE RuntimeTypeHandle_MakeArray(QCall::TypeHandle pTypeHan extern "C" BOOL QCALLTYPE RuntimeTypeHandle_IsCollectible(QCall::TypeHandle pTypeHandle); extern "C" void QCALLTYPE RuntimeTypeHandle_PrepareMemberInfoCache(QCall::TypeHandle pMemberInfoCache); extern "C" void QCALLTYPE RuntimeTypeHandle_ConstructName(QCall::TypeHandle pTypeHandle, DWORD format, QCall::StringHandleOnStack retString); +extern "C" void QCALLTYPE RuntimeTypeHandle_GetInterfaces(MethodTable* pMT, QCall::ObjectHandleOnStack result); extern "C" BOOL QCALLTYPE RuntimeTypeHandle_IsVisible(QCall::TypeHandle pTypeHandle); extern "C" void QCALLTYPE RuntimeTypeHandle_GetInstantiation(QCall::TypeHandle pTypeHandle, QCall::ObjectHandleOnStack retType, BOOL fAsRuntimeTypeArray); extern "C" void QCALLTYPE RuntimeTypeHandle_Instantiate(QCall::TypeHandle pTypeHandle, TypeHandle * pInstArray, INT32 cInstArray, QCall::ObjectHandleOnStack retType); @@ -190,6 +188,7 @@ extern "C" void QCALLTYPE RuntimeTypeHandle_GetAssemblySlow(QCall::ObjectHandleO extern "C" void QCALLTYPE RuntimeTypeHandle_GetModuleSlow(QCall::ObjectHandleOnStack type, QCall::ObjectHandleOnStack module); extern "C" INT32 QCALLTYPE RuntimeTypeHandle_GetNumVirtualsAndStaticVirtuals(QCall::TypeHandle pTypeHandle); extern "C" MethodDesc* QCALLTYPE RuntimeTypeHandle_GetMethodAt(MethodTable* pMT, INT32 slot); +extern "C" BOOL QCALLTYPE RuntimeTypeHandle_GetFields(MethodTable* pMT, intptr_t* result, INT32* pCount); extern "C" void QCALLTYPE RuntimeTypeHandle_VerifyInterfaceIsImplemented(QCall::TypeHandle pTypeHandle, QCall::TypeHandle pIFaceHandle); extern "C" MethodDesc* QCALLTYPE RuntimeTypeHandle_GetInterfaceMethodImplementation(QCall::TypeHandle pTypeHandle, QCall::TypeHandle pOwner, MethodDesc * pMD); extern "C" EnregisteredTypeHandle QCALLTYPE RuntimeTypeHandle_GetDeclaringTypeHandleForGenericVariable(EnregisteredTypeHandle pTypeHandle); @@ -328,8 +327,6 @@ class SignatureNative : public Object FieldDesc *pFieldDesc, ReflectMethodObject *pMethodUNSAFE, ReflectClassBaseObject *pDeclaringType); - static FCDECL2(FC_BOOL_RET, CompareSig, SignatureNative* pLhs, SignatureNative* pRhs); - static FCDECL3(INT32, GetParameterOffsetInternal, PCCOR_SIGNATURE sig, DWORD csig, INT32 parameterIndex); static FCDECL3(INT32, GetTypeParameterOffset, SignatureNative* pSig, INT32 offset, INT32 index); @@ -509,6 +506,10 @@ class SignatureNative : public Object MethodDesc* m_pMethod; }; +extern "C" BOOL QCALLTYPE Signature_AreEqual( + PCCOR_SIGNATURE sig1, INT32 cSig1, QCall::TypeHandle handle1, + PCCOR_SIGNATURE sig2, INT32 cSig2, QCall::TypeHandle handle2); + class ReflectionPointer : public Object { public: diff --git a/src/coreclr/vm/siginfo.cpp b/src/coreclr/vm/siginfo.cpp index d1154722b340c5..e7717aba1ce75a 100644 --- a/src/coreclr/vm/siginfo.cpp +++ b/src/coreclr/vm/siginfo.cpp @@ -16,7 +16,6 @@ #include "gcheaputilities.h" #include "field.h" #include "eeconfig.h" -#include "runtimehandles.h" // for SignatureNative #include "winwrap.h" #include #include "sigbuilder.h"