74 references to GetMethodTable
System.Private.CoreLib (74)
src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\ExceptionHandling.cs (1)
1128MethodTable* 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)) && 408MethodTable* pMT = RuntimeHelpers.GetMethodTable(sourceArray); 409if (MethodTable.AreSameType(pMT, RuntimeHelpers.GetMethodTable(destinationArray)) && 464MethodTable* pMT = RuntimeHelpers.GetMethodTable(sourceArray); 536MethodTable* pDestArrayMT = RuntimeHelpers.GetMethodTable(destinationArray); 561else if (obj is null || RuntimeHelpers.GetMethodTable(obj) != pDestMT) 581MethodTable* pSrcArrayMT = RuntimeHelpers.GetMethodTable(sourceArray); 645nuint srcElSize = RuntimeHelpers.GetMethodTable(sourceArray)->ComponentSize; 646nuint destElSize = RuntimeHelpers.GetMethodTable(destinationArray)->ComponentSize; 669MethodTable* pMT = RuntimeHelpers.GetMethodTable(array); 697MethodTable* pMT = RuntimeHelpers.GetMethodTable(array); 728if (!RuntimeHelpers.GetMethodTable(this)->IsSzArray) 744if (!RuntimeHelpers.GetMethodTable(this)->IsSzArray)
src\System\Array.CoreCLR.cs (9)
74TypeHandle srcTH = RuntimeHelpers.GetMethodTable(sourceArray)->GetArrayElementTypeHandle(); 75TypeHandle destTH = RuntimeHelpers.GetMethodTable(destinationArray)->GetArrayElementTypeHandle(); 149MethodTable* pMethodTable = RuntimeHelpers.GetMethodTable(this); 191MethodTable* pMethodTable = RuntimeHelpers.GetMethodTable(this); 265MethodTable* pValueMethodTable = RuntimeHelpers.GetMethodTable(value); 313private unsafe MethodTable* ElementMethodTable => RuntimeHelpers.GetMethodTable(this)->GetArrayElementTypeHandle().AsMethodTable(); 317MethodTable* thisMT = RuntimeHelpers.GetMethodTable(this); 318return (IntPtr)thisMT->ElementType == (IntPtr)RuntimeHelpers.GetMethodTable(value); 326MethodTable* pArrayMT = RuntimeHelpers.GetMethodTable(this);
src\System\Delegate.CoreCLR.cs (2)
495MethodTable* pMT = RuntimeHelpers.GetMethodTable(this); 513MethodTable* pMT = RuntimeHelpers.GetMethodTable(this);
src\System\Enum.CoreCLR.cs (1)
29CorElementType elementType = RuntimeHelpers.GetMethodTable(this)->GetPrimitiveCorElementType();
src\System\GC.CoreCLR.cs (2)
360MethodTable* pMT = RuntimeHelpers.GetMethodTable(obj); 378MethodTable* pMT = RuntimeHelpers.GetMethodTable(obj);
src\System\IO\Stream.CoreCLR.cs (2)
19MethodTable* pMT = RuntimeHelpers.GetMethodTable(this); 33MethodTable* pMT = RuntimeHelpers.GetMethodTable(this);
src\System\MulticastDelegate.CoreCLR.cs (1)
171MulticastDelegate 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)
33ThrowInvalidCastExceptionInternal(RuntimeHelpers.GetMethodTable(fromType), toTypeHnd); 74void* mt = RuntimeHelpers.GetMethodTable(obj); 108MethodTable* mt = RuntimeHelpers.GetMethodTable(obj); 174if (obj == null || RuntimeHelpers.GetMethodTable(obj) == toTypeHnd) 177MethodTable* mt = RuntimeHelpers.GetMethodTable(obj)->ParentMethodTable; 226CastResult result = CastCache.TryGet(s_table!, (nuint)RuntimeHelpers.GetMethodTable(obj), (nuint)toTypeHnd); 251void* mt = RuntimeHelpers.GetMethodTable(obj); 277CastResult result = CastCache.TryGet(s_table!, (nuint)RuntimeHelpers.GetMethodTable(obj), (nuint)toTypeHnd); 295MethodTable* mt = RuntimeHelpers.GetMethodTable(obj); 358if (obj == null || RuntimeHelpers.GetMethodTable(obj) == toTypeHnd) 372MethodTable* mt = RuntimeHelpers.GetMethodTable(obj); 420if (RuntimeHelpers.GetMethodTable(obj) == toTypeHnd) 448void* elementType = RuntimeHelpers.GetMethodTable(array)->ElementType; 465void* elementType = RuntimeHelpers.GetMethodTable(array)->ElementType; 470if (elementType != RuntimeHelpers.GetMethodTable(obj)) 493CastResult result = CastCache.TryGet(s_table!, (nuint)RuntimeHelpers.GetMethodTable(obj), (nuint)elementType); 523void* elementType = RuntimeHelpers.GetMethodTable(array)->ElementType; 524Debug.Assert(elementType != RuntimeHelpers.GetMethodTable(obj)); // Should be handled by caller 526CastResult result = CastCache.TryGet(s_table!, (nuint)RuntimeHelpers.GetMethodTable(obj), (nuint)elementType); 645if (typeMT != RuntimeHelpers.GetMethodTable(obj)) 669if (!IsNullableForType(typeMT, RuntimeHelpers.GetMethodTable(obj))) 703MethodTable* pMT2 = RuntimeHelpers.GetMethodTable(obj);
src\System\Runtime\CompilerServices\RuntimeHelpers.CoreCLR.cs (9)
37MethodTable* pMT = GetMethodTable(array); 146MethodTable* pMT = GetMethodTable(obj); 276MethodTable* pMT = GetMethodTable(o1); 283if (pMT != GetMethodTable(o2)) 399MethodTable* pMT = GetMethodTable(obj); 416return GetMethodTable(array)->ComponentSize; 431int rank = GetMethodTable(array)->MultiDimensionalArrayRank; 442return GetMethodTable(obj)->HasComponentSize; 469internal 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 (1)
382=> (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)
1227MethodTable* pMT = RuntimeHelpers.GetMethodTable(src);
src\System\ValueType.cs (3)
41if (CanCompareBitsOrUseFastGetHashCode(RuntimeHelpers.GetMethodTable(obj))) // MethodTable kept alive by access to object below 46RuntimeHelpers.GetMethodTable(this)->GetNumInstanceFieldBytes()); 108MethodTable* pMT = RuntimeHelpers.GetMethodTable(this);