79 references to GetMethodTable
System.Private.CoreLib (79)
src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\ExceptionHandling.cs (1)
1143MethodTable* mt = RuntimeHelpers.GetMethodTable(exception);
src\libraries\System.Private.CoreLib\src\System\Array.cs (4)
365MethodTable* pMT = RuntimeHelpers.GetMethodTable(sourceArray); 366if (MethodTable.AreSameType(pMT, RuntimeHelpers.GetMethodTable(destinationArray)) && 394MethodTable* pMT = RuntimeHelpers.GetMethodTable(sourceArray); 395if (MethodTable.AreSameType(pMT, RuntimeHelpers.GetMethodTable(destinationArray)) &&
src\System\Array.CoreCLR.cs (21)
70MethodTable* pMT = RuntimeHelpers.GetMethodTable(sourceArray); 158TypeHandle srcTH = RuntimeHelpers.GetMethodTable(sourceArray)->GetArrayElementTypeHandle(); 159TypeHandle destTH = RuntimeHelpers.GetMethodTable(destinationArray)->GetArrayElementTypeHandle(); 234MethodTable* pDestArrayMT = RuntimeHelpers.GetMethodTable(destinationArray); 238Debug.Assert(!RuntimeHelpers.GetMethodTable(sourceArray)->GetArrayElementTypeHandle().AsMethodTable()->IsValueType); 258else if (obj is null || RuntimeHelpers.GetMethodTable(obj) != pDestMT) 276MethodTable* pSrcArrayMT = RuntimeHelpers.GetMethodTable(sourceArray); 280Debug.Assert(!RuntimeHelpers.GetMethodTable(destinationArray)->GetArrayElementTypeHandle().AsMethodTable()->IsValueType); 298void* destTH = RuntimeHelpers.GetMethodTable(destinationArray)->ElementType; 322nuint srcElSize = RuntimeHelpers.GetMethodTable(sourceArray)->ComponentSize; 323nuint destElSize = RuntimeHelpers.GetMethodTable(destinationArray)->ComponentSize; 356MethodTable* pMT = RuntimeHelpers.GetMethodTable(array); 384MethodTable* pMT = RuntimeHelpers.GetMethodTable(array); 415if (RuntimeHelpers.GetMethodTable(this)->IsMultiDimensionalArray) 431if (RuntimeHelpers.GetMethodTable(this)->IsMultiDimensionalArray) 457MethodTable* pMethodTable = RuntimeHelpers.GetMethodTable(this); 499MethodTable* pMethodTable = RuntimeHelpers.GetMethodTable(this); 573MethodTable* pValueMethodTable = RuntimeHelpers.GetMethodTable(value); 662MethodTable* thisMT = RuntimeHelpers.GetMethodTable(this); 663return (IntPtr)thisMT->ElementType == (IntPtr)RuntimeHelpers.GetMethodTable(value); 671MethodTable* 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 (1)
370MethodTable* pMT = RuntimeHelpers.GetMethodTable(obj);
src\System\IO\Stream.CoreCLR.cs (2)
17MethodTable* pMT = RuntimeHelpers.GetMethodTable(this); 31MethodTable* pMT = 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)
23ThrowInvalidCastException(RuntimeHelpers.GetMethodTable(fromType), toTypeHnd); 59void* mt = RuntimeHelpers.GetMethodTable(obj); 92MethodTable* mt = RuntimeHelpers.GetMethodTable(obj); 157if (obj == null || RuntimeHelpers.GetMethodTable(obj) == toTypeHnd) 160MethodTable* mt = RuntimeHelpers.GetMethodTable(obj)->ParentMethodTable; 208CastResult result = CastCache.TryGet(s_table!, (nuint)RuntimeHelpers.GetMethodTable(obj), (nuint)toTypeHnd); 232void* mt = RuntimeHelpers.GetMethodTable(obj); 257CastResult result = CastCache.TryGet(s_table!, (nuint)RuntimeHelpers.GetMethodTable(obj), (nuint)toTypeHnd); 274MethodTable* mt = RuntimeHelpers.GetMethodTable(obj); 336if (obj == null || RuntimeHelpers.GetMethodTable(obj) == toTypeHnd) 349MethodTable* mt = RuntimeHelpers.GetMethodTable(obj); 396if (RuntimeHelpers.GetMethodTable(obj) == toTypeHnd) 423void* elementType = RuntimeHelpers.GetMethodTable(array)->ElementType; 440void* elementType = RuntimeHelpers.GetMethodTable(array)->ElementType; 445if (elementType != RuntimeHelpers.GetMethodTable(obj)) 467CastResult result = CastCache.TryGet(s_table!, (nuint)RuntimeHelpers.GetMethodTable(obj), (nuint)elementType); 496void* elementType = RuntimeHelpers.GetMethodTable(array)->ElementType; 497Debug.Assert(elementType != RuntimeHelpers.GetMethodTable(obj)); // Should be handled by caller 499CastResult result = CastCache.TryGet(s_table!, (nuint)RuntimeHelpers.GetMethodTable(obj), (nuint)elementType); 574if (typeMT != RuntimeHelpers.GetMethodTable(obj)) 597if (!IsNullableForType(typeMT, RuntimeHelpers.GetMethodTable(obj))) 648MethodTable* 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)) 395MethodTable* pMT = GetMethodTable(obj); 412return GetMethodTable(array)->ComponentSize; 427int rank = GetMethodTable(array)->MultiDimensionalArrayRank; 438return GetMethodTable(obj)->HasComponentSize; 463internal 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)
1163MethodTable* pMT = RuntimeHelpers.GetMethodTable(src);
src\System\StubHelpers.cs (3)
1512MethodTable* pMT = RuntimeHelpers.GetMethodTable(obj); 1531MethodTable* pMT = RuntimeHelpers.GetMethodTable(obj); 1550MethodTable* 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);