79 references to GetMethodTable
System.Private.CoreLib (79)
src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\ExceptionHandling.cs (1)
1158MethodTable* mt = RuntimeHelpers.GetMethodTable(exception);
src\libraries\System.Private.CoreLib\src\System\Array.cs (14)
373MethodTable* pMT = RuntimeHelpers.GetMethodTable(sourceArray); 374if (MethodTable.AreSameType(pMT, RuntimeHelpers.GetMethodTable(destinationArray)) && 403MethodTable* pMT = RuntimeHelpers.GetMethodTable(sourceArray); 404if (MethodTable.AreSameType(pMT, RuntimeHelpers.GetMethodTable(destinationArray)) && 459MethodTable* pMT = RuntimeHelpers.GetMethodTable(sourceArray); 531MethodTable* pDestArrayMT = RuntimeHelpers.GetMethodTable(destinationArray); 556else if (obj is null || RuntimeHelpers.GetMethodTable(obj) != pDestMT) 576MethodTable* pSrcArrayMT = RuntimeHelpers.GetMethodTable(sourceArray); 640nuint srcElSize = RuntimeHelpers.GetMethodTable(sourceArray)->ComponentSize; 641nuint destElSize = RuntimeHelpers.GetMethodTable(destinationArray)->ComponentSize; 664MethodTable* pMT = RuntimeHelpers.GetMethodTable(array); 692MethodTable* pMT = RuntimeHelpers.GetMethodTable(array); 723if (!RuntimeHelpers.GetMethodTable(this)->IsSzArray) 739if (!RuntimeHelpers.GetMethodTable(this)->IsSzArray)
src\System\Array.CoreCLR.cs (9)
69TypeHandle srcTH = RuntimeHelpers.GetMethodTable(sourceArray)->GetArrayElementTypeHandle(); 70TypeHandle destTH = RuntimeHelpers.GetMethodTable(destinationArray)->GetArrayElementTypeHandle(); 144MethodTable* pMethodTable = RuntimeHelpers.GetMethodTable(this); 186MethodTable* pMethodTable = RuntimeHelpers.GetMethodTable(this); 260MethodTable* pValueMethodTable = RuntimeHelpers.GetMethodTable(value); 307private unsafe MethodTable* ElementMethodTable => RuntimeHelpers.GetMethodTable(this)->GetArrayElementTypeHandle().AsMethodTable(); 311MethodTable* thisMT = RuntimeHelpers.GetMethodTable(this); 312return (IntPtr)thisMT->ElementType == (IntPtr)RuntimeHelpers.GetMethodTable(value); 320MethodTable* pArrayMT = RuntimeHelpers.GetMethodTable(this);
src\System\Delegate.CoreCLR.cs (2)
493MethodTable* pMT = RuntimeHelpers.GetMethodTable(this); 510MethodTable* pMT = RuntimeHelpers.GetMethodTable(this);
src\System\Enum.CoreCLR.cs (1)
29CorElementType elementType = RuntimeHelpers.GetMethodTable(this)->GetPrimitiveCorElementType();
src\System\GC.CoreCLR.cs (2)
357MethodTable* pMT = RuntimeHelpers.GetMethodTable(obj); 375MethodTable* pMT = RuntimeHelpers.GetMethodTable(obj);
src\System\IO\Stream.CoreCLR.cs (2)
17MethodTable* pMT = RuntimeHelpers.GetMethodTable(this); 31MethodTable* pMT = RuntimeHelpers.GetMethodTable(this);
src\System\MulticastDelegate.CoreCLR.cs (1)
170MulticastDelegate result = Unsafe.As<MulticastDelegate>(RuntimeTypeHandle.InternalAllocNoChecks(RuntimeHelpers.GetMethodTable(this)));
src\System\Object.CoreCLR.cs (2)
16MethodTable* pMT = RuntimeHelpers.GetMethodTable(this); 39if (RuntimeHelpers.GetMethodTable(clone)->ContainsGCPointers)
src\System\Runtime\CompilerServices\CastHelpers.cs (22)
30ThrowInvalidCastExceptionInternal(RuntimeHelpers.GetMethodTable(fromType), toTypeHnd); 67void* mt = RuntimeHelpers.GetMethodTable(obj); 100MethodTable* mt = RuntimeHelpers.GetMethodTable(obj); 165if (obj == null || RuntimeHelpers.GetMethodTable(obj) == toTypeHnd) 168MethodTable* mt = RuntimeHelpers.GetMethodTable(obj)->ParentMethodTable; 216CastResult result = CastCache.TryGet(s_table!, (nuint)RuntimeHelpers.GetMethodTable(obj), (nuint)toTypeHnd); 240void* mt = RuntimeHelpers.GetMethodTable(obj); 265CastResult result = CastCache.TryGet(s_table!, (nuint)RuntimeHelpers.GetMethodTable(obj), (nuint)toTypeHnd); 282MethodTable* mt = RuntimeHelpers.GetMethodTable(obj); 344if (obj == null || RuntimeHelpers.GetMethodTable(obj) == toTypeHnd) 357MethodTable* mt = RuntimeHelpers.GetMethodTable(obj); 404if (RuntimeHelpers.GetMethodTable(obj) == toTypeHnd) 431void* elementType = RuntimeHelpers.GetMethodTable(array)->ElementType; 448void* elementType = RuntimeHelpers.GetMethodTable(array)->ElementType; 453if (elementType != RuntimeHelpers.GetMethodTable(obj)) 475CastResult result = CastCache.TryGet(s_table!, (nuint)RuntimeHelpers.GetMethodTable(obj), (nuint)elementType); 504void* elementType = RuntimeHelpers.GetMethodTable(array)->ElementType; 505Debug.Assert(elementType != RuntimeHelpers.GetMethodTable(obj)); // Should be handled by caller 507CastResult result = CastCache.TryGet(s_table!, (nuint)RuntimeHelpers.GetMethodTable(obj), (nuint)elementType); 621if (typeMT != RuntimeHelpers.GetMethodTable(obj)) 644if (!IsNullableForType(typeMT, RuntimeHelpers.GetMethodTable(obj))) 676MethodTable* pMT2 = RuntimeHelpers.GetMethodTable(obj);
src\System\Runtime\CompilerServices\RuntimeHelpers.CoreCLR.cs (9)
36MethodTable* pMT = GetMethodTable(array); 145MethodTable* pMT = GetMethodTable(obj); 274MethodTable* pMT = GetMethodTable(o1); 281if (pMT != GetMethodTable(o2)) 396MethodTable* pMT = GetMethodTable(obj); 413return GetMethodTable(array)->ComponentSize; 428int rank = GetMethodTable(array)->MultiDimensionalArrayRank; 439return GetMethodTable(obj)->HasComponentSize; 464internal static unsafe MethodTable* GetMethodTable(object obj) => GetMethodTable(obj);
src\System\Runtime\CompilerServices\VirtualDispatchHelpers.cs (3)
69s_virtualFunctionPointerCache.TrySet(new VirtualResolutionData(RuntimeHelpers.GetMethodTable(obj), classHandle, methodHandle), result); 77if (s_virtualFunctionPointerCache.TryGet(new VirtualResolutionData(RuntimeHelpers.GetMethodTable(obj), classHandle, methodHandle), out IntPtr result)) 90if (s_virtualFunctionPointerCache.TryGet(new VirtualResolutionData(RuntimeHelpers.GetMethodTable(obj), classHandle, methodHandle), out IntPtr result))
src\System\Runtime\InteropServices\Marshal.CoreCLR.cs (3)
249MethodTable* pMT = RuntimeHelpers.GetMethodTable(structure); 279MethodTable* pMT = RuntimeHelpers.GetMethodTable(structure); 335=> (obj == null) || !RuntimeHelpers.GetMethodTable(obj)->ContainsGCPointers;
src\System\Runtime\InteropServices\MemoryMarshal.CoreCLR.cs (1)
44return ref Unsafe.AddByteOffset(ref Unsafe.As<RawData>(array).Data, (nuint)RuntimeHelpers.GetMethodTable(array)->BaseSize - (nuint)(2 * sizeof(IntPtr)));
src\System\RuntimeHandles.cs (1)
1188MethodTable* pMT = RuntimeHelpers.GetMethodTable(src);
src\System\StubHelpers.cs (3)
1513MethodTable* pMT = RuntimeHelpers.GetMethodTable(obj); 1532MethodTable* pMT = RuntimeHelpers.GetMethodTable(obj); 1551MethodTable* pMT = RuntimeHelpers.GetMethodTable(obj);
src\System\ValueType.cs (3)
41if (CanCompareBitsOrUseFastGetHashCode(RuntimeHelpers.GetMethodTable(obj))) // MethodTable kept alive by access to object below 46RuntimeHelpers.GetMethodTable(this)->GetNumInstanceFieldBytes()); 106MethodTable* pMT = RuntimeHelpers.GetMethodTable(this);