191 references to MethodTable
System.Private.CoreLib (191)
LibraryImports.g.cs (29)
15private static extern partial void ThrowAmbiguousResolutionException(global::System.Runtime.CompilerServices.MethodTable* targetType, global::System.Runtime.CompilerServices.MethodTable* interfaceType, void* methodDesc); 23private static extern partial void ThrowEntryPointNotFoundException(global::System.Runtime.CompilerServices.MethodTable* targetType, global::System.Runtime.CompilerServices.MethodTable* interfaceType, void* methodDesc); 83private static unsafe extern partial void Ctor(global::System.Runtime.CompilerServices.MethodTable* pArrayMT, uint dwNumArgs, int* pArgList, global::System.Runtime.CompilerServices.ObjectHandleOnStack retArray); 213private static unsafe extern partial void* GetMulticastInvokeSlow(global::System.Runtime.CompilerServices.MethodTable* pMT); 633private static partial bool HasOverriddenSlow(global::System.Runtime.CompilerServices.MethodTable* pMT, bool isRead) 649static extern unsafe int __PInvoke(global::System.Runtime.CompilerServices.MethodTable* __pMT_native, int __isRead_native); 1867private static extern partial void InitClassHelper(global::System.Runtime.CompilerServices.MethodTable* mt); 1939internal static unsafe partial bool AreTypesEquivalent(global::System.Runtime.CompilerServices.MethodTable* pMTa, global::System.Runtime.CompilerServices.MethodTable* pMTb) 1952static extern unsafe int __PInvoke(global::System.Runtime.CompilerServices.MethodTable* __pMTa_native, global::System.Runtime.CompilerServices.MethodTable* __pMTb_native); 2029private static partial void GetThreadStaticsByMethodTable(global::System.Runtime.CompilerServices.ByteRefOnStack result, global::System.Runtime.CompilerServices.MethodTable* pMT, bool gcStatics) 2040static extern unsafe void __PInvoke(global::System.Runtime.CompilerServices.ByteRefOnStack __result_native, global::System.Runtime.CompilerServices.MethodTable* __pMT_native, int __gcStatics_native); 2673private static unsafe extern partial void InternalAlloc(global::System.Runtime.CompilerServices.MethodTable* pMT, global::System.Runtime.CompilerServices.ObjectHandleOnStack result); 2681private static unsafe extern partial void InternalAllocNoChecks(global::System.Runtime.CompilerServices.MethodTable* pMT, global::System.Runtime.CompilerServices.ObjectHandleOnStack result); 2713private static unsafe extern partial nint GetMethodAt(global::System.Runtime.CompilerServices.MethodTable* pMT, int slot); 2729private static partial global::Interop.BOOL GetFields(global::System.Runtime.CompilerServices.MethodTable* pMT, global::System.Span<nint> data, ref int usedCount) 2742static extern unsafe global::Interop.BOOL __PInvoke(global::System.Runtime.CompilerServices.MethodTable* __pMT_native, nint* __data_native, int* __usedCount_native); 2751private static unsafe extern partial void GetInterfaces(global::System.Runtime.CompilerServices.MethodTable* pMT, global::System.Runtime.CompilerServices.ObjectHandleOnStack result); 3250private static unsafe extern partial void GetGuid(global::System.Runtime.CompilerServices.MethodTable* pMT, global::System.Guid* result); 3641private static unsafe partial bool CanCompareBitsOrUseFastGetHashCodeHelper(global::System.Runtime.CompilerServices.MethodTable* pMT) 3654static extern unsafe int __PInvoke(global::System.Runtime.CompilerServices.MethodTable* __pMT_native); 3663private static unsafe partial global::System.ValueType.ValueTypeHashCodeStrategy GetHashCodeStrategy(global::System.Runtime.CompilerServices.MethodTable* pMT, global::System.Runtime.CompilerServices.ObjectHandleOnStack objHandle, out uint fieldOffset, out uint fieldSize, out global::System.Runtime.CompilerServices.MethodTable* fieldMT) 3670fixed (global::System.Runtime.CompilerServices.MethodTable** __fieldMT_native = &fieldMT) 3680static extern unsafe global::System.ValueType.ValueTypeHashCodeStrategy __PInvoke(global::System.Runtime.CompilerServices.MethodTable* __pMT_native, global::System.Runtime.CompilerServices.ObjectHandleOnStack __objHandle_native, uint* __fieldOffset_native, uint* __fieldSize_native, global::System.Runtime.CompilerServices.MethodTable** __fieldMT_native);
src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\ExceptionHandling.cs (3)
1050if (ShouldTypedClauseCatchThisException(exception, (MethodTable*)ehClause._pTargetType, !frameIter.IsRuntimeWrappedExceptions)) 1114private static bool ShouldTypedClauseCatchThisException(object exception, MethodTable* pClauseType, bool tryUnwrapException) 1128MethodTable* mt = RuntimeHelpers.GetMethodTable(exception);
src\Internal\Runtime\CompilerHelpers\ThrowHelpers.cs (8)
16private static partial void ThrowAmbiguousResolutionException(MethodTable* targetType, MethodTable* interfaceType, void* methodDesc); 26ThrowAmbiguousResolutionException((MethodTable*)targetType, (MethodTable*)interfaceType, method); 32private static partial void ThrowEntryPointNotFoundException(MethodTable* targetType, MethodTable* interfaceType, void* methodDesc); 42ThrowEntryPointNotFoundException((MethodTable*)targetType, (MethodTable*)interfaceType, method);
src\libraries\System.Private.CoreLib\src\System\Array.cs (12)
373MethodTable* pMT = RuntimeHelpers.GetMethodTable(sourceArray); 374if (MethodTable.AreSameType(pMT, RuntimeHelpers.GetMethodTable(destinationArray)) && 408MethodTable* pMT = RuntimeHelpers.GetMethodTable(sourceArray); 409if (MethodTable.AreSameType(pMT, RuntimeHelpers.GetMethodTable(destinationArray)) && 464MethodTable* pMT = RuntimeHelpers.GetMethodTable(sourceArray); 536MethodTable* pDestArrayMT = RuntimeHelpers.GetMethodTable(destinationArray); 537MethodTable* pDestMT = destinationArray.ElementMethodTable; 581MethodTable* pSrcArrayMT = RuntimeHelpers.GetMethodTable(sourceArray); 582MethodTable* pSrcMT = sourceArray.ElementMethodTable; 606MethodTable* pDestMT = destinationArray.ElementMethodTable; 669MethodTable* pMT = RuntimeHelpers.GetMethodTable(array); 697MethodTable* pMT = RuntimeHelpers.GetMethodTable(array);
src\libraries\System.Private.CoreLib\src\System\Reflection\FieldAccessor.cs (9)
15private unsafe MethodTable* _methodTable; 53_methodTable = (MethodTable*)fieldType.TypeHandle.Value; 60_methodTable = (MethodTable*)fieldType.TypeHandle.Value; 66_methodTable = (MethodTable*)fieldType.TypeHandle.Value; 71_methodTable = (MethodTable*)fieldType.TypeHandle.Value; 81_methodTable = (MethodTable*)typeof(IntPtr).TypeHandle.Value; 95_methodTable = (MethodTable*)fieldType.TypeHandle.Value; 100_methodTable = (MethodTable*)fieldType.TypeHandle.Value; 109_methodTable = (MethodTable*)typeof(IntPtr).TypeHandle.Value;
src\System\Array.CoreCLR.cs (13)
43private static unsafe partial void Ctor(MethodTable* pArrayMT, uint dwNumArgs, int* pArgList, ObjectHandleOnStack retArray); 50internal static unsafe Array Ctor(MethodTable* pArrayMT, uint dwNumArgs, int* pArgList) 91MethodTable* pMTsrc = srcTH.AsMethodTable(); 92MethodTable* pMTdest = destTH.AsMethodTable(); 149MethodTable* pMethodTable = RuntimeHelpers.GetMethodTable(this); 165MethodTable* pElementMethodTable = arrayElementTypeHandle.AsMethodTable(); 191MethodTable* pMethodTable = RuntimeHelpers.GetMethodTable(this); 205MethodTable* pElementMethodTable = arrayElementTypeHandle.AsMethodTable(); 265MethodTable* pValueMethodTable = RuntimeHelpers.GetMethodTable(value); 313private unsafe MethodTable* ElementMethodTable => RuntimeHelpers.GetMethodTable(this)->GetArrayElementTypeHandle().AsMethodTable(); 317MethodTable* thisMT = RuntimeHelpers.GetMethodTable(this); 326MethodTable* pArrayMT = RuntimeHelpers.GetMethodTable(this); 333MethodTable* pElemMT = thElem.AsMethodTable();
src\System\Delegate.CoreCLR.cs (5)
487private static extern unsafe void* GetMulticastInvoke(MethodTable* pMT); 491private static unsafe partial void* GetMulticastInvokeSlow(MethodTable* pMT); 495MethodTable* pMT = RuntimeHelpers.GetMethodTable(this); 509private static extern unsafe void* GetInvokeMethod(MethodTable* pMT); 513MethodTable* pMT = RuntimeHelpers.GetMethodTable(this);
src\System\GC.CoreCLR.cs (2)
360MethodTable* pMT = RuntimeHelpers.GetMethodTable(obj); 378MethodTable* pMT = RuntimeHelpers.GetMethodTable(obj);
src\System\IO\Stream.CoreCLR.cs (5)
15private static partial bool HasOverriddenSlow(MethodTable* pMT, [MarshalAs(UnmanagedType.Bool)] bool isRead); 19MethodTable* pMT = RuntimeHelpers.GetMethodTable(this); 27static bool HasOverriddenReadSlow(MethodTable* pMT) 33MethodTable* pMT = RuntimeHelpers.GetMethodTable(this); 41static bool HasOverriddenWriteSlow(MethodTable* pMT)
src\System\Object.CoreCLR.cs (1)
16MethodTable* pMT = RuntimeHelpers.GetMethodTable(this);
src\System\Runtime\CompilerServices\AsyncHelpers.CoreCLR.cs (4)
251private static unsafe Continuation AllocContinuation(Continuation prevContinuation, MethodTable* contMT) 264private static unsafe Continuation AllocContinuationMethod(Continuation prevContinuation, MethodTable* contMT, int keepAliveOffset, MethodDesc* method) 274private static unsafe Continuation AllocContinuationClass(Continuation prevContinuation, MethodTable* contMT, int keepAliveOffset, MethodTable* methodTable)
src\System\Runtime\CompilerServices\CastHelpers.cs (22)
108MethodTable* mt = RuntimeHelpers.GetMethodTable(obj); 112MethodTable** interfaceMap = mt->InterfaceMap; 177MethodTable* mt = RuntimeHelpers.GetMethodTable(obj)->ParentMethodTable; 295MethodTable* mt = RuntimeHelpers.GetMethodTable(obj); 302MethodTable** interfaceMap = mt->InterfaceMap; 372MethodTable* mt = RuntimeHelpers.GetMethodTable(obj); 417private static ref byte Unbox(MethodTable* toTypeHnd, object obj) 551internal static object? Box_Nullable(MethodTable* srcMT, ref byte nullableData) 559MethodTable* dstMT = srcMT->InstantiationArg0(); 568internal static object Box(MethodTable* typeMT, ref byte unboxedData) 612internal static bool IsNullableForType(MethodTable* typeMT, MethodTable* boxedMT) 623MethodTable *pMTNullableArg = **typeMT->PerInstInfo; 641private static void Unbox_Nullable_NotIsNullableForType(ref byte destPtr, MethodTable* typeMT, object obj) 654internal static void Unbox_Nullable(ref byte destPtr, MethodTable* typeMT, object? obj) 689internal static object? ReboxFromNullable(MethodTable* srcMT, object src) 698private static ref byte Unbox_Helper(MethodTable* pMT1, object obj) 703MethodTable* pMT2 = RuntimeHelpers.GetMethodTable(obj); 720private static void Unbox_TypeTest_Helper(MethodTable *pMT1, MethodTable *pMT2) 735private static void Unbox_TypeTest(MethodTable *pMT1, MethodTable *pMT2)
src\System\Runtime\CompilerServices\InitHelpers.cs (6)
16private static partial void InitClassHelper(MethodTable* mt); 21internal static void InitClassSlow(MethodTable* mt) 28private static void InitClass(MethodTable* mt) 38private static void InitInstantiatedClass(MethodTable* mt, MethodDesc* methodDesc) 40MethodTable *pTemplateMT = methodDesc->MethodTable; 41MethodTable *pMT;
src\System\Runtime\CompilerServices\RuntimeHelpers.CoreCLR.cs (27)
37MethodTable* pMT = GetMethodTable(array); 104MethodTable* targetMT = th.AsMethodTable(); 146MethodTable* pMT = GetMethodTable(obj); 276MethodTable* pMT = GetMethodTable(o1); 399MethodTable* pMT = GetMethodTable(obj); 446/// Boxes a given value using an input <see cref="MethodTable"/> to determine its type. 448/// <param name="methodTable">The <see cref="MethodTable"/> pointer to use to create the boxed instance.</param> 453internal static unsafe object? Box(MethodTable* methodTable, ref byte data) => 469internal static unsafe MethodTable* GetMethodTable(object obj) => GetMethodTable(obj); 474internal static unsafe partial bool AreTypesEquivalent(MethodTable* pMTa, MethodTable* pMTb); 732public MethodTable* MethodTable => GetMethodDescChunk()->MethodTable; 738public MethodTable* MethodTable; 784public MethodTable* ParentMethodTable; 816public MethodTable*** PerInstInfo; 822public MethodTable** InterfaceMap; 924internal static bool AreSameType(MethodTable* mt1, MethodTable* mt2) => mt1 == mt2; 1004/// <remarks>This method should only be called when the current <see cref="MethodTable"/> instance represents an array or string type.</remarks> 1028public extern MethodTable* GetMethodTableMatchingParentClass(MethodTable* parent); 1032public extern MethodTable* InstantiationArg0(); 1103internal MethodTable* _methodTable; 1202/// A type handle, which can wrap either a pointer to a <c>TypeDesc</c> or to a <see cref="MethodTable"/>. 1236/// Gets the <see cref="MethodTable"/> pointer wrapped by the current instance. 1241public MethodTable* AsMethodTable() 1245return (MethodTable*)m_asTAddr;
src\System\Runtime\CompilerServices\StaticsHelpers.cs (10)
19private static partial void GetThreadStaticsByMethodTable(ByteRefOnStack result, MethodTable* pMT, [MarshalAs(UnmanagedType.Bool)] bool gcStatics); 27private static ref byte GetNonGCStaticBaseSlow(MethodTable* mt) 35private static ref byte GetNonGCStaticBase(MethodTable* mt) 60private static ref byte GetGCStaticBaseSlow(MethodTable* mt) 68private static ref byte GetGCStaticBase(MethodTable* mt) 99return ref Unsafe.Subtract(ref RuntimeHelpers.GetRawData(obj), sizeof(MethodTable*)); 166private static ref byte GetNonGCThreadStaticBaseSlow(MethodTable* mt) 176private static ref byte GetGCThreadStaticBaseSlow(MethodTable* mt) 232private static ref byte GetNonGCThreadStaticBase(MethodTable* mt) 243private static ref byte GetGCThreadStaticBase(MethodTable* mt)
src\System\Runtime\CompilerServices\VirtualDispatchHelpers.cs (2)
18public MethodTable* _objectMethodTable; 23public VirtualResolutionData(MethodTable* objectMethodTable, IntPtr classHandle, IntPtr methodHandle)
src\System\RuntimeHandles.cs (18)
71internal static unsafe RuntimeType GetRuntimeType(MethodTable* pMT) 287internal static unsafe object InternalAlloc(MethodTable* pMT) 304private static unsafe partial void InternalAlloc(MethodTable* pMT, ObjectHandleOnStack result); 309internal static object InternalAllocNoChecks(MethodTable* pMT) 314static object InternalAllocNoChecksWorker(MethodTable* pMT) 324private static unsafe partial void InternalAllocNoChecks(MethodTable* pMT, ObjectHandleOnStack result); 328private static extern object? InternalAllocNoChecks_FastPath(MethodTable* pMT); 471private static unsafe partial IntPtr GetMethodAt(MethodTable* pMT, int slot); 550private static partial Interop.BOOL GetFields(MethodTable* pMT, Span<IntPtr> data, ref int usedCount); 572private static unsafe partial void GetInterfaces(MethodTable* pMT, ObjectHandleOnStack result); 675private static extern unsafe void* GetUtf8NameInternal(MethodTable* pMT); 1128private static extern unsafe MethodTable* GetMethodTable(RuntimeMethodHandleInternal method); 1133MethodTable* pMT = GetMethodTable(method); 1227MethodTable* pMT = RuntimeHelpers.GetMethodTable(src); 1242MethodTable* pMT = destNullableType.GetNativeTypeHandle().AsMethodTable(); 1565private static extern MethodTable* GetApproxDeclaringMethodTable(RuntimeFieldHandleInternal field); 1570MethodTable* pMT = GetApproxDeclaringMethodTable(field); 1712private static extern unsafe RuntimeFieldHandleInternal GetStaticFieldForGenericType(RuntimeFieldHandleInternal field, MethodTable* pMT);
src\System\RuntimeType.BoxCache.cs (1)
27private readonly MethodTable* _pMT;
src\System\RuntimeType.CoreCLR.cs (2)
1788MethodTable* pParentMT = typeHandle.AsMethodTable()->ParentMethodTable; 3420private static unsafe partial void GetGuid(MethodTable* pMT, Guid* result);
src\System\String.CoreCLR.cs (1)
16internal static extern unsafe string FastAllocateString(MethodTable *pMT, nint length);
src\System\StubHelpers.cs (4)
993RuntimeType marshalerType = RuntimeTypeHandle.GetRuntimeType((MethodTable*)pMT); 2043internal static unsafe void NonBlittableStructureArrayConvertToUnmanaged(Array* managedArray, byte* pNative, MethodTable* pInterfaceMT, int nativeSize, Exception* pException) 2066internal static unsafe void NonBlittableStructureArrayConvertToManaged(Array* managedArray, byte* pNative, MethodTable* pInterfaceMT, int nativeSize, Exception* pException) 2089internal static unsafe void NonBlittableStructureArrayFree(byte* pArray, nuint numElements, MethodTable* pInterfaceMT, int nativeSize, Exception* pException)
src\System\TypedReference.CoreCLR.cs (1)
39MethodTable* pMethodTable = typeHandle.IsTypeDesc
src\System\ValueType.cs (6)
74private static unsafe bool CanCompareBitsOrUseFastGetHashCode(MethodTable* pMT) 89private static unsafe partial bool CanCompareBitsOrUseFastGetHashCodeHelper(MethodTable* pMT); 108MethodTable* pMT = RuntimeHelpers.GetMethodTable(this); 125switch (GetHashCodeStrategy(pMT, ObjectHandleOnStack.Create(ref thisRef), out uint fieldOffset, out uint fieldSize, out MethodTable* fieldMT)) 169MethodTable* pMT, ObjectHandleOnStack objHandle, out uint fieldOffset, out uint fieldSize, out MethodTable* fieldMT);