120 references to GetMethodTable
System.Private.CoreLib (120)
Internal\Runtime\Augments\RuntimeAugments.cs (5)
149Debug.Assert(value.GetMethodTable()->ValueTypeSize == IntPtr.Size); 150elementMT = value.GetMethodTable(); 155Debug.Assert(value.GetMethodTable()->IsValueType && elementMT->ValueTypeSize == value.GetMethodTable()->ValueTypeSize); 618MethodTable* srcEEType = srcObject.GetMethodTable();
Internal\Runtime\CompilerHelpers\InteropHelpers.cs (5)
514if (o.GetMethodTable()->IsArray || 530if (o.GetMethodTable()->IsArray || 543if (o.GetMethodTable()->IsArray || 558if (o.GetMethodTable()->IsArray || 625if (!RuntimeImports.AreTypesAssignable(marshaller.GetMethodTable(), MethodTable.Of<ICustomMarshaler>()))
src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\__Finalizer.cs (1)
66((delegate*<object, void>)target.GetMethodTable()->FinalizerCode)(target);
src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\CachedInterfaceDispatch.cs (4)
90GetDispatchCellInfo(pObject.GetMethodTable()->TypeManager, pCell, out cellInfo); 95return UpdateDispatchCellCache(pCell, pTargetCode, pObject.GetMethodTable()); 181MethodTable* pInstanceType = pObject.GetMethodTable(); 272MethodTable* pInstanceType = pObject.GetMethodTable();
src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\ExceptionHandling.cs (2)
161(IntPtr)InternalCalls.RhpGetClasslibFunctionFromEEType(exception.GetMethodTable(), ClassLibFunctionId.OnFirstChance); 183(IntPtr)InternalCalls.RhpGetClasslibFunctionFromEEType(exception.GetMethodTable(), ClassLibFunctionId.OnUnhandledException);
src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\RuntimeExports.cs (3)
217if ((obj == null) || !UnboxAnyTypeCompare(obj.GetMethodTable(), pUnboxToEEType)) 227if (obj != null && obj.GetMethodTable() != pUnboxToEEType->NullableType) 260MethodTable* pEEType = obj.GetMethodTable();
src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\TypeCast.cs (33)
70MethodTable* mt = obj.GetMethodTable(); 105MethodTable* mt = obj.GetMethodTable(); 192if (obj == null || obj.GetMethodTable() == pTargetType) 195if (!obj.GetMethodTable()->IsCanonical) 198Debug.Assert(obj.GetMethodTable()->IsArray); 208MethodTable* mt = obj.GetMethodTable()->NonArrayBaseType; 255MethodTable* pObjType = obj.GetMethodTable(); 284MethodTable* mt = obj.GetMethodTable(); 314MethodTable* mt = obj.GetMethodTable(); 379if (obj.GetMethodTable()->IsIDynamicInterfaceCastable 397if (obj == null || obj.GetMethodTable() == pTargetType) 414MethodTable* mt = obj.GetMethodTable(); 720Debug.Assert(array.GetMethodTable()->IsArray, "first argument must be an array"); 722MethodTable* arrayElemType = array.GetMethodTable()->RelatedParameterType; 723if (AreTypesAssignableInternal(obj.GetMethodTable(), arrayElemType, AssignmentVariation.BoxedSource, null)) 728if (obj.GetMethodTable()->IsIDynamicInterfaceCastable && IsInstanceOfInterfaceViaIDynamicInterfaceCastable(arrayElemType, obj, throwing: false)) 734throw array.GetMethodTable()->GetClasslibException(ExceptionIDs.ArrayTypeMismatch); 741throw array.GetMethodTable()->GetClasslibException(ExceptionIDs.IndexOutOfRange); 748throw array.GetMethodTable()->GetClasslibException(ExceptionIDs.ArrayTypeMismatch); 756Debug.Assert(array is null || array.GetMethodTable()->IsArray, "first argument must be an array"); 777MethodTable* arrayElemType = array.GetMethodTable()->RelatedParameterType; 788Debug.Assert(array is null || array.GetMethodTable()->IsArray, "first argument must be an array"); 797MethodTable* elementType = array.GetMethodTable()->RelatedParameterType; 802if (elementType != obj.GetMethodTable()) 816if (array.GetMethodTable() == MethodTable.Of<object[]>()) 826CastResult result = s_castCache.TryGet((nuint)obj.GetMethodTable() + (int)AssignmentVariation.BoxedSource, (nuint)elementType); 851MethodTable* pObjType = obj.GetMethodTable(); 904if (!AreTypesAssignableInternal(obj.GetMethodTable(), pTargetType, AssignmentVariation.BoxedSource, null) 905&& (!obj.GetMethodTable()->IsIDynamicInterfaceCastable 916if (!AreTypesAssignableInternal(obj.GetMethodTable(), pTargetType, AssignmentVariation.BoxedSource, null) 917&& (!obj.GetMethodTable()->IsIDynamicInterfaceCastable 1209MethodTable* pSourceType = obj.GetMethodTable(); 1248MethodTable* pSourceType = obj.GetMethodTable();
src\runtime\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)
System\Array.NativeAot.cs (8)
281Debug.Assert(!this.GetMethodTable()->IsSzArray); 287return this.GetMethodTable()->MultiDimensionalArrayRank; 375return this.GetMethodTable()->ArrayRank; 410if (value != null && !(value.GetMethodTable() == pElementEEType) && pElementEEType->IsEnum) 414Debug.Assert(value == null || RuntimeImports.AreTypesAssignable(value.GetMethodTable(), pElementEEType)); 436internal unsafe MethodTable* ElementMethodTable => this.GetMethodTable()->RelatedParameterType; 445return ElementMethodTable == o.GetMethodTable(); 455return this.GetMethodTable()->ComponentSize;
System\Delegate.cs (4)
105typeOfFirstParameterIfInstanceDelegate = new RuntimeTypeHandle(_firstParameter.GetMethodTable()); 380return a.GetMethodTable() == b.GetMethodTable(); 455Delegate result = Unsafe.As<Delegate>(RuntimeImports.RhNewObject(this.GetMethodTable()));
System\Enum.NativeAot.cs (2)
76return new EETypePtr(this.GetMethodTable()).CorElementType; 90MethodTable* eeType = value.GetMethodTable();
System\Exception.NativeAot.cs (1)
236pHeader->ExceptionEEType = (nint)this.GetMethodTable();
System\InvokeUtils.cs (3)
68MethodTable* srcEEType = srcObject.GetMethodTable(); 104MethodTable* srcEEType = srcObject.GetMethodTable(); 393return CreateChangeTypeException(srcObject.GetMethodTable(), dstEEType, semantics);
System\Object.NativeAot.cs (4)
31object clone = this.GetMethodTable()->IsArray ? 32RuntimeImports.RhNewVariableSizeObject(this.GetMethodTable(), Unsafe.As<Array>(this).Length) : 33RuntimeImports.RhNewObject(this.GetMethodTable()); 41if (this.GetMethodTable()->ContainsGCPointers)
System\Reflection\DynamicInvokeInfo.cs (2)
624MethodTable* srcEEType = arg.GetMethodTable(); 692MethodTable* srcEEType = arg.GetMethodTable();
System\Runtime\CompilerServices\RuntimeHelpers.NativeAot.cs (8)
54MethodTable* eeType = obj.GetMethodTable(); 70if (!o1.GetMethodTable()->IsValueType) 74if (o1.GetMethodTable() != o2.GetMethodTable()) 185MethodTable* pMT = GetMethodTable(obj); 199return array.GetMethodTable()->ComponentSize; 203internal static unsafe MethodTable* GetMethodTable(this object obj) => obj.GetMethodTable(); 213return GetMethodTable(obj)->HasComponentSize;
System\Runtime\InteropServices\Marshal.NativeAot.cs (6)
55if (!allowValueClasses && structure.GetMethodTable()->IsValueType) 65MethodTable* structureMT = structure.GetMethodTable(); 122MethodTable* structureMT = structure.GetMethodTable(); 180return (o == null) || !o.GetMethodTable()->ContainsGCPointers; 243if (ptr.GetMethodTable()->IsArray || 321if (ptr.GetMethodTable()->IsArray ||
System\Runtime\InteropServices\MemoryMarshal.NativeAot.cs (1)
46return ref Unsafe.AddByteOffset(ref Unsafe.As<RawData>(array).Data, (nuint)array.GetMethodTable()->BaseSize - (nuint)(2 * sizeof(IntPtr)));
System\Runtime\InteropServices\PInvokeMarshal.cs (2)
55if (del.GetMethodTable()->IsGeneric) 140IntPtr pTarget = RuntimeInteropData.GetDelegateMarshallingStub(new RuntimeTypeHandle(del.GetMethodTable()), openStaticFunctionPointer != IntPtr.Zero);
System\Runtime\TypeLoaderExports.cs (4)
101if (TryGetFromCache((IntPtr)obj.GetMethodTable(), RuntimeMethodHandle.ToIntPtr(slot), out var v)) 109Value v = CacheMiss((IntPtr)obj.GetMethodTable(), RuntimeMethodHandle.ToIntPtr(slot), 119if (!TryGetFromCache((IntPtr)obj.GetMethodTable(), openResolver, out var v)) 121v = CacheMiss((IntPtr)obj.GetMethodTable(), openResolver,
System\RuntimeType.NativeAot.cs (2)
168if (value.GetMethodTable() != this.ToMethodTableMayBeNull()) 174if (!(underlyingType.TypeHandle.ToMethodTable() == value.GetMethodTable()))
System\ValueType.cs (6)
48return -(int)this.GetMethodTable()->ValueTypeSize; 55Debug.Assert(valueTypeSize <= (int)this.GetMethodTable()->ValueTypeSize); 62if (obj == null || obj.GetMethodTable() != this.GetMethodTable()) 73Debug.Assert(!this.GetMethodTable()->ContainsGCPointers); 108hashCode.Add((IntPtr)this.GetMethodTable());