src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\CachedInterfaceDispatch.cs (11)
50MethodTable* pInstanceType = pObject.GetMethodTable();
65private static IntPtr RhResolveDispatch(object pObject, MethodTable* interfaceType, ushort slot)
76private static IntPtr RhResolveDispatchOnType(MethodTable* pInstanceType, MethodTable* pInterfaceType, ushort slot)
86private static IntPtr RhResolveStaticDispatchOnType(MethodTable* pInstanceType, MethodTable* pInterfaceType, ushort slot, MethodTable** ppGenericContext)
96private static IntPtr RhResolveDynamicInterfaceCastableDispatchOnType(MethodTable* pInstanceType, MethodTable* pInterfaceType, ushort slot, MethodTable** ppGenericContext)
123MethodTable* pInstanceType = pObject.GetMethodTable();
src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\RuntimeExports.cs (16)
22public static unsafe object RhNewObject(MethodTable* pEEType)
59public static unsafe object RhNewArray(MethodTable* pEEType, nint length)
77public static unsafe object RhNewVariableSizeObject(MethodTable* pEEType, int length)
101internal static unsafe IntPtr RhGetNewObjectHelper(MethodTable* pEEType)
116return (IntPtr)(delegate*<MethodTable*, object>)&InternalCalls.RhpNewFinalizable;
118return (IntPtr)(delegate*<MethodTable*, object>)&InternalCalls.RhpNewFast;
121public static unsafe object RhBox(MethodTable* pEEType, ref byte data)
172public static unsafe object RhBoxAny(ref byte data, MethodTable* pEEType)
184private static unsafe bool UnboxAnyTypeCompare(MethodTable* pEEType, MethodTable* ptrUnboxToEEType)
215public static unsafe ref byte RhUnbox2(MethodTable* pUnboxToEEType, object obj)
225public static unsafe void RhUnboxNullable(ref byte data, MethodTable* pUnboxToEEType, object obj)
234public static unsafe void RhUnboxTypeTest(MethodTable* pType, MethodTable* pBoxType)
245public static unsafe void RhUnbox(object? obj, ref byte data, MethodTable* pUnboxToEEType)
260MethodTable* pEEType = obj.GetMethodTable();
src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\TypeCast.cs (69)
66public static unsafe object? IsInstanceOfAny(MethodTable* pTargetType, object? obj)
70MethodTable* mt = obj.GetMethodTable();
96public static unsafe object? IsInstanceOfInterface(MethodTable* pTargetType, object? obj)
105MethodTable* mt = obj.GetMethodTable();
109MethodTable** interfaceMap = mt->InterfaceMap;
175private static unsafe object? IsInstanceOfInterface_Helper(MethodTable* pTargetType, object? obj)
185public static unsafe object? IsInstanceOfClass(MethodTable* pTargetType, object? obj)
208MethodTable* mt = obj.GetMethodTable()->NonArrayBaseType;
248public static unsafe bool IsInstanceOfException(MethodTable* pTargetType, object? obj)
255MethodTable* pObjType = obj.GetMethodTable();
278public static unsafe object CheckCastAny(MethodTable* pTargetType, object obj)
284MethodTable* mt = obj.GetMethodTable();
305public static unsafe object CheckCastInterface(MethodTable* pTargetType, object obj)
314MethodTable* mt = obj.GetMethodTable();
321MethodTable** interfaceMap = mt->InterfaceMap;
375private static unsafe object CheckCastInterface_Helper(MethodTable* pTargetType, object obj)
390public static unsafe object CheckCastClass(MethodTable* pTargetType, object obj)
407private static unsafe object CheckCastClassSpecial(MethodTable* pTargetType, object obj)
414MethodTable* mt = obj.GetMethodTable();
470private static unsafe bool IsInstanceOfInterfaceViaIDynamicInterfaceCastable(MethodTable* pTargetType, object obj, bool throwing)
475internal static unsafe bool IsDerived(MethodTable* pDerivedType, MethodTable* pBaseType)
502private static unsafe bool ImplementsInterface(MethodTable* pObjType, MethodTable* pTargetType, EETypePairList* pVisited)
509MethodTable** interfaceMap = pObjType->InterfaceMap;
512MethodTable* pInterfaceType = interfaceMap[i];
530MethodTable* pTargetGenericType = pTargetType->GenericDefinition;
540MethodTable* pInterfaceType = interfaceMap[i];
549MethodTable* pInterfaceGenericType = pInterfaceType->GenericDefinition;
582private static unsafe bool TypesAreCompatibleViaGenericVariance(MethodTable* pSourceType, MethodTable* pTargetType, EETypePairList* pVisited)
584MethodTable* pTargetGenericType = pTargetType->GenericDefinition;
585MethodTable* pSourceGenericType = pSourceType->GenericDefinition;
639MethodTable* pTargetArgType = targetInstantiation[i];
640MethodTable* pSourceArgType = sourceInstantiation[i];
722MethodTable* arrayElemType = array.GetMethodTable()->RelatedParameterType;
754public static unsafe ref object? LdelemaRef(object?[] array, nint index, MethodTable* elementType)
777MethodTable* arrayElemType = array.GetMethodTable()->RelatedParameterType;
797MethodTable* elementType = array.GetMethodTable()->RelatedParameterType;
816if (array.GetMethodTable() == MethodTable.Of<object[]>())
824private static unsafe void StelemRef_Helper(ref object? element, MethodTable* elementType, object obj)
836private static unsafe void StelemRef_Helper_NoCacheLookup(ref object? element, MethodTable* elementType, object obj)
849private static unsafe object IsInstanceOfArray(MethodTable* pTargetType, object obj)
851MethodTable* pObjType = obj.GetMethodTable();
887private static unsafe object CheckCastArray(MethodTable* pTargetEEType, object obj)
902private static unsafe object IsInstanceOfVariantType(MethodTable* pTargetType, object obj)
914private static unsafe object CheckCastVariantType(MethodTable* pTargetType, object obj)
926internal static unsafe EETypeElementType GetNormalizedIntegralArrayElementType(MethodTable* type)
947private static unsafe object ThrowInvalidCastException(MethodTable* pMT)
954private MethodTable* _eetype1;
955private MethodTable* _eetype2;
958public EETypePairList(MethodTable* pEEType1, MethodTable* pEEType2, EETypePairList* pNext)
965public static bool Exists(EETypePairList* pList, MethodTable* pEEType1, MethodTable* pEEType2)
986public static unsafe bool AreTypesAssignable(MethodTable* pSourceType, MethodTable* pTargetType)
1002MethodTable* pNullableType = pTargetType->NullableType;
1012public static unsafe bool AreTypesAssignableInternal(MethodTable* pSourceType, MethodTable* pTargetType, AssignmentVariation variation, EETypePairList* pVisited)
1029private static unsafe bool CacheMiss(MethodTable* pSourceType, MethodTable* pTargetType, AssignmentVariation variation, EETypePairList* pVisited)
1056internal static unsafe bool AreTypesAssignableInternalUncached(MethodTable* pSourceType, MethodTable* pTargetType, AssignmentVariation variation, EETypePairList* pVisited)
1099MethodTable* pSourceRelatedParameterType = pSourceType->RelatedParameterType;
1207private static unsafe object? IsInstanceOfAny_NoCacheLookup(MethodTable* pTargetType, object obj)
1209MethodTable* pSourceType = obj.GetMethodTable();
1246private static unsafe object CheckCastAny_NoCacheLookup(MethodTable* pTargetType, object obj)
1248MethodTable* pSourceType = obj.GetMethodTable();
System\InvokeUtils.cs (12)
9using MethodTable = Internal.Runtime.MethodTable;
43internal static object? CheckArgument(object? srcObject, MethodTable* dstEEType, CheckArgumentSemantics semantics, BinderBundle? binderBundle)
58throw CreateChangeTypeException(MethodTable.Of<object>(), dstEEType, semantics);
68MethodTable* srcEEType = srcObject.GetMethodTable();
82internal static object? CheckArgumentConversions(object srcObject, MethodTable* dstEEType, CheckArgumentSemantics semantics, BinderBundle? binderBundle)
102private static Exception ConvertOrWidenPrimitivesEnumsAndPointersIfPossible(object srcObject, MethodTable* dstEEType, CheckArgumentSemantics semantics, out object? dstObject)
104MethodTable* srcEEType = srcObject.GetMethodTable();
375private static Exception ConvertPointerIfPossible(object srcObject, MethodTable* dstEEType, CheckArgumentSemantics semantics, out object dstPtr)
396private static Exception CreateChangeTypeException(MethodTable* srcEEType, MethodTable* dstEEType, CheckArgumentSemantics semantics)
411internal static ArgumentException CreateChangeTypeArgumentException(MethodTable* srcEEType, MethodTable* dstEEType, bool destinationIsByRef = false)
System\Runtime\RuntimeImports.cs (22)
229internal static unsafe partial void RhAllocateNewArray(MethodTable* pArrayEEType, uint numElements, uint flags, void* pResult);
375internal static extern unsafe bool AreTypesAssignable(MethodTable* pSourceType, MethodTable* pTargetType);
389internal static extern unsafe object RhBoxAny(ref byte pData, MethodTable* pEEType);
393internal static extern unsafe object RhNewObject(MethodTable* pEEType);
397internal static extern unsafe Array RhNewArray(MethodTable* pEEType, nint length);
401internal static extern unsafe Array RhNewVariableSizeObject(MethodTable* pEEType, int length);
405internal static extern unsafe IntPtr RhGetNewObjectHelper(MethodTable* pEEType);
409internal static extern unsafe void RhUnbox(object? obj, ref byte data, MethodTable* pUnboxToEEType);
437internal static extern unsafe int RhGetGCDescSize(MethodTable* eeType);
441internal static extern unsafe IntPtr RhNewInterfaceDispatchCell(MethodTable* pEEType, int slotNumber);
445internal static extern unsafe IntPtr RhResolveDispatch(object pObject, MethodTable* pInterfaceType, ushort slot);
453internal static extern unsafe IntPtr RhResolveDispatchOnType(MethodTable* instanceType, MethodTable* interfaceType, ushort slot);
457internal static extern unsafe IntPtr RhResolveStaticDispatchOnType(MethodTable* instanceType, MethodTable* interfaceType, ushort slot, MethodTable** pGenericContext);
461internal static extern unsafe IntPtr RhResolveDynamicInterfaceCastableDispatchOnType(MethodTable* instanceType, MethodTable* interfaceType, ushort slot, MethodTable** pGenericContext);
485internal static extern unsafe bool RhRegisterRefCountedHandleCallback(IntPtr pCalloutMethod, MethodTable* pTypeFilter);
489internal static extern unsafe void RhUnregisterRefCountedHandleCallback(IntPtr pCalloutMethod, MethodTable* pTypeFilter);