723 references to RuntimeType
System.Private.CoreLib (723)
src\libraries\System.Private.CoreLib\src\System\Activator.RuntimeType.cs (3)
36if (type.UnderlyingSystemType is not RuntimeType rt) 97if (type.UnderlyingSystemType is not RuntimeType rt) 141var rtType = (RuntimeType)typeof(T);
src\libraries\System.Private.CoreLib\src\System\Array.cs (16)
78RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 93RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 110RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 127RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 155RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 210RuntimeType? t = arrayType as RuntimeType; 247RuntimeType? t = arrayType as RuntimeType; 303RuntimeType? t = arrayType as RuntimeType;
src\libraries\System.Private.CoreLib\src\System\DefaultBinder.cs (4)
549if (!(realTypes[i] is RuntimeType || realTypes[i] is SignatureType)) 588if (type.UnderlyingSystemType is not RuntimeType rtType || 675if (indexes[j].UnderlyingSystemType is not RuntimeType rtType || 693if (returnType.UnderlyingSystemType is not RuntimeType rtType ||
src\libraries\System.Private.CoreLib\src\System\Enum.cs (42)
59RuntimeType rt = (RuntimeType)typeof(TEnum); 100internal static string? GetName(RuntimeType enumType, ulong uint64Value) 223RuntimeType rt = (RuntimeType)typeof(TEnum); 256internal static string[] GetNamesNoCopy(RuntimeType enumType) 292Array values = GetValuesAsUnderlyingTypeNoCopy((RuntimeType)typeof(TEnum)); 339internal static Array GetValuesAsUnderlyingType(RuntimeType enumType) 369internal static Array GetValuesAsUnderlyingTypeNoCopy(RuntimeType enumType) 474RuntimeType rt = (RuntimeType)typeof(TEnum); 492internal static bool IsDefinedPrimitive<TStorage>(RuntimeType enumType, TStorage value) 723RuntimeType rt = ValidateRuntimeType(enumType); 774static bool TryParseRareTypes(RuntimeType rt, ReadOnlySpan<char> value, bool ignoreCase, bool throwOnFailure, [NotNullWhen(true)] out long result) 891RuntimeType rt = (RuntimeType)typeof(TEnum); 915RuntimeType enumType, ReadOnlySpan<char> value, bool ignoreCase, bool throwOnFailure, out TUnderlying result) 973RuntimeType enumType, ReadOnlySpan<char> value, bool ignoreCase, bool throwOnFailure, out TUnderlying result) 1043private static bool TryParseByName<TStorage>(RuntimeType enumType, ReadOnlySpan<char> value, bool ignoreCase, bool throwOnFailure, out TStorage result) 1356RuntimeType enumType = (RuntimeType)GetType(); 1373static string HandleRareTypes(RuntimeType enumType, ref byte rawData) => 1404RuntimeType enumType = (RuntimeType)GetType(); 1424static string HandleRareTypes(RuntimeType enumType, char formatChar, ref byte rawData) => 1451private static string ToString<TUnderlying, TStorage>(RuntimeType enumType, ref byte rawData) 1463private static string ToStringInlined<TUnderlying, TStorage>(RuntimeType enumType, ref byte rawData) 1480private static string ToString<TUnderlying, TStorage>(RuntimeType enumType, char format, ref byte rawData) 1493private static string ToStringInlined<TUnderlying, TStorage>(RuntimeType enumType, char format, ref byte rawData) 1629RuntimeType rtType = ValidateRuntimeType(enumType); 1689RuntimeType enumType = (RuntimeType)GetType(); 1749RuntimeType rt = (RuntimeType)typeof(TEnum); 1808RuntimeType rt = (RuntimeType)typeof(TEnum); 1856private static bool TryFormatPrimitiveDefault<TUnderlying, TStorage>(RuntimeType enumType, TUnderlying value, Span<char> destination, out int charsWritten) 1891private static bool TryFormatPrimitiveNonDefault<TUnderlying, TStorage>(RuntimeType enumType, TUnderlying value, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format) 2125private static RuntimeType ValidateRuntimeType(Type enumType) 2129RuntimeType? rt = enumType as RuntimeType; 2147throw new ArgumentException(enumType is not RuntimeType ? SR.Arg_MustBeType : SR.Arg_MustBeEnum, nameof(enumType));
src\libraries\System.Private.CoreLib\src\System\Reflection\ConstructorInvoker.cs (4)
32private readonly RuntimeType[] _argTypes; 61private ConstructorInvoker(RuntimeConstructorInfo constructor, RuntimeType[] argumentTypes) 398Debug.Assert(((RuntimeType)copyOfParameters[i]!.GetType()).IsNullableOfT); 412RuntimeType sigType = _argTypes[i];
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\DynamicMethod.cs (8)
233_parameterTypes = new RuntimeType[signature.Length]; 238_parameterTypes[i] = (signature[i].UnderlyingSystemType as RuntimeType)!; 245_parameterTypes = Array.Empty<RuntimeType>(); 250(RuntimeType)typeof(void) : 251(returnType.UnderlyingSystemType as RuntimeType) ?? throw new NotSupportedException(SR.Arg_InvalidTypeInRetType); 269if (owner?.UnderlyingSystemType is RuntimeType rtOwner) 350if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 411internal RuntimeType[] ArgumentTypes => _parameterTypes;
src\libraries\System.Private.CoreLib\src\System\Reflection\FieldAccessor.cs (10)
43RuntimeType fieldType = (RuntimeType)_fieldInfo.FieldType; 178object? ret = RuntimeFieldHandle.GetValue(_fieldInfo, obj, (RuntimeType)_fieldInfo.FieldType, _fieldInfo.m_declaringType, ref isClassInitialized); 193return RuntimeFieldHandle.GetValue(_fieldInfo, obj, (RuntimeType)_fieldInfo.FieldType, _fieldInfo.m_declaringType, ref isClassInitialized); 199if (_fieldInfo.DeclaringType is not null && ((RuntimeType)_fieldInfo.FieldType).IsNullableOfT) 303RuntimeFieldHandle.SetValue(_fieldInfo, obj, value, (RuntimeType)_fieldInfo.FieldType, _fieldInfo.m_declaringType, ref isClassInitialized); 330RuntimeFieldHandle.SetValue(_fieldInfo, obj, value, (RuntimeType)_fieldInfo.FieldType, _fieldInfo.m_declaringType, ref isClassInitialized); 370if (((RuntimeType)_fieldInfo.FieldType).IsActualValueType) 372((RuntimeType)_fieldInfo.FieldType).CheckValue(ref value, binder, culture, invokeAttr); 377((RuntimeType)_fieldInfo.FieldType).CheckValue(ref value, binder, culture, invokeAttr);
src\libraries\System.Private.CoreLib\src\System\Reflection\InvokerEmitUtil.cs (11)
52RuntimeType parameterType = (RuntimeType)parameters[i].ParameterType; 120RuntimeType parameterType = (RuntimeType)parameters[i].ParameterType; 186RuntimeType parameterType = (RuntimeType)parameters[i].ParameterType; 247RuntimeType returnType; 250returnType = (RuntimeType)rmi.ReturnType; 255returnType = (RuntimeType)((DynamicMethod)method).ReturnType; 279RuntimeType elementType = (RuntimeType)returnType.GetElementType()!;
src\libraries\System.Private.CoreLib\src\System\Reflection\InvokeUtils.cs (2)
14public static object ConvertOrWiden(RuntimeType srcType, object srcObject, RuntimeType dstType, CorElementType dstElementType)
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBase.cs (1)
142internal static object? HandleTypeMissing(ParameterInfo paramInfo, RuntimeType sigType)
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (8)
25private readonly RuntimeType[] _argTypes; 30private MethodBaseInvoker(MethodBase method, RuntimeType[] argumentTypes) 333Debug.Assert(((RuntimeType)copyOfParameters[i]!.GetType()).IsNullableOfT); 357RuntimeType sigType = _argTypes[i]; 392private static bool TryByRefFastPath(RuntimeType type, ref object arg) 394if (RuntimeType.TryGetByRefElementType(type, out RuntimeType? sigElementType) && 401arg = RuntimeType.AllocateValueType(sigElementType, arg);
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvoker.cs (4)
33private readonly RuntimeType[] _argTypes; 80private MethodInvoker(MethodBase method, RuntimeType[] argumentTypes) 451Debug.Assert(((RuntimeType)copyOfParameters[i]!.GetType()).IsNullableOfT); 465RuntimeType sigType = _argTypes[i];
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvokerCommon.cs (3)
14RuntimeType[] argumentTypes, 41RuntimeType type = argumentTypes[i]; 44type = (RuntimeType)type.GetElementType()!;
src\libraries\System.Private.CoreLib\src\System\Reflection\Pointer.cs (4)
15private readonly RuntimeType _ptrType; 17private Pointer(void* ptr, RuntimeType ptrType) 29if (type is not RuntimeType rtType) 60internal RuntimeType GetPointerType() => _ptrType;
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceManager.cs (1)
224if (resourceSource is not RuntimeType)
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\QCallHandles.cs (1)
119internal QCallTypeHandle(ref RuntimeType type)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (10)
94return SizeOfHelper((RuntimeType)structure.GetType(), throwIfNotMarshalable: true); 101return SizeOfHelper((RuntimeType)structure.GetType(), throwIfNotMarshalable: true); 110if (t is not RuntimeType rt) 124RuntimeType t = (RuntimeType)typeof(T); 571if (structureType is not RuntimeType) 1053if (type is not RuntimeType) 1097if (t is not RuntimeType rt) 1121RuntimeType rt = (RuntimeType)typeof(TDelegate);
src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfo.cs (2)
339if (type is not RuntimeType) 356Debug.Assert(type is RuntimeType, "[SerializationInfo.GetValue]type is not a runtime type");
src\libraries\System.Private.CoreLib\src\System\RuntimeType.cs (25)
62if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 102RuntimeType valueType = (RuntimeType)value.GetType(); 195if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 209RuntimeType valueType = (RuntimeType)value.GetType(); 216valueType = (RuntimeType)valueType.GetEnumUnderlyingType(); 227RuntimeType underlyingType = Enum.InternalGetUnderlyingType(this); 269if (c.UnderlyingSystemType is RuntimeType fromType) 454static FieldInfo[]? GetFields(RuntimeType thisType, string name, BindingFlags bindingFlags) 571static MethodInfo[]? GetMethods(RuntimeType thisType, string name, BindingFlags bindingFlags) 612static PropertyInfo[]? GetProperties(RuntimeType thisType, string name, BindingFlags bindingFlags) 693private RuntimeType? GetBaseType() 702RuntimeType baseType = ObjectType; 706RuntimeType constraint = (RuntimeType)constraints[i]; 736private static void ThrowIfTypeNeverValidGenericArgument(RuntimeType type) 743internal static void SanityCheckGenericArguments(RuntimeType[] genericArguments, RuntimeType[] genericParameters) 760RuntimeType type = this; 763type = (RuntimeType)Enum.GetUnderlyingType(type); 771internal static bool TryGetByRefElementType(RuntimeType type, [NotNullWhen(true)] out RuntimeType? elementType) 905internal static object? AllocateValueType(RuntimeType type, object? value) 929RuntimeType? sigElementType;
src\libraries\System.Private.CoreLib\src\System\Type.cs (8)
35if (this is RuntimeType rt) 497if (RuntimeHelpers.IsKnownConstant(type) && type is RuntimeType) 499return GetRuntimeTypeCode((RuntimeType)type); 505internal static TypeCode GetRuntimeTypeCode(RuntimeType type) 507RuntimeType underlyingType = type; 509underlyingType = (RuntimeType)type.GetEnumUnderlyingType(); 702if (left is null || right is null || left is RuntimeType || right is RuntimeType)
src\libraries\System.Private.CoreLib\src\System\Type.Helpers.cs (3)
22if (underlyingType is RuntimeType) 81if (this is RuntimeType rt) 348if (toType is RuntimeType)
src\libraries\System.Private.CoreLib\src\System\TypedReference.cs (4)
30RuntimeType targetType = (RuntimeType)target.GetType(); 44RuntimeType fieldType = (RuntimeType)field.FieldType;
src\System\Array.CoreCLR.cs (8)
22private static unsafe Array InternalCreate(RuntimeType elementType, int rank, int* pLengths, int* pLowerBounds) 30private static unsafe Array InternalCreateFromArrayType(RuntimeType arrayType, int rank, int* pLengths, int* pLowerBounds) 698RuntimeType arrayType = (RuntimeType)GetType(); 713internal sealed unsafe partial class ArrayInitializeCache : RuntimeType.IGenericCacheEntry<ArrayInitializeCache> 725public static ArrayInitializeCache Create(RuntimeType arrayType) => new(GetElementConstructorEntrypoint(new QCallTypeHandle(ref arrayType))); 726public void InitializeCompositeCache(RuntimeType.CompositeCacheEntry compositeEntry) => compositeEntry._arrayInitializeCache = this; 727public static ref ArrayInitializeCache? GetStorageRef(RuntimeType.CompositeCacheEntry compositeEntry) => ref compositeEntry._arrayInitializeCache;
src\System\Collections\Generic\ArraySortHelper.CoreCLR.cs (5)
28defaultArraySortHelper = (IArraySortHelper<T>)RuntimeTypeHandle.CreateInstanceForAnotherGenericParameter((RuntimeType)typeof(GenericArraySortHelper<string>), (RuntimeType)typeof(T)); 61defaultArraySortHelper = (IArraySortHelper<TKey, TValue>)RuntimeTypeHandle.CreateInstanceForAnotherGenericParameter((RuntimeType)typeof(GenericArraySortHelper<string, string>), (RuntimeType)typeof(TKey), (RuntimeType)typeof(TValue));
src\System\Collections\Generic\ComparerHelpers.cs (18)
30Debug.Assert(type != null && type is RuntimeType); 33var runtimeType = (RuntimeType)type; 38result = CreateInstanceForAnotherGenericParameter((RuntimeType)typeof(GenericComparer<int>), runtimeType); 43var embeddedType = (RuntimeType)type.GetGenericArguments()[0]; 44result = CreateInstanceForAnotherGenericParameter((RuntimeType)typeof(NullableComparer<int>), embeddedType); 49result = CreateInstanceForAnotherGenericParameter((RuntimeType)typeof(EnumComparer<>), runtimeType); 52return result ?? CreateInstanceForAnotherGenericParameter((RuntimeType)typeof(ObjectComparer<object>), runtimeType); 64Debug.Assert(type != null && type is RuntimeType); 67var runtimeType = (RuntimeType)type; 76result = CreateInstanceForAnotherGenericParameter((RuntimeType)typeof(GenericEqualityComparer<string>), runtimeType); 81var embeddedType = (RuntimeType)type.GetGenericArguments()[0]; 82result = CreateInstanceForAnotherGenericParameter((RuntimeType)typeof(NullableEqualityComparer<int>), embeddedType); 87result = CreateInstanceForAnotherGenericParameter((RuntimeType)typeof(EnumEqualityComparer<>), runtimeType); 90return result ?? CreateInstanceForAnotherGenericParameter((RuntimeType)typeof(ObjectEqualityComparer<object>), runtimeType);
src\System\Delegate.CoreCLR.cs (19)
48if (!BindToMethodName(target, (RuntimeType)target.GetType(), method, 64if (target is not RuntimeType rtTarget) 83RuntimeMethodInfo invoke = (RuntimeMethodInfo)RuntimeType.GetMethodBase((RuntimeType)this.GetType(), method)!; 167RuntimeType? declaringType = RuntimeMethodHandle.GetDeclaringType(method); 194declaringType = currentType as RuntimeType; 212declaringType = (RuntimeType)invoke.GetParametersAsSpan()[0].ParameterType; 217_methodBase = (MethodInfo)RuntimeType.GetMethodBase(declaringType, method)!; 231if (type is not RuntimeType rtType) 244if (!d.BindToMethodName(target, (RuntimeType)target.GetType(), method, 268if (type is not RuntimeType rtType) 270if (target is not RuntimeType rtTarget) 301if (type is not RuntimeType rtType) 336if (type is not RuntimeType rtType) 374if (type is not RuntimeType rtType) 395internal static Delegate? CreateDelegateInternal(RuntimeType rtType, RuntimeMethodInfo rtMethod, object? firstArgument, DelegateBindingFlags flags) 411private bool BindToMethodName(object? target, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.AllMethods)] RuntimeType methodType, string method, DelegateBindingFlags flags) 422private bool BindToMethodInfo(object? target, IRuntimeMethodInfo method, RuntimeType methodType, DelegateBindingFlags flags) 435private static MulticastDelegate InternalAlloc(RuntimeType type)
src\System\Diagnostics\StackFrame.CoreCLR.cs (1)
76return RuntimeType.GetMethodBase(null, method);
src\System\Diagnostics\StackFrameHelper.cs (1)
169return RuntimeType.GetMethodBase(mhReal);
src\System\Enum.CoreCLR.cs (27)
18private static unsafe CorElementType InternalGetCorElementType(RuntimeType rt) 35private static readonly RuntimeType?[] s_underlyingTypes = 39(RuntimeType)typeof(bool), 40(RuntimeType)typeof(char), 41(RuntimeType)typeof(sbyte), 42(RuntimeType)typeof(byte), 43(RuntimeType)typeof(short), 44(RuntimeType)typeof(ushort), 45(RuntimeType)typeof(int), 46(RuntimeType)typeof(uint), 47(RuntimeType)typeof(long), 48(RuntimeType)typeof(ulong), 49(RuntimeType)typeof(float), 50(RuntimeType)typeof(double), 61(RuntimeType)typeof(nint), 62(RuntimeType)typeof(nuint) 66internal static unsafe RuntimeType InternalGetUnderlyingType(RuntimeType enumType) 71RuntimeType? underlyingType = s_underlyingTypes[(int)enumType.GetNativeTypeHandle().AsMethodTable()->GetPrimitiveCorElementType()]; 79private static EnumInfo<TStorage> GetEnumInfo<TStorage>(RuntimeType enumType, bool getNames = true) 92static EnumInfo<TStorage> InitializeEnumInfo(RuntimeType enumType, bool getNames) 103internal sealed partial class EnumInfo<TStorage> : RuntimeType.IGenericCacheEntry<EnumInfo<TStorage>> 105public static EnumInfo<TStorage> Create(RuntimeType type, bool getNames) 123public static EnumInfo<TStorage> Create(RuntimeType type) => Create(type, getNames: false); 125public void InitializeCompositeCache(RuntimeType.CompositeCacheEntry compositeEntry) => compositeEntry._enumInfo = this; 128public static ref EnumInfo<TStorage>? GetStorageRef(RuntimeType.CompositeCacheEntry compositeEntry) 129=> ref Unsafe.As<RuntimeType.IGenericCacheEntry?, EnumInfo<TStorage>?>(ref compositeEntry._enumInfo);
src\System\Exception.CoreCLR.cs (1)
73return RuntimeType.GetMethodBase(methodInfo);
src\System\MulticastDelegate.CoreCLR.cs (5)
170MulticastDelegate result = Unsafe.As<MulticastDelegate>(RuntimeTypeHandle.InternalAllocNoChecks((RuntimeType)GetType())); 524RuntimeType declaringType = RuntimeMethodHandle.GetDeclaringType(method); 530RuntimeType reflectedType = (RuntimeType)GetType(); 534_methodBase = (MethodInfo)RuntimeType.GetMethodBase(declaringType, method)!;
src\System\Object.CoreCLR.cs (1)
17RuntimeType type = RuntimeTypeHandle.GetRuntimeType(pMT);
src\System\Reflection\Associates.cs (8)
42RuntimeType declaredType, 43RuntimeType reflectedType) 54RuntimeType[] genericArguments = declaredType.TypeHandle.GetInstantiationInternal(); 104RuntimeType.GetMethodBase(reflectedType, associateMethodHandle) as RuntimeMethodInfo; 113RuntimeType declaringType, 114RuntimeType reflectedType, 133reflectedType = (RuntimeType)reflectedType.BaseType!; 199bindingFlags = RuntimeType.FilterPreCalculate(isPseudoPublic, isInherited, isPseudoStatic);
src\System\Reflection\Emit\DynamicILGenerator.cs (15)
38if (localType is not RuntimeType) 67RuntimeType declaringType = rtMeth.GetRuntimeType(); 116RuntimeType declaringType = rtConstructor.GetRuntimeType(); 133RuntimeType rtType = type as RuntimeType ?? throw new ArgumentException(SR.Argument_MustBeRuntimeType); 335RuntimeType? rtType = exceptionType as RuntimeType; 490private int GetTokenFor(RuntimeType rtType) 500private int GetTokenFor(RuntimeFieldInfo runtimeField, RuntimeType rtType) 510private int GetTokenFor(RuntimeConstructorInfo rtMeth, RuntimeType rtType) 520private int GetTokenFor(RuntimeMethodInfo rtMeth, RuntimeType rtType) 668internal override RuntimeType? GetJitContext(out int securityControlFlags) 670RuntimeType? typeOwner; 1011RuntimeType type = RuntimeMethodHandle.GetDeclaringType(rmhi); 1015MethodBase m = RuntimeType.GetMethodBase(methodReal)!;
src\System\Reflection\Emit\DynamicMethod.CoreCLR.cs (3)
18private RuntimeType[] _parameterTypes; 20private RuntimeType _returnType; 26internal RuntimeType? _typeOwner;
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (9)
234Debug.Assert(destType is RuntimeType, "destType is not a runtime type, an EnumBuilder, or a TypeBuilder."); 252CorElementType corType = ((RuntimeType)type).GetCorElementType(); 330private RuntimeType m_bakedRuntimeType = null!; 568internal RuntimeType BakedRuntimeType => m_bakedRuntimeType; 853if (fromRuntimeType != null && fromRuntimeType is RuntimeType) 986return CustomAttribute.GetCustomAttributes(m_bakedRuntimeType, (typeof(object) as RuntimeType)!, inherit); 996if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 1009if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 1657RuntimeType? cls = null;
src\System\Reflection\Emit\SignatureHelper.cs (4)
429if (clsArgument is RuntimeType) 431type = ((RuntimeType)clsArgument).GetCorElementType(); 742if (t is not RuntimeType rtType) 765if (t is not RuntimeType rtType)
src\System\Reflection\FieldInfo.CoreCLR.cs (2)
13FieldInfo f = RuntimeType.GetFieldInfo(handle.GetRuntimeFieldInfo()); 29return RuntimeType.GetFieldInfo(declaringType.GetRuntimeType(), handle.GetRuntimeFieldInfo());
src\System\Reflection\MdConstant.cs (1)
12RuntimeType fieldType = fieldTypeHandle.GetRuntimeType();
src\System\Reflection\MdFieldInfo.cs (2)
7using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache; 16private RuntimeType? m_fieldType;
src\System\Reflection\MdImport.cs (2)
272RuntimeType? safeArrayUserDefinedType = string.IsNullOrEmpty(safeArrayUserDefinedTypeName) ? null : 274RuntimeType? marshalTypeRef = null;
src\System\Reflection\Metadata\RuntimeTypeMetadataUpdateHandler.cs (1)
59private static void ClearCache(Type type) => (type as RuntimeType)?.ClearCache();
src\System\Reflection\MethodBase.CoreCLR.cs (3)
20MethodBase? m = RuntimeType.GetMethodBase(handle.GetMethodInfo()); 36return RuntimeType.GetMethodBase(declaringType.GetRuntimeType(), handle.GetMethodInfo()); 48return methodHandle.IsNullHandle() ? null : RuntimeType.GetMethodBase(null, methodHandle);
src\System\Reflection\RtFieldInfo.cs (8)
8using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache; 20private RuntimeType? m_fieldType; 37RuntimeFieldHandleInternal handle, RuntimeType declaringType, RuntimeTypeCache reflectedTypeCache, BindingFlags bindingFlags) 96return RuntimeFieldHandle.GetValueDirect(this, (RuntimeType)FieldType, obj, (RuntimeType?)DeclaringType); 112RuntimeFieldHandle.SetValueDirect(this, (RuntimeType)FieldType, obj, value, (RuntimeType?)DeclaringType); 131private RuntimeType InitializeFieldType()
src\System\Reflection\RuntimeAssembly.cs (4)
184return (MethodInfo?)RuntimeType.GetMethodBase(methodHandle); 326return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!); 333if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 343if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
src\System\Reflection\RuntimeConstructorInfo.CoreCLR.cs (9)
11using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache; 18private readonly RuntimeType m_declaringType; 57RuntimeMethodHandleInternal handle, RuntimeType declaringType, RuntimeTypeCache reflectedTypeCache, 92private RuntimeType ReflectedTypeInternal => m_reflectedTypeCache.GetRuntimeType(); 131return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!); 138if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 148if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 173internal RuntimeType GetRuntimeType() { return m_declaringType; } 200internal RuntimeType[] ArgumentTypes => Signature.Arguments;
src\System\Reflection\RuntimeCustomAttributeData.cs (18)
18internal static IList<CustomAttributeData> GetCustomAttributesInternal(RuntimeType target) 23RuntimeType.ListBuilder<Attribute> pcas = default; 24PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas); 33RuntimeType.ListBuilder<Attribute> pcas = default; 34PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas); 43RuntimeType.ListBuilder<Attribute> pcas = default; 44PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas); 92RuntimeType.ListBuilder<Attribute> pcas = default; 94PseudoCustomAttribute.GetCustomAttributes(target, (RuntimeType)typeof(object), ref pcas); 98private static ReadOnlyCollection<CustomAttributeData> GetCombinedList(IList<CustomAttributeData> customAttributes, ref RuntimeType.ListBuilder<Attribute> pseudoAttributes) 113internal static CustomAttributeEncoding TypeToCustomAttributeEncoding(RuntimeType type) 254m_ctor = (RuntimeConstructorInfo)RuntimeType.GetMethodBase(m_scope, caCtorToken)!; 268m_ctorParams[i] = new CustomAttributeCtorParameter(new CustomAttributeType((RuntimeType)parameters[i].ParameterType)); 287new CustomAttributeType((RuntimeType)fi.FieldType)); 295new CustomAttributeType((RuntimeType)pi.PropertyType)); 543private static RuntimeType ResolveType(RuntimeModule scope, string typeName) 545RuntimeType type = TypeNameResolver.GetTypeReferencedByCustomAttribute(typeName, scope); 902enumTag = RuntimeCustomAttributeData.TypeToCustomAttributeEncoding((RuntimeType)enumType.GetEnumUnderlyingType());
src\System\Reflection\RuntimeEventInfo.cs (8)
7using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache; 23private readonly RuntimeType m_declaringType; 28internal RuntimeEventInfo(int tkEvent, RuntimeType declaredType, RuntimeTypeCache reflectedTypeCache, out bool isPrivate) 41RuntimeType reflectedType = reflectedTypeCache.GetRuntimeType(); 91return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!); 98if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 108if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 127private RuntimeType ReflectedTypeInternal => m_reflectedTypeCache.GetRuntimeType();
src\System\Reflection\RuntimeFieldInfo.cs (9)
5using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache; 14protected internal readonly RuntimeType m_declaringType; 18protected RuntimeFieldInfo(RuntimeTypeCache reflectedTypeCache, RuntimeType declaringType, BindingFlags bindingFlags) 28private RuntimeType ReflectedTypeInternal => m_reflectedTypeCache.GetRuntimeType(); 30internal RuntimeType GetDeclaringTypeInternal() 35internal RuntimeType GetRuntimeType() { return m_declaringType; } 62return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!); 69if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 79if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
src\System\Reflection\RuntimeLocalVariableInfo.cs (1)
10private RuntimeType? _type;
src\System\Reflection\RuntimeMethodInfo.CoreCLR.cs (30)
12using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache; 28private readonly RuntimeType m_declaringType; 56RuntimeMethodHandleInternal handle, RuntimeType declaringType, 74private RuntimeType ReflectedTypeInternal => m_reflectedTypeCache.GetRuntimeType(); 111RuntimeType? parent = (RuntimeType?)m_declaringType.BaseType; 121return (RuntimeMethodInfo?)RuntimeType.GetMethodBase(parent, RuntimeTypeHandle.GetMethodAt(parent, slot)); 125internal RuntimeType GetDeclaringTypeInternal() 174return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!, inherit); 181if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 191if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 233internal RuntimeType GetRuntimeType() { return m_declaringType; } 271internal RuntimeType[] ArgumentTypes => Signature.Arguments; 330RuntimeType declaringType = (RuntimeType)DeclaringType!; 331RuntimeType? baseDeclaringType = declaringType; 344declaringType = (RuntimeType)declaringType.BaseType!; 347return (MethodInfo)RuntimeType.GetMethodBase(baseDeclaringType, baseMethodHandle)!; 383RuntimeType rtType = delegateType as RuntimeType ?? 401RuntimeType[] methodInstantionRuntimeType = new RuntimeType[methodInstantiation.Length]; 412RuntimeType? rtMethodInstantiationElem = methodInstantiationElem as RuntimeType; 426RuntimeType[] genericParameters = GetGenericArgumentsInternal(); 428RuntimeType.SanityCheckGenericArguments(methodInstantionRuntimeType, genericParameters); 434ret = RuntimeType.GetMethodBase(ReflectedTypeInternal, 439RuntimeType.ValidateGenericArguments(this, methodInstantionRuntimeType, e); 446internal RuntimeType[] GetGenericArgumentsInternal() => 457return (RuntimeType.GetMethodBase(m_declaringType, RuntimeMethodHandle.StripMethodInstantiation(this)) as MethodInfo)!;
src\System\Reflection\RuntimeModule.cs (13)
18private RuntimeType m_runtimeType; 38if (typeArg is not System.RuntimeType) 121return RuntimeType.GetMethodBase(declaringType as RuntimeType, methodHandle); 198RuntimeType declaringType = RuntimeFieldHandle.GetApproxDeclaringType(fieldHandle.Value); 203declaringType = (RuntimeType)ResolveType(tkDeclaringType, genericTypeArguments, genericMethodArguments); 206return RuntimeType.GetFieldInfo(declaringType, fieldHandle); 347internal RuntimeType RuntimeType => m_runtimeType ??= ModuleHandle.GetModuleType(this); 355return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!); 362if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 372if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 421internal RuntimeType[] GetDefinedTypes() 423RuntimeType[]? types = null;
src\System\Reflection\RuntimeParameterInfo.cs (4)
223RuntimeType parameterType; 460return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!); 467if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 483if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
src\System\Reflection\RuntimePropertyInfo.cs (8)
9using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache; 24private readonly RuntimeType m_declaringType; 32int tkProperty, RuntimeType declaredType, RuntimeTypeCache reflectedTypeCache, out bool isPrivate) 124RuntimeType[] arguments = Signature.Arguments; 139return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!); 146if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 156if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 177private RuntimeType ReflectedTypeInternal => m_reflectedTypeCache.GetRuntimeType();
src\System\Reflection\TypeNameResolver.CoreCLR.cs (6)
108internal static RuntimeType GetTypeReferencedByCustomAttribute(string typeName, RuntimeModule scope) 115RuntimeType? type = (RuntimeType?)new TypeNameResolver() 130internal static unsafe RuntimeType? GetTypeHelper(char* pTypeName, RuntimeAssembly? requestingAssembly, 150RuntimeType? type = (RuntimeType?)new TypeNameResolver()
src\System\Runtime\CompilerServices\RuntimeHelpers.CoreCLR.cs (7)
171RuntimeType rt = type.GetRuntimeType() ?? 339if (type is not RuntimeType rt) 478if (type is not RuntimeType rt) 942public RuntimeType? ExposedClassObject 946return *(RuntimeType*)Unsafe.AsPointer(ref _exposedClassObject); 1039public RuntimeType? ExposedClassObject 1043return *(RuntimeType*)Unsafe.AsPointer(ref ExposedClassObjectRaw);
src\System\Runtime\InteropServices\DynamicInterfaceCastableHelpers.cs (4)
16internal static bool IsInterfaceImplemented(IDynamicInterfaceCastable castable, RuntimeType interfaceType, bool throwIfNotImplemented) 26internal static RuntimeType? GetInterfaceImplementation(IDynamicInterfaceCastable castable, RuntimeType interfaceType) 32RuntimeType implType = handle.GetRuntimeType();
src\System\Runtime\InteropServices\Marshal.CoreCLR.cs (3)
32internal static int SizeOfHelper(RuntimeType t, [MarshalAs(UnmanagedType.Bool)] bool throwIfNotMarshalable) 310if (structuretype is not RuntimeType rt) 975internal static Delegate GetDelegateForFunctionPointerInternal(IntPtr ptr, RuntimeType t)
src\System\RuntimeHandles.cs (123)
25internal RuntimeType GetRuntimeTypeChecked() => 42private static RuntimeType GetRuntimeTypeFromHandleSlow(IntPtr handle) 44RuntimeType? typeObject = null; 50internal static unsafe RuntimeType GetRuntimeTypeFromHandle(IntPtr handle) 59internal static RuntimeType? GetRuntimeTypeFromHandleMaybeNull(IntPtr handle) 70internal static unsafe RuntimeType GetRuntimeType(MethodTable* pMT) 92internal RuntimeType? m_type; 105internal RuntimeTypeHandle(RuntimeType? type) 115internal static bool IsTypeDefinition(RuntimeType type) 133internal static bool IsPrimitive(RuntimeType type) 138internal static bool IsByRef(RuntimeType type) 144internal static bool IsPointer(RuntimeType type) 150internal static bool IsArray(RuntimeType type) 156internal static bool IsSZArray(RuntimeType type) 162internal static bool IsFunctionPointer(RuntimeType type) 168internal static bool HasElementType(RuntimeType type) 227[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] RuntimeType type, 228RuntimeType genericParameter) 250[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] RuntimeType type, 251RuntimeType genericParameter1, 252RuntimeType genericParameter2) 291internal static object InternalAlloc(RuntimeType type) 302internal static object InternalAllocNoChecks(RuntimeType type) 320RuntimeType rt, 370internal RuntimeType GetRuntimeType() 375internal static RuntimeAssembly GetAssembly(RuntimeType type) 380static RuntimeAssembly GetAssemblyWorker(RuntimeType type) 389private static extern RuntimeAssembly? GetAssemblyIfExists(RuntimeType type); 394internal static RuntimeModule GetModule(RuntimeType type) 399static RuntimeModule GetModuleWorker(RuntimeType type) 408private static extern RuntimeModule? GetModuleIfExists(RuntimeType type); 424internal static extern TypeAttributes GetAttributes(RuntimeType type); 429internal static RuntimeType? GetElementType(RuntimeType type) 437RuntimeType result = GetRuntimeTypeFromHandle(handle); 443internal static extern bool CompareCanonicalHandles(RuntimeType left, RuntimeType right); 446internal static extern int GetArrayRank(RuntimeType type); 449internal static extern int GetToken(RuntimeType type); 454internal static RuntimeMethodHandleInternal GetMethodAt(RuntimeType type, int slot) 470internal static Type[] GetArgumentTypesFromFunctionPointer(RuntimeType type) 482internal static extern bool IsUnmanagedFunctionPointer(RuntimeType type); 490internal IntroducedMethodEnumerator(RuntimeType type) 518internal static IntroducedMethodEnumerator GetIntroducedMethods(RuntimeType type) 524private static extern RuntimeMethodHandleInternal GetFirstIntroducedMethod(RuntimeType type); 532internal static bool GetFields(RuntimeType type, Span<IntPtr> buffer, out int count) 553internal static Type[] GetInterfaces(RuntimeType type) 601internal static extern int GetNumVirtuals(RuntimeType type); 606internal static int GetNumVirtualsAndStaticVirtuals(RuntimeType type) 636internal static bool IsVisible(RuntimeType type) 658internal static MdUtf8String GetUtf8Name(RuntimeType type) 674internal static bool CanCastTo(RuntimeType type, RuntimeType target) 688internal static RuntimeType? GetDeclaringType(RuntimeType type) 710RuntimeType result = GetRuntimeTypeFromHandle(retTypeHandle); 718internal static IRuntimeMethodInfo? GetDeclaringMethodForGenericParameter(RuntimeType type) 730internal RuntimeType[] GetInstantiationInternal() 732RuntimeType[]? types = null; 749internal RuntimeType Instantiate(RuntimeType inst) 753RuntimeType? type = null; 760internal RuntimeType Instantiate(Type[]? inst) 766RuntimeType? type = null; 777internal RuntimeType MakeArray(int rank) 779RuntimeType? type = null; 788internal RuntimeType MakeSZArray() 790RuntimeType? type = null; 799internal RuntimeType MakeByRef() 801RuntimeType? type = null; 810internal RuntimeType MakePointer() 812RuntimeType? type = null; 825internal static extern bool IsGenericVariable(RuntimeType type); 828private static extern int GetGenericVariableIndex(RuntimeType type); 832RuntimeType type = GetRuntimeTypeChecked(); 841internal static extern bool ContainsGenericVariables(RuntimeType handle); 851internal static bool SatisfiesConstraints(RuntimeType paramType, RuntimeType? typeContext, RuntimeMethodInfo? methodContext, RuntimeType toType) 862internal static void RegisterCollectibleTypeDependency(RuntimeType type, RuntimeAssembly? assembly) 1085internal static unsafe RuntimeType GetDeclaringType(RuntimeMethodHandleInternal method) 1092internal static RuntimeType GetDeclaringType(IRuntimeMethodInfo method) 1094RuntimeType type = GetDeclaringType(method.Value); 1191internal static object ReboxToNullable(object? src, RuntimeType destNullableType) 1208internal static RuntimeType[] GetMethodInstantiationInternal(IRuntimeMethodInfo method) 1210RuntimeType[]? types = null; 1216internal static RuntimeType[] GetMethodInstantiationInternal(RuntimeMethodHandleInternal method) 1218RuntimeType[]? types = null; 1225RuntimeType[]? types = null; 1242private static extern RuntimeMethodHandleInternal GetStubIfNeededInternal(RuntimeMethodHandleInternal method, RuntimeType declaringType); 1247internal static RuntimeMethodHandleInternal GetStubIfNeeded(RuntimeMethodHandleInternal method, RuntimeType declaringType, RuntimeType[]? methodInstantiation) 1259static RuntimeMethodHandleInternal GetStubIfNeededWorker(RuntimeMethodHandleInternal method, RuntimeType declaringType, RuntimeType[]? methodInstantiation) 1264internal static extern RuntimeMethodHandleInternal GetMethodFromCanonical(RuntimeMethodHandleInternal method, RuntimeType declaringType); 1323internal static RuntimeMethodBody? GetMethodBody(IRuntimeMethodInfo method, RuntimeType declaringType) 1514internal static RuntimeType GetApproxDeclaringType(RuntimeFieldHandleInternal field) 1523internal static RuntimeType GetApproxDeclaringType(IRuntimeFieldInfo field) 1525RuntimeType type = GetApproxDeclaringType(field.Value); 1581internal static object? GetValue(RtFieldInfo field, object? instance, RuntimeType fieldType, RuntimeType? declaringType, ref bool isClassInitialized) 1602internal static object? GetValueDirect(RtFieldInfo field, RuntimeType fieldType, TypedReference typedRef, RuntimeType? contextType) 1624internal static void SetValue(RtFieldInfo field, object? obj, object? value, RuntimeType fieldType, RuntimeType? declaringType, ref bool isClassInitialized) 1643internal static void SetValueDirect(RtFieldInfo field, RuntimeType fieldType, TypedReference typedRef, object? value, RuntimeType? contextType) 1657internal static RuntimeFieldHandleInternal GetStaticFieldForGenericType(RuntimeFieldHandleInternal field, RuntimeType declaringType) 1836RuntimeType? type = null; 1970internal static RuntimeType GetModuleType(RuntimeModule module) 1972RuntimeType? type = null; 2005private RuntimeType[]? _arguments; 2006private RuntimeType _declaringType; 2007private RuntimeType _returnTypeORfieldType; 2044RuntimeType[] arguments, 2045RuntimeType returnType, 2059public Signature(IRuntimeMethodInfo methodHandle, RuntimeType declaringType) 2066public Signature(IRuntimeFieldInfo fieldHandle, RuntimeType declaringType) 2073public Signature(void* pCorSig, int cCorSig, RuntimeType declaringType) 2082internal RuntimeType[] Arguments 2090internal RuntimeType ReturnType => _returnTypeORfieldType; 2091internal RuntimeType FieldType => _returnTypeORfieldType; 2190internal abstract RuntimeType? GetJitContext(out int securityControlFlags);
src\System\RuntimeType.ActivatorCache.cs (7)
29private readonly RuntimeType _originalRuntimeType; 32public static ActivatorCache Create(RuntimeType type) => new(type); 33public void InitializeCompositeCache(RuntimeType.CompositeCacheEntry compositeEntry) => compositeEntry._activatorCache = this; 34public static ref ActivatorCache? GetStorageRef(RuntimeType.CompositeCacheEntry compositeEntry) => ref compositeEntry._activatorCache; 36private ActivatorCache(RuntimeType rt) 125internal object? CreateUninitializedObject(RuntimeType rt) 153private void CheckOriginalRuntimeType(RuntimeType rt)
src\System\RuntimeType.BoxCache.cs (5)
17public static BoxCache Create(RuntimeType type) => new(type); 29private readonly RuntimeType _originalRuntimeType; 32private BoxCache(RuntimeType rt) 58internal object? Box(RuntimeType rt, ref byte data) 108RuntimeType rt,
src\System\RuntimeType.CoreCLR.cs (130)
214internal MethodBase AddMethod(RuntimeType declaringType, RuntimeMethodHandleInternal method, CacheType cacheType) 315RuntimeType approxDeclaringType = RuntimeFieldHandle.GetApproxDeclaringType(field); 586RuntimeType declaringType = ReflectedType; 752RuntimeType declaringType = ReflectedType; 800RuntimeType declaringType = ReflectedType; 806RuntimeType? populatingType = declaringType; 831PopulateLiteralFields(filter, (RuntimeType)iface, ref list); 832PopulateRtFields(filter, (RuntimeType)iface, ref list); 839private unsafe void PopulateRtFields(Filter filter, RuntimeType declaringType, ref ListBuilder<RuntimeFieldInfo> list) 856ReadOnlySpan<IntPtr> fieldHandles, RuntimeType declaringType, ref ListBuilder<RuntimeFieldInfo> list) 902private void PopulateLiteralFields(Filter filter, RuntimeType declaringType, ref ListBuilder<RuntimeFieldInfo> list) 962ref ListBuilder<RuntimeType> list, 964[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] RuntimeType iList, 977RuntimeType iFace = (RuntimeType)iFaces[j]; 989private RuntimeType[] PopulateInterfaces(Filter filter) 991ListBuilder<RuntimeType> list = default; 993RuntimeType declaringType = ReflectedType; 1000RuntimeType interfaceType = (RuntimeType)iface; 1014RuntimeType arrayType = (RuntimeType)ReflectedType.GetElementType()!; 1018AddSpecialInterface(ref list, filter, (RuntimeType)typeof(IList<>).MakeGenericType(arrayType), true); 1022AddSpecialInterface(ref list, filter, (RuntimeType)typeof(IReadOnlyList<>).MakeGenericType(arrayType), false); 1023AddSpecialInterface(ref list, filter, (RuntimeType)typeof(IReadOnlyCollection<>).MakeGenericType(arrayType), false); 1029var al = new HashSet<RuntimeType>(); 1037RuntimeType constraint = (RuntimeType)constraints[i]; 1043al.Add((RuntimeType)temp[j]); 1047foreach (RuntimeType rt in al) 1063private RuntimeType[] PopulateNestedClasses(Filter filter) 1065RuntimeType declaringType = ReflectedType; 1076return Array.Empty<RuntimeType>(); 1078ListBuilder<RuntimeType> list = default; 1087RuntimeType nestedType; 1120RuntimeType declaringType = ReflectedType; 1129RuntimeType? populatingType = declaringType; 1146Filter filter, RuntimeType declaringType, Dictionary<string, RuntimeEventInfo>? csEventInfos, ref ListBuilder<RuntimeEventInfo> list) 1211RuntimeType declaringType = ReflectedType; 1231RuntimeType? populatingType = declaringType; 1249RuntimeType declaringType, 1400internal RuntimeType ReflectedType => m_runtimeTypeCache.GetRuntimeType(); 1407private readonly RuntimeType m_runtimeType; 1408private RuntimeType? m_enclosingType; 1418private MemberInfoCache<RuntimeType>? m_interfaceCache; 1419private MemberInfoCache<RuntimeType>? m_nestedClassesCache; 1428private RuntimeType? _genericTypeDefinition; 1432internal RuntimeTypeCache(RuntimeType runtimeType) 1480public static FunctionPointerCache Create(RuntimeType type) 1485public void InitializeCompositeCache(RuntimeType.CompositeCacheEntry compositeEntry) => compositeEntry._functionPointerCache = this; 1486public static ref FunctionPointerCache? GetStorageRef(RuntimeType.CompositeCacheEntry compositeEntry) => ref compositeEntry._functionPointerCache; 1546RuntimeModule module = ((RuntimeType)type).GetRuntimeModule(); 1560internal RuntimeType? GetEnclosingType() 1565RuntimeType? enclosingType = RuntimeTypeHandle.GetDeclaringType(GetRuntimeType()); 1567m_enclosingType = enclosingType ?? (RuntimeType)typeof(void); 1573internal RuntimeType GetRuntimeType() => m_runtimeType; 1585for (RuntimeType? t = m_runtimeType; t != null; t = t.GetBaseType()) 1610internal RuntimeType GetGenericTypeDefinition() 1617RuntimeType CacheGenericDefinition() 1619RuntimeType genericDefinition = null!; 1626RuntimeType type = m_runtimeType; 1714internal RuntimeType[] GetInterfaceList(MemberListType listType, string? name) 1719internal RuntimeType[] GetNestedTypeList(MemberListType listType, string? name) 1724internal MethodBase GetMethod(RuntimeType declaringType, RuntimeMethodHandleInternal method) 1730internal MethodBase GetConstructor(RuntimeType declaringType, RuntimeMethodHandleInternal constructor) 1752internal unsafe RuntimeType? GetParentType() 1766RuntimeType result = RuntimeTypeHandle.GetRuntimeType(pParentMT); 1782internal static MethodBase? GetMethodBase(RuntimeType? reflectedType, IRuntimeMethodInfo methodHandle) 1792internal static MethodBase? GetMethodBase(RuntimeType? reflectedType, RuntimeMethodHandleInternal methodHandle) 1807RuntimeType declaredType = RuntimeMethodHandle.GetDeclaringType(methodHandle); 1809RuntimeType[]? methodInstantiation = null; 1845RuntimeType declaringDefinition = (RuntimeType)declaredType.GetGenericTypeDefinition(); 1847RuntimeType? baseType = reflectedType; 1851RuntimeType baseDefinition = baseType; 1854baseDefinition = (RuntimeType)baseDefinition.GetGenericTypeDefinition(); 1945internal static FieldInfo GetFieldInfo(RuntimeType? reflectedType, IRuntimeFieldInfo field) 1956RuntimeType declaredType = RuntimeFieldHandle.GetApproxDeclaringType(fieldHandle); 1976private static RuntimePropertyInfo GetPropertyInfo(RuntimeType reflectedType, int tkProperty) 1993internal static void ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception? e) 1995RuntimeType? typeContext; 1997RuntimeType[] genericParameters; 2001typeContext = (RuntimeType)definition; 2007typeContext = (RuntimeType?)methodContext.DeclaringType; 2224Debug.Assert(type is RuntimeType); 2386internal static readonly RuntimeType ValueType = (RuntimeType)typeof(ValueType); 2388private static readonly RuntimeType ObjectType = (RuntimeType)typeof(object); 2389private static readonly RuntimeType StringType = (RuntimeType)typeof(string); 2412return (o is RuntimeType t) && (t.m_handle == m_handle); 2619RuntimeType[] cache = Cache.GetNestedTypeList(listType, name); 2624RuntimeType nestedClass = cache[i]; 2669RuntimeType[] candidates = Cache.GetInterfaceList(MemberListType.All, null); 2717RuntimeType ifaceRtType = interfaceType as RuntimeType ?? 2755RuntimeType reflectedType = RuntimeMethodHandle.GetDeclaringType(classRtMethodHandle); 2979RuntimeType[] cache = Cache.GetInterfaceList(listType, name); 2981RuntimeType? match = null; 2985RuntimeType iface = cache[i]; 3008RuntimeType[] cache = Cache.GetNestedTypeList(listType, name); 3010RuntimeType? match = null; 3014RuntimeType nestedType = cache[i]; 3114RuntimeType? runtimeType = this; 3139private static RuntimeMethodInfo? GetMethodWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo method) 3155private static RuntimeConstructorInfo? GetConstructorWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo constructor) 3171private static RuntimePropertyInfo? GetPropertyWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo property) 3187private static RuntimeFieldInfo? GetFieldWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo field) 3203private static RuntimeEventInfo? GetEventWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo eventInfo) 3219private static RuntimeType? GetNestedTypeWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo nestedType) 3221RuntimeType[] cache = runtimeType.Cache.GetNestedTypeList(MemberListType.CaseSensitive, nestedType.Name); 3225RuntimeType candidate = cache[i]; 3242RuntimeType thisType = this; 3269RuntimeType? rtType = type as RuntimeType; 3273RuntimeType? baseType = GetBaseType(); 3559internal RuntimeType[] GetGenericArgumentsInternal() 3578RuntimeType[] genericParameters = GetGenericArgumentsInternal(); 3582if (instantiation.Length == 1 && instantiation[0] is RuntimeType rt) 3596RuntimeType[] instantiationRuntimeType = new RuntimeType[instantiation.Length]; 3603RuntimeType? rtInstantiationElem = instantiationElem as RuntimeType; 3685public sealed override bool HasSameMetadataDefinitionAs(MemberInfo other) => HasSameMetadataDefinitionAsCore<RuntimeType>(other); 3707private static bool CanValueSpecialCast(RuntimeType valueType, RuntimeType targetType) 3743RuntimeType srcType = pointer != null ? pointer.GetPointerType() : (RuntimeType)value.GetType();
src\System\RuntimeType.CreateUninitializedCache.CoreCLR.cs (7)
17public static CreateUninitializedCache Create(RuntimeType type) => new(type); 18public void InitializeCompositeCache(RuntimeType.CompositeCacheEntry compositeEntry) => compositeEntry._createUninitializedCache = this; 19public static ref CreateUninitializedCache? GetStorageRef(RuntimeType.CompositeCacheEntry compositeEntry) => ref compositeEntry._createUninitializedCache; 26private readonly RuntimeType _originalRuntimeType; 29private CreateUninitializedCache(RuntimeType rt) 40internal object CreateUninitializedObject(RuntimeType rt) 60RuntimeType rt,
src\System\RuntimeType.GenericCache.cs (7)
9using static System.RuntimeType; 40/// the <see cref="RuntimeTypeCache.GenericCache"/> in a <see cref="RuntimeType"/> . 46public static abstract TCache Create(RuntimeType type); 51public static TCache GetOrCreate(RuntimeType type) 74public static TCache? Find(RuntimeType type) 94public static TCache Replace(RuntimeType type, TCache newEntry) 131private static TCache CreateAndCache(RuntimeType type)
src\System\StubHelpers.cs (1)
1100int allocSize = Marshal.SizeOfHelper((RuntimeType)pManagedHome.GetType(), false);
src\System\TypedReference.CoreCLR.cs (1)
36private TypedReference(ref byte target, RuntimeType type)