From 1a2e96bca05b1397868402265eb195aaa7fd02eb Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Mon, 9 Sep 2024 09:08:31 -0700 Subject: [PATCH] Convert some handle APIs to QCalls (#107513) Convert RuntimeTypeHandle.GetAssembly() Convert RuntimeTypeHandle.GetModule() Convert RuntimeAssembly.GetManifestModule() --- .../src/System/Reflection/RuntimeAssembly.cs | 28 +++- .../Reflection/RuntimeCustomAttributeData.cs | 6 +- .../src/System/RuntimeHandles.cs | 36 ++++- src/coreclr/vm/ecalllist.h | 4 +- src/coreclr/vm/object.h | 9 -- src/coreclr/vm/qcallentrypoints.cpp | 3 + src/coreclr/vm/runtimehandles.cpp | 127 +++++++++--------- src/coreclr/vm/runtimehandles.h | 13 +- 8 files changed, 134 insertions(+), 92 deletions(-) diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs index ccd3d9aa9efc5e..1ebaa04f8f6817 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs @@ -115,8 +115,6 @@ public override string? CodeBase } } - internal RuntimeAssembly GetNativeHandle() => this; - // If the assembly is copied before it is loaded, the codebase will be set to the // actual file loaded if copiedName is true. If it is false, then the original code base // is returned. @@ -263,7 +261,7 @@ public override Type[] GetExportedTypes() public override IEnumerable DefinedTypes { [RequiresUnreferencedCode("Types might be removed")] - get => GetManifestModule(GetNativeHandle()).GetDefinedTypes(); + get => GetManifestModule().GetDefinedTypes(); } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetIsCollectible")] @@ -324,7 +322,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont public override Module ManifestModule => // We don't need to return the "external" ModuleBuilder because // it is meant to be read-only - GetManifestModule(GetNativeHandle()); + GetManifestModule(); public override object[] GetCustomAttributes(bool inherit) { @@ -588,7 +586,7 @@ private CultureInfo GetLocale() [MethodImpl(MethodImplOptions.InternalCall)] private static extern bool FCallIsDynamic(RuntimeAssembly assembly); - public override bool IsDynamic => FCallIsDynamic(GetNativeHandle()); + public override bool IsDynamic => FCallIsDynamic(this); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetSimpleName")] private static partial void GetSimpleName(QCallAssembly assembly, StringHandleOnStack retSimpleName); @@ -701,8 +699,24 @@ public override Module[] GetLoadedModules(bool getResourceModules) return GetModulesInternal(false, getResourceModules); } + private RuntimeModule GetManifestModule() + { + return GetManifestModule(this) ?? GetManifestModuleWorker(this); + + [MethodImpl(MethodImplOptions.NoInlining)] + static RuntimeModule GetManifestModuleWorker(RuntimeAssembly assembly) + { + RuntimeModule? module = null; + GetManifestModuleSlow(ObjectHandleOnStack.Create(ref assembly), ObjectHandleOnStack.Create(ref module)); + return module!; + } + } + [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern RuntimeModule GetManifestModule(RuntimeAssembly assembly); + private static extern RuntimeModule? GetManifestModule(RuntimeAssembly assembly); + + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyHandle_GetManifestModuleSlow")] + private static partial void GetManifestModuleSlow(ObjectHandleOnStack assembly, ObjectHandleOnStack module); [MethodImpl(MethodImplOptions.InternalCall)] internal static extern int GetToken(RuntimeAssembly assembly); @@ -713,7 +727,7 @@ public sealed override Type[] GetForwardedTypes() List types = new List(); List exceptions = new List(); - MetadataImport scope = GetManifestModule(GetNativeHandle()).MetadataImport; + MetadataImport scope = GetManifestModule().MetadataImport; scope.Enum(MetadataTokenType.ExportedType, 0, out MetadataEnumResult enumResult); RuntimeAssembly runtimeAssembly = this; QCallAssembly pAssembly = new QCallAssembly(ref runtimeAssembly); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeCustomAttributeData.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeCustomAttributeData.cs index a610a5cbe3eab8..2ac866f246fce9 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeCustomAttributeData.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeCustomAttributeData.cs @@ -82,7 +82,7 @@ internal static IList GetCustomAttributesInternal(RuntimeAs // No pseudo attributes for RuntimeAssembly - return GetCustomAttributes((RuntimeModule)target.ManifestModule, RuntimeAssembly.GetToken(target.GetNativeHandle())); + return GetCustomAttributes((RuntimeModule)target.ManifestModule, RuntimeAssembly.GetToken(target)); } internal static IList GetCustomAttributesInternal(RuntimeParameterInfo target) @@ -1227,7 +1227,7 @@ internal static bool IsDefined(RuntimeAssembly assembly, RuntimeType caType) Debug.Assert(caType is not null); // No pseudo attributes for RuntimeAssembly - return IsCustomAttributeDefined((assembly.ManifestModule as RuntimeModule)!, RuntimeAssembly.GetToken(assembly.GetNativeHandle()), caType); + return IsCustomAttributeDefined((assembly.ManifestModule as RuntimeModule)!, RuntimeAssembly.GetToken(assembly), caType); } internal static bool IsDefined(RuntimeModule module, RuntimeType caType) @@ -1388,7 +1388,7 @@ internal static object[] GetCustomAttributes(RuntimeAssembly assembly, RuntimeTy // No pseudo attributes for RuntimeAssembly - int assemblyToken = RuntimeAssembly.GetToken(assembly.GetNativeHandle()); + int assemblyToken = RuntimeAssembly.GetToken(assembly); return GetCustomAttributes((assembly.ManifestModule as RuntimeModule)!, assemblyToken, 0, caType); } diff --git a/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs b/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs index 3d230536519cea..d78cc1ea86bc19 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs @@ -306,11 +306,43 @@ internal RuntimeType GetRuntimeType() [MethodImpl(MethodImplOptions.InternalCall)] internal static extern CorElementType GetCorElementType(RuntimeType type); + internal static RuntimeAssembly GetAssembly(RuntimeType type) + { + return GetAssemblyIfExists(type) ?? GetAssemblyWorker(type); + + [MethodImpl(MethodImplOptions.NoInlining)] + static RuntimeAssembly GetAssemblyWorker(RuntimeType type) + { + RuntimeAssembly? assembly = null; + GetAssemblySlow(ObjectHandleOnStack.Create(ref type), ObjectHandleOnStack.Create(ref assembly)); + return assembly!; + } + } + [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern RuntimeAssembly GetAssembly(RuntimeType type); + private static extern RuntimeAssembly? GetAssemblyIfExists(RuntimeType type); + + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetAssemblySlow")] + private static partial void GetAssemblySlow(ObjectHandleOnStack type, ObjectHandleOnStack assembly); + + internal static RuntimeModule GetModule(RuntimeType type) + { + return GetModuleIfExists(type) ?? GetModuleWorker(type); + + [MethodImpl(MethodImplOptions.NoInlining)] + static RuntimeModule GetModuleWorker(RuntimeType type) + { + RuntimeModule? module = null; + GetModuleSlow(ObjectHandleOnStack.Create(ref type), ObjectHandleOnStack.Create(ref module)); + return module!; + } + } [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern RuntimeModule GetModule(RuntimeType type); + private static extern RuntimeModule? GetModuleIfExists(RuntimeType type); + + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetModuleSlow")] + private static partial void GetModuleSlow(ObjectHandleOnStack type, ObjectHandleOnStack module); public ModuleHandle GetModuleHandle() { diff --git a/src/coreclr/vm/ecalllist.h b/src/coreclr/vm/ecalllist.h index 7611cb93c5d427..48edcc4d046725 100644 --- a/src/coreclr/vm/ecalllist.h +++ b/src/coreclr/vm/ecalllist.h @@ -109,8 +109,8 @@ FCFuncStart(gCOMTypeHandleFuncs) FCFuncElement("GetFirstIntroducedMethod", RuntimeTypeHandle::GetFirstIntroducedMethod) FCFuncElement("GetNextIntroducedMethod", RuntimeTypeHandle::GetNextIntroducedMethod) FCFuncElement("GetCorElementType", RuntimeTypeHandle::GetCorElementType) - FCFuncElement("GetAssembly", RuntimeTypeHandle::GetAssembly) - FCFuncElement("GetModule", RuntimeTypeHandle::GetModule) + FCFuncElement("GetAssemblyIfExists", RuntimeTypeHandle::GetAssemblyIfExists) + FCFuncElement("GetModuleIfExists", RuntimeTypeHandle::GetModuleIfExists) FCFuncElement("GetBaseType", RuntimeTypeHandle::GetBaseType) FCFuncElement("GetElementType", RuntimeTypeHandle::GetElementType) FCFuncElement("GetArrayRank", RuntimeTypeHandle::GetArrayRank) diff --git a/src/coreclr/vm/object.h b/src/coreclr/vm/object.h index 1afd632dea09e1..c6a644a03eddea 100644 --- a/src/coreclr/vm/object.h +++ b/src/coreclr/vm/object.h @@ -1219,13 +1219,6 @@ class ReflectModuleBaseObject : public Object } }; -NOINLINE ReflectModuleBaseObject* GetRuntimeModuleHelper(LPVOID __me, Module *pModule, OBJECTREF keepAlive); -#define FC_RETURN_MODULE_OBJECT(pModule, refKeepAlive) FC_INNER_RETURN(ReflectModuleBaseObject*, GetRuntimeModuleHelper(__me, pModule, refKeepAlive)) - - - - - class ThreadBaseObject; class SynchronizationContextObject: public Object { @@ -1439,8 +1432,6 @@ class AssemblyBaseObject : public Object SetObjectReference(&m_pSyncRoot, pSyncRoot); } }; -NOINLINE AssemblyBaseObject* GetRuntimeAssemblyHelper(LPVOID __me, Assembly *pAssembly, OBJECTREF keepAlive); -#define FC_RETURN_ASSEMBLY_OBJECT(pAssembly, refKeepAlive) FC_INNER_RETURN(AssemblyBaseObject*, GetRuntimeAssemblyHelper(__me, pAssembly, refKeepAlive)) // AssemblyLoadContextBaseObject // This class is the base class for AssemblyLoadContext diff --git a/src/coreclr/vm/qcallentrypoints.cpp b/src/coreclr/vm/qcallentrypoints.cpp index 2eb5681e75563b..02ad38c982128f 100644 --- a/src/coreclr/vm/qcallentrypoints.cpp +++ b/src/coreclr/vm/qcallentrypoints.cpp @@ -118,6 +118,8 @@ static const Entry s_QCall[] = DllImportEntry(RuntimeTypeHandle_MakeArray) DllImportEntry(RuntimeTypeHandle_IsCollectible) DllImportEntry(RuntimeTypeHandle_GetConstraints) + DllImportEntry(RuntimeTypeHandle_GetAssemblySlow) + DllImportEntry(RuntimeTypeHandle_GetModuleSlow) DllImportEntry(RuntimeTypeHandle_GetNumVirtualsAndStaticVirtuals) DllImportEntry(RuntimeTypeHandle_VerifyInterfaceIsImplemented) DllImportEntry(RuntimeTypeHandle_GetInterfaceMethodImplementation) @@ -158,6 +160,7 @@ static const Entry s_QCall[] = DllImportEntry(ModuleHandle_ResolveMethod) DllImportEntry(ModuleHandle_ResolveField) DllImportEntry(ModuleHandle_GetPEKind) + DllImportEntry(AssemblyHandle_GetManifestModuleSlow) DllImportEntry(TypeBuilder_DefineGenericParam) DllImportEntry(TypeBuilder_DefineType) DllImportEntry(TypeBuilder_SetParentType) diff --git a/src/coreclr/vm/runtimehandles.cpp b/src/coreclr/vm/runtimehandles.cpp index dca024a0d7b5cf..7b067cf8103af8 100644 --- a/src/coreclr/vm/runtimehandles.cpp +++ b/src/coreclr/vm/runtimehandles.cpp @@ -161,43 +161,6 @@ NOINLINE static ReflectClassBaseObject* GetRuntimeTypeHelper(LPVOID __me, TypeHa #define RETURN_CLASS_OBJECT(typeHandle, keepAlive) FC_INNER_RETURN(ReflectClassBaseObject*, GetRuntimeTypeHelper(__me, typeHandle, keepAlive)) -NOINLINE ReflectModuleBaseObject* GetRuntimeModuleHelper(LPVOID __me, Module *pModule, OBJECTREF keepAlive) -{ - FC_INNER_PROLOG_NO_ME_SETUP(); - if (pModule == NULL) - return NULL; - - OBJECTREF refModule = pModule->GetExposedObjectIfExists(); - if (refModule != NULL) - return (ReflectModuleBaseObject*)OBJECTREFToObject(refModule); - - HELPER_METHOD_FRAME_BEGIN_RET_ATTRIB_1(Frame::FRAME_ATTR_EXACT_DEPTH|Frame::FRAME_ATTR_CAPTURE_DEPTH_2, keepAlive); - refModule = pModule->GetExposedObject(); - HELPER_METHOD_FRAME_END(); - - FC_INNER_EPILOG(); - return (ReflectModuleBaseObject*)OBJECTREFToObject(refModule); -} - -NOINLINE AssemblyBaseObject* GetRuntimeAssemblyHelper(LPVOID __me, Assembly *pAssembly, OBJECTREF keepAlive) -{ - FC_INNER_PROLOG_NO_ME_SETUP(); - if (pAssembly == NULL) - return NULL; - - OBJECTREF refAssembly = (pAssembly != NULL) ? pAssembly->GetExposedObjectIfExists() : NULL; - - if(refAssembly != NULL) - return (AssemblyBaseObject*)OBJECTREFToObject(refAssembly); - - HELPER_METHOD_FRAME_BEGIN_RET_ATTRIB_1(Frame::FRAME_ATTR_EXACT_DEPTH|Frame::FRAME_ATTR_CAPTURE_DEPTH_2, keepAlive); - refAssembly = pAssembly->GetExposedObject(); - HELPER_METHOD_FRAME_END(); - - FC_INNER_EPILOG(); - return (AssemblyBaseObject*)OBJECTREFToObject(refAssembly); -} - FCIMPL1(ReflectClassBaseObject*, RuntimeTypeHandle::GetRuntimeType, EnregisteredTypeHandle th) { FCALL_CONTRACT; @@ -298,23 +261,35 @@ FCIMPL1(INT32, RuntimeTypeHandle::GetCorElementType, ReflectClassBaseObject *pTy } FCIMPLEND -FCIMPL1(AssemblyBaseObject*, RuntimeTypeHandle::GetAssembly, ReflectClassBaseObject *pTypeUNSAFE) { - CONTRACTL { - FCALL_CHECK; - } - CONTRACTL_END; +FCIMPL1(AssemblyBaseObject*, RuntimeTypeHandle::GetAssemblyIfExists, ReflectClassBaseObject *pTypeUNSAFE) +{ + FCALL_CONTRACT; REFLECTCLASSBASEREF refType = (REFLECTCLASSBASEREF)ObjectToOBJECTREF(pTypeUNSAFE); - if (refType == NULL) - FCThrowRes(kArgumentNullException, W("Arg_InvalidHandle")); + return NULL; Assembly* pAssembly = refType->GetType().GetAssembly(); - - FC_RETURN_ASSEMBLY_OBJECT(pAssembly, refType); + OBJECTREF refAssembly = pAssembly->GetExposedObjectIfExists(); + return (AssemblyBaseObject*)OBJECTREFToObject(refAssembly); } FCIMPLEND +extern "C" void QCALLTYPE RuntimeTypeHandle_GetAssemblySlow(QCall::ObjectHandleOnStack type, QCall::ObjectHandleOnStack assembly) +{ + QCALL_CONTRACT; + + BEGIN_QCALL; + GCX_COOP(); + + if (type.Get() == NULL) + COMPlusThrow(kArgumentNullException, W("Arg_InvalidHandle")); + + Assembly* pAssembly = ((REFLECTCLASSBASEREF)type.Get())->GetType().GetAssembly(); + assembly.Set(pAssembly->GetExposedObject()); + END_QCALL; +} + FCIMPL1(FC_BOOL_RET, RuntimeFieldHandle::AcquiresContextFromThis, FieldDesc* pField) { CONTRACTL { @@ -351,25 +326,35 @@ FCIMPL1(Object*, RuntimeFieldHandle::GetLoaderAllocator, FieldDesc* pField) } FCIMPLEND -FCIMPL1(ReflectModuleBaseObject*, RuntimeTypeHandle::GetModule, ReflectClassBaseObject *pTypeUNSAFE) { - CONTRACTL { - FCALL_CHECK; - } - CONTRACTL_END; - - Module *result; +FCIMPL1(ReflectModuleBaseObject*, RuntimeTypeHandle::GetModuleIfExists, ReflectClassBaseObject *pTypeUNSAFE) +{ + FCALL_CONTRACT; REFLECTCLASSBASEREF refType = (REFLECTCLASSBASEREF)ObjectToOBJECTREF(pTypeUNSAFE); - if (refType == NULL) - FCThrowRes(kArgumentNullException, W("Arg_InvalidHandle")); - - result = refType->GetType().GetModule(); + return NULL; - FC_RETURN_MODULE_OBJECT(result, refType); + Module* pModule = refType->GetType().GetModule(); + OBJECTREF refModule = pModule->GetExposedObjectIfExists(); + return (ReflectModuleBaseObject*)OBJECTREFToObject(refModule); } FCIMPLEND +extern "C" void QCALLTYPE RuntimeTypeHandle_GetModuleSlow(QCall::ObjectHandleOnStack type, QCall::ObjectHandleOnStack module) +{ + QCALL_CONTRACT; + + BEGIN_QCALL; + GCX_COOP(); + + if (type.Get() == NULL) + COMPlusThrow(kArgumentNullException, W("Arg_InvalidHandle")); + + Module* pModule = ((REFLECTCLASSBASEREF)type.Get())->GetType().GetModule(); + module.Set(pModule->GetExposedObject()); + END_QCALL; +} + FCIMPL1(ReflectClassBaseObject *, RuntimeTypeHandle::GetBaseType, ReflectClassBaseObject *pTypeUNSAFE) { CONTRACTL { FCALL_CHECK; @@ -2679,17 +2664,17 @@ FCIMPL2(FieldDesc*, RuntimeFieldHandle::GetStaticFieldForGenericType, FieldDesc } FCIMPLEND -FCIMPL1(ReflectModuleBaseObject*, AssemblyHandle::GetManifestModule, AssemblyBaseObject* pAssemblyUNSAFE) { +FCIMPL1(ReflectModuleBaseObject*, AssemblyHandle::GetManifestModule, AssemblyBaseObject* pAssemblyUNSAFE) +{ FCALL_CONTRACT; ASSEMBLYREF refAssembly = (ASSEMBLYREF)ObjectToOBJECTREF(pAssemblyUNSAFE); - if (refAssembly == NULL) - FCThrowRes(kArgumentNullException, W("Arg_InvalidHandle")); - - Assembly* currentAssembly = refAssembly->GetAssembly(); + return NULL; - FC_RETURN_MODULE_OBJECT(currentAssembly->GetModule(), refAssembly); + Module* pModule = refAssembly->GetAssembly()->GetModule(); + OBJECTREF refModule = pModule->GetExposedObjectIfExists(); + return (ReflectModuleBaseObject*)OBJECTREFToObject(refModule); } FCIMPLEND @@ -2716,6 +2701,20 @@ FCIMPL1(INT32, AssemblyHandle::GetToken, AssemblyBaseObject* pAssemblyUNSAFE) { } FCIMPLEND +extern "C" void QCALLTYPE AssemblyHandle_GetManifestModuleSlow(QCall::ObjectHandleOnStack assembly, QCall::ObjectHandleOnStack module) +{ + QCALL_CONTRACT; + + BEGIN_QCALL; + GCX_COOP(); + + if (assembly.Get() == NULL) + COMPlusThrow(kArgumentNullException, W("Arg_InvalidHandle")); + + Module* pModule = ((ASSEMBLYREF)assembly.Get())->GetAssembly()->GetModule(); + module.Set(pModule->GetExposedObject()); + END_QCALL; +} extern "C" void QCALLTYPE ModuleHandle_GetPEKind(QCall::ModuleHandle pModule, DWORD* pdwPEKind, DWORD* pdwMachine) { diff --git a/src/coreclr/vm/runtimehandles.h b/src/coreclr/vm/runtimehandles.h index ee1977997feccc..fd6661b791ca35 100644 --- a/src/coreclr/vm/runtimehandles.h +++ b/src/coreclr/vm/runtimehandles.h @@ -119,9 +119,9 @@ class RuntimeTypeHandle { static FCDECL2(FC_BOOL_RET, IsEquivalentTo, ReflectClassBaseObject *rtType1UNSAFE, ReflectClassBaseObject *rtType2UNSAFE); - static FCDECL1(AssemblyBaseObject*, GetAssembly, ReflectClassBaseObject *pType); + static FCDECL1(AssemblyBaseObject*, GetAssemblyIfExists, ReflectClassBaseObject *pType); static FCDECL1(ReflectClassBaseObject*, GetBaseType, ReflectClassBaseObject* pType); - static FCDECL1(ReflectModuleBaseObject*, GetModule, ReflectClassBaseObject* pType); + static FCDECL1(ReflectModuleBaseObject*, GetModuleIfExists, ReflectClassBaseObject* pType); static FCDECL1(INT32, GetAttributes, ReflectClassBaseObject* pType); static FCDECL1(INT32, GetToken, ReflectClassBaseObject* pType); static FCDECL1(LPCUTF8, GetUtf8Name, ReflectClassBaseObject* pType); @@ -191,6 +191,8 @@ extern "C" void QCALLTYPE RuntimeTypeHandle_GetInstantiation(QCall::TypeHandle p extern "C" void QCALLTYPE RuntimeTypeHandle_Instantiate(QCall::TypeHandle pTypeHandle, TypeHandle * pInstArray, INT32 cInstArray, QCall::ObjectHandleOnStack retType); extern "C" void QCALLTYPE RuntimeTypeHandle_GetGenericTypeDefinition(QCall::TypeHandle pTypeHandle, QCall::ObjectHandleOnStack retType); extern "C" void QCALLTYPE RuntimeTypeHandle_GetConstraints(QCall::TypeHandle pTypeHandle, QCall::ObjectHandleOnStack retTypes); +extern "C" void QCALLTYPE RuntimeTypeHandle_GetAssemblySlow(QCall::ObjectHandleOnStack type, QCall::ObjectHandleOnStack assembly); +extern "C" void QCALLTYPE RuntimeTypeHandle_GetModuleSlow(QCall::ObjectHandleOnStack type, QCall::ObjectHandleOnStack module); extern "C" INT32 QCALLTYPE RuntimeTypeHandle_GetNumVirtualsAndStaticVirtuals(QCall::TypeHandle pTypeHandle); 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); @@ -330,14 +332,15 @@ extern "C" void QCALLTYPE ModuleHandle_GetAssembly(QCall::ModuleHandle pModule, extern "C" void QCALLTYPE ModuleHandle_GetPEKind(QCall::ModuleHandle pModule, DWORD* pdwPEKind, DWORD* pdwMachine); -class AssemblyHandle { - +class AssemblyHandle +{ public: static FCDECL1(ReflectModuleBaseObject*, GetManifestModule, AssemblyBaseObject *pAssemblyUNSAFE); - static FCDECL1(INT32, GetToken, AssemblyBaseObject *pAssemblyUNSAFE); }; +extern "C" void QCALLTYPE AssemblyHandle_GetManifestModuleSlow(QCall::ObjectHandleOnStack assembly, QCall::ObjectHandleOnStack module); + class SignatureNative; typedef DPTR(SignatureNative) PTR_SignatureNative;