832 references to RuntimeType
System.Private.CoreLib (832)
src\Internal\VersionResilientHashCode.CoreCLR.cs (1)
19public static int TypeHashCode(RuntimeType type)
src\libraries\System.Private.CoreLib\src\System\Activator.RuntimeType.cs (4)
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)
79RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 94RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 111RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 128RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 156RuntimeType? t = elementType.UnderlyingSystemType as RuntimeType; 211RuntimeType? t = arrayType as RuntimeType; 248RuntimeType? t = arrayType as RuntimeType; 304RuntimeType? t = arrayType as RuntimeType;
src\libraries\System.Private.CoreLib\src\System\DefaultBinder.cs (4)
551if (!(realTypes[i] is RuntimeType || realTypes[i] is SignatureType)) 590if (type.UnderlyingSystemType is not RuntimeType rtType || 677if (indexes[j].UnderlyingSystemType is not RuntimeType rtType || 695if (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) 1357RuntimeType enumType = (RuntimeType)GetType(); 1374static string HandleRareTypes(RuntimeType enumType, ref byte rawData) => 1405RuntimeType enumType = (RuntimeType)GetType(); 1425static string HandleRareTypes(RuntimeType enumType, char formatChar, ref byte rawData) => 1452private static string ToString<TUnderlying, TStorage>(RuntimeType enumType, ref byte rawData) 1464private static string ToStringInlined<TUnderlying, TStorage>(RuntimeType enumType, ref byte rawData) 1481private static string ToString<TUnderlying, TStorage>(RuntimeType enumType, char format, ref byte rawData) 1494private static string ToStringInlined<TUnderlying, TStorage>(RuntimeType enumType, char format, ref byte rawData) 1630RuntimeType rtType = ValidateRuntimeType(enumType); 1690RuntimeType enumType = (RuntimeType)GetType(); 1750RuntimeType rt = (RuntimeType)typeof(TEnum); 1809RuntimeType rt = (RuntimeType)typeof(TEnum); 1857private static bool TryFormatPrimitiveDefault<TUnderlying, TStorage>(RuntimeType enumType, TUnderlying value, Span<char> destination, out int charsWritten) 1892private static bool TryFormatPrimitiveNonDefault<TUnderlying, TStorage>(RuntimeType enumType, TUnderlying value, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format) 2126private static RuntimeType ValidateRuntimeType(Type enumType) 2130RuntimeType? rt = enumType as RuntimeType; 2148throw 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 (7)
233_parameterTypes = new RuntimeType[signature.Length]; 238_parameterTypes[i] = (signature[i].UnderlyingSystemType as 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); 567if (structureType is not RuntimeType) 1153if (type is not RuntimeType) 1197if (t is not RuntimeType rt) 1221RuntimeType rt = (RuntimeType)typeof(TDelegate);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\TypeMapLazyDictionary.cs (13)
25private readonly RuntimeType _groupType; 30public CallbackContext(RuntimeType groupType) 244RuntimeType groupType, 280public static IReadOnlyDictionary<string, Type> CreateExternalTypeMap(RuntimeType groupType) 291public static IReadOnlyDictionary<Type, Type> CreateProxyTypeMap(RuntimeType groupType) 304protected RuntimeType _groupType; 332protected LazyTypeLoadDictionary(RuntimeType groupType) 433public LazyExternalTypeDictionary(RuntimeType groupType) : base(groupType) 462private static int ComputeHashCode(RuntimeType key) 490RuntimeType rtKey = (RuntimeType)key; 498if (key is not RuntimeType rtType) 530public LazyProxyTypeDictionary(RuntimeType groupType) : base(groupType)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\TypeMapping.cs (2)
29return TypeMapLazyDictionary.CreateExternalTypeMap((RuntimeType)typeof(TTypeMapGroup)); 47return TypeMapLazyDictionary.CreateProxyTypeMap((RuntimeType)typeof(TTypeMapGroup));
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 (26)
62if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 96private static bool IsFullNameRoundtripCompatible(RuntimeType runtimeType) 121RuntimeType valueType = (RuntimeType)value.GetType(); 214if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 228RuntimeType valueType = (RuntimeType)value.GetType(); 235valueType = (RuntimeType)valueType.GetEnumUnderlyingType(); 246RuntimeType underlyingType = Enum.InternalGetUnderlyingType(this); 288if (c.UnderlyingSystemType is RuntimeType fromType) 473static FieldInfo[]? GetFields(RuntimeType thisType, string name, BindingFlags bindingFlags) 590static MethodInfo[]? GetMethods(RuntimeType thisType, string name, BindingFlags bindingFlags) 631static PropertyInfo[]? GetProperties(RuntimeType thisType, string name, BindingFlags bindingFlags) 712private RuntimeType? GetBaseType() 721RuntimeType baseType = ObjectType; 725RuntimeType constraint = (RuntimeType)constraints[i]; 755private static void ThrowIfTypeNeverValidGenericArgument(RuntimeType type) 762internal static void SanityCheckGenericArguments(RuntimeType[] genericArguments, RuntimeType[] genericParameters) 779RuntimeType type = this; 782type = (RuntimeType)Enum.GetUnderlyingType(type); 790internal static bool TryGetByRefElementType(RuntimeType type, [NotNullWhen(true)] out RuntimeType? elementType) 924internal static object? AllocateValueType(RuntimeType type, object? value) 948RuntimeType? 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(); 858if (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) 95if (this is RuntimeType rt) 376if (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)
24private static unsafe Array InternalCreate(RuntimeType elementType, int rank, int* pLengths, int* pLowerBounds) 33private static unsafe Array InternalCreateFromArrayType(RuntimeType arrayType, int rank, int* pLengths, int* pLowerBounds) 339RuntimeType arrayType = (RuntimeType)GetType(); 354internal sealed unsafe partial class ArrayInitializeCache : RuntimeType.IGenericCacheEntry<ArrayInitializeCache> 368public static ArrayInitializeCache Create(RuntimeType arrayType) => new(GetElementConstructorEntrypoint(new QCallTypeHandle(ref arrayType))); 369public void InitializeCompositeCache(RuntimeType.CompositeCacheEntry compositeEntry) => compositeEntry._arrayInitializeCache = this; 370public 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)
150return 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 (4)
525RuntimeType declaringType = RuntimeMethodHandle.GetDeclaringType(method); 531RuntimeType reflectedType = (RuntimeType)GetType(); 535_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)
39if (localType is not RuntimeType) 68RuntimeType declaringType = rtMeth.GetRuntimeType(); 117RuntimeType declaringType = rtConstructor.GetRuntimeType(); 134RuntimeType rtType = type as RuntimeType ?? throw new ArgumentException(SR.Argument_MustBeRuntimeType); 358RuntimeType? rtType = exceptionType as RuntimeType; 513private int GetTokenFor(RuntimeType rtType) 523private int GetTokenFor(RuntimeFieldInfo runtimeField, RuntimeType rtType) 533private int GetTokenFor(RuntimeConstructorInfo rtMeth, RuntimeType rtType) 543private int GetTokenFor(RuntimeMethodInfo rtMeth, RuntimeType rtType) 691internal override RuntimeType? GetJitContext(out int securityControlFlags) 693RuntimeType? typeOwner; 1038RuntimeType type = RuntimeMethodHandle.GetDeclaringType(rmhi); 1042MethodBase 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)
235Debug.Assert(destType is RuntimeType, "destType is not a runtime type, an EnumBuilder, or a TypeBuilder."); 253CorElementType corType = ((RuntimeType)type).GetCorElementType(); 331private RuntimeType m_bakedRuntimeType = null!; 563internal RuntimeType BakedRuntimeType => m_bakedRuntimeType; 848if (fromRuntimeType != null && fromRuntimeType is RuntimeType) 981return CustomAttribute.GetCustomAttributes(m_bakedRuntimeType, (typeof(object) as RuntimeType)!, inherit); 991if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 1004if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 1638RuntimeType? cls = null;
src\System\Reflection\Emit\SignatureHelper.cs (4)
499if (clsArgument is RuntimeType) 501type = ((RuntimeType)clsArgument).GetCorElementType(); 814if (t is not RuntimeType rtType) 840if (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)
281RuntimeType? safeArrayUserDefinedType = null; 294RuntimeType? marshalTypeRef = null;
src\System\Reflection\Metadata\RuntimeTypeMetadataUpdateHandler.cs (2)
21=> CustomAttribute.IsCustomAttributeDefined(module, memberToken, (RuntimeType)typeof(MetadataUpdateDeletedAttribute)); 70private 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)
176return (MethodInfo?)RuntimeType.GetMethodBase(methodHandle); 320return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!); 327if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 337if (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; } 201internal RuntimeType[] ArgumentTypes => Signature.Arguments;
src\System\Reflection\RuntimeCustomAttributeData.cs (104)
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()); 1078public CustomAttributeType(RuntimeType parameterType) 1088parameterType = (RuntimeType)parameterType.GetElementType()!; 1096encodedEnumType = RuntimeCustomAttributeData.TypeToCustomAttributeEncoding((RuntimeType)Enum.GetUnderlyingType(parameterType)); 1116internal static bool IsDefined(RuntimeType type, RuntimeType? caType, bool inherit) 1132type = (type.BaseType as RuntimeType)!; 1139type = (type.BaseType as RuntimeType)!; 1145internal static bool IsDefined(RuntimeMethodInfo method, RuntimeType caType, bool inherit) 1172internal static bool IsDefined(RuntimeConstructorInfo ctor, RuntimeType caType) 1182internal static bool IsDefined(RuntimePropertyInfo property, RuntimeType caType) 1192internal static bool IsDefined(RuntimeEventInfo e, RuntimeType caType) 1202internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType caType) 1213internal static bool IsDefined(RuntimeParameterInfo parameter, RuntimeType caType) 1224internal static bool IsDefined(RuntimeAssembly assembly, RuntimeType caType) 1233internal static bool IsDefined(RuntimeModule module, RuntimeType caType) 1243internal static object[] GetCustomAttributes(RuntimeType type, RuntimeType caType, bool inherit) 1252type = (type.GetGenericTypeDefinition() as RuntimeType)!; 1254RuntimeType.ListBuilder<Attribute> pcas = default; 1267RuntimeType.ListBuilder<object> result = default; 1277type = (type.BaseType as RuntimeType)!; 1278} while (type != (RuntimeType)typeof(object) && type != null); 1288internal static object[] GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, bool inherit) 1296RuntimeType.ListBuilder<Attribute> pcas = default; 1309RuntimeType.ListBuilder<object> result = default; 1330internal static object[] GetCustomAttributes(RuntimeConstructorInfo ctor, RuntimeType caType) 1340internal static object[] GetCustomAttributes(RuntimePropertyInfo property, RuntimeType caType) 1350internal static object[] GetCustomAttributes(RuntimeEventInfo e, RuntimeType caType) 1360internal static object[] GetCustomAttributes(RuntimeFieldInfo field, RuntimeType caType) 1365RuntimeType.ListBuilder<Attribute> pcas = default; 1372internal static object[] GetCustomAttributes(RuntimeParameterInfo parameter, RuntimeType caType) 1377RuntimeType.ListBuilder<Attribute> pcas = default; 1384internal static object[] GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) 1395internal static object[] GetCustomAttributes(RuntimeModule module, RuntimeType caType) 1411RuntimeModule decoratedModule, int decoratedMetadataToken, RuntimeType? attributeFilterType) 1417RuntimeModule decoratedModule, int decoratedMetadataToken, RuntimeType? attributeFilterType, int attributeCtorToken, bool mustBeInheritable) 1433RuntimeType.ListBuilder<object> derivedAttributes = default; 1470RuntimeModule decoratedModule, int decoratedMetadataToken, int pcaCount, RuntimeType attributeFilterType) 1472RuntimeType.ListBuilder<object> attributes = default; 1489ref RuntimeType.ListBuilder<object> attributes, 1491RuntimeType? attributeFilterType, bool mustBeInheritable, 1493RuntimeType.ListBuilder<object> derivedAttributes) 1513out RuntimeType attributeType, out IRuntimeMethodInfo? ctorWithParameters, out bool isVarArg)) 1561GetPropertyOrFieldData(decoratedModule, ref blobStart, blobEnd, out string name, out bool isProperty, out RuntimeType? type, out object? value); 1569type = (RuntimeType)value.GetType(); 1570if (type == typeof(RuntimeType)) 1572type = (RuntimeType)typeof(Type); 1623RuntimeType attributeFilterType, 1625ref RuntimeType.ListBuilder<object> derivedAttributes, 1626out RuntimeType attributeType, 1634attributeType = (decoratedModule.ResolveType(scope.GetParentToken(caCtorToken), null, null) as RuntimeType)!; 1712private static bool MatchesTypeFilter(RuntimeType attributeType, RuntimeType attributeFilterType) 1716for (RuntimeType? type = attributeType; type != null; type = (RuntimeType?)type.BaseType) 1732RuntimeType attributeType, bool mustBeInheritable, ref RuntimeType.ListBuilder<object> derivedAttributes) 1765internal static AttributeUsageAttribute GetAttributeUsage(RuntimeType decoratedAttribute) 1776RuntimeType? attributeType = decoratedModule.ResolveType(scope.GetParentToken(caRecord.tkCtor), null, null) as RuntimeType; 1778if (attributeType != (RuntimeType)typeof(AttributeUsageAttribute)) 1799internal static object[] CreateAttributeArrayHelper(RuntimeType caType, int elementCount) 1872private static object CreateCustomAttributeInstance(RuntimeModule module, RuntimeType type, IRuntimeMethodInfo ctor, ref IntPtr blob, IntPtr blobEnd, out int namedArgs) 1902RuntimeModule module, ref IntPtr blobStart, IntPtr blobEnd, out string name, out bool isProperty, out RuntimeType? type, out object? value) 1910RuntimeType? typeLocal = null; 1933private static readonly HashSet<RuntimeType> s_pca = CreatePseudoCustomAttributeHashSet(); 1937private static HashSet<RuntimeType> CreatePseudoCustomAttributeHashSet() 1955HashSet<RuntimeType> set = new HashSet<RuntimeType>(pcas.Length); 1956foreach (RuntimeType runtimeType in pcas) 1965private static void VerifyPseudoCustomAttribute(RuntimeType pca) 1984internal static void GetCustomAttributes(RuntimeType type, RuntimeType caType, ref RuntimeType.ListBuilder<Attribute> pcas) 2006internal static bool IsDefined(RuntimeType type, RuntimeType? caType) 2028internal static void GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, ref RuntimeType.ListBuilder<Attribute> pcas) 2048internal static bool IsDefined(RuntimeMethodInfo method, RuntimeType? caType) 2068internal static void GetCustomAttributes(RuntimeParameterInfo parameter, RuntimeType caType, ref RuntimeType.ListBuilder<Attribute> pcas) 2098internal static bool IsDefined(RuntimeParameterInfo parameter, RuntimeType? caType) 2124internal static void GetCustomAttributes(RuntimeFieldInfo field, RuntimeType caType, ref RuntimeType.ListBuilder<Attribute> pcas) 2153internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType? caType) 2265internal static StructLayoutAttribute? GetStructLayoutCustomAttribute(RuntimeType type)
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(); 114RuntimeType? parent = (RuntimeType?)m_declaringType.BaseType; 124return (RuntimeMethodInfo?)RuntimeType.GetMethodBase(parent, RuntimeTypeHandle.GetMethodAt(parent, slot)); 128internal RuntimeType GetDeclaringTypeInternal() 176return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!, inherit); 183if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 193if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 235internal RuntimeType GetRuntimeType() { return m_declaringType; } 273internal RuntimeType[] ArgumentTypes => Signature.Arguments; 342RuntimeType declaringType = (RuntimeType)DeclaringType!; 343RuntimeType? baseDeclaringType = declaringType; 356declaringType = (RuntimeType)declaringType.BaseType!; 359return (MethodInfo)RuntimeType.GetMethodBase(baseDeclaringType, baseMethodHandle)!; 395RuntimeType rtType = delegateType as RuntimeType ?? 413RuntimeType[] methodInstantionRuntimeType = new RuntimeType[methodInstantiation.Length]; 424RuntimeType? rtMethodInstantiationElem = methodInstantiationElem as RuntimeType; 438RuntimeType[] genericParameters = GetGenericArgumentsInternal(); 440RuntimeType.SanityCheckGenericArguments(methodInstantionRuntimeType, genericParameters); 446ret = RuntimeType.GetMethodBase(ReflectedTypeInternal, 451RuntimeType.ValidateGenericArguments(this, methodInstantionRuntimeType, e); 458internal RuntimeType[] GetGenericArgumentsInternal() => 469return (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; 456return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!); 463if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType) 479if (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 (7)
112internal static RuntimeType GetTypeReferencedByCustomAttribute(string typeName, RuntimeModule scope) 119RuntimeType? type = (RuntimeType?)new TypeNameResolver() 135private static unsafe void GetTypeHelper(char* pTypeName, RuntimeAssembly* pRequestingAssembly, bool throwOnError, bool requireAssemblyQualifiedName, IntPtr unsafeAccessorMethod, RuntimeType* pResult, Exception* pException) 148internal static RuntimeType? GetTypeHelper(ReadOnlySpan<char> typeName, RuntimeAssembly? requestingAssembly, 166RuntimeType? type = (RuntimeType?)new TypeNameResolver()
src\System\Runtime\CompilerServices\RuntimeHelpers.CoreCLR.cs (8)
172RuntimeType rt = type.GetRuntimeType() ?? 341if (type is not RuntimeType rt) 483if (type is not RuntimeType rt) 503if (type is not RuntimeType rt) 1064public RuntimeType? ExposedClassObject 1068return *(RuntimeType*)Unsafe.AsPointer(ref _exposedClassObject); 1171public RuntimeType? ExposedClassObject 1175return *(RuntimeType*)Unsafe.AsPointer(ref ExposedClassObjectRaw);
src\System\Runtime\InteropServices\DynamicInterfaceCastableHelpers.cs (7)
17internal static bool IsInterfaceImplemented(IDynamicInterfaceCastable castable, RuntimeType interfaceType, bool throwIfNotImplemented) 28private static unsafe void IsInterfaceImplemented(IDynamicInterfaceCastable* pCastable, RuntimeType* pInterfaceType, bool throwIfNotImplemented, bool* pResult, Exception* pException) 41internal static RuntimeType? GetInterfaceImplementation(IDynamicInterfaceCastable castable, RuntimeType interfaceType) 47RuntimeType implType = handle.GetRuntimeType(); 62private static unsafe void GetInterfaceImplementation(IDynamicInterfaceCastable* pCastable, RuntimeType* pInterfaceType, RuntimeType* pResult, Exception* pException)
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) 976internal static Delegate GetDelegateForFunctionPointerInternal(IntPtr ptr, RuntimeType t)
src\System\RuntimeHandles.cs (124)
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) 71internal static unsafe RuntimeType GetRuntimeType(MethodTable* pMT) 93internal RuntimeType? m_type; 106internal RuntimeTypeHandle(RuntimeType? type) 116internal static bool IsTypeDefinition(RuntimeType type) 134internal static bool IsPrimitive(RuntimeType type) 139internal static bool IsByRef(RuntimeType type) 145internal static bool IsPointer(RuntimeType type) 151internal static bool IsArray(RuntimeType type) 157internal static bool IsSZArray(RuntimeType type) 163internal static bool IsFunctionPointer(RuntimeType type) 169internal static bool HasElementType(RuntimeType type) 228[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] RuntimeType type, 229RuntimeType genericParameter) 251[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] RuntimeType type, 252RuntimeType genericParameter1, 253RuntimeType genericParameter2) 294internal static object InternalAlloc(RuntimeType type) 337RuntimeType rt, 388internal RuntimeType GetRuntimeType() 393internal static RuntimeAssembly GetAssembly(RuntimeType type) 398static RuntimeAssembly GetAssemblyWorker(RuntimeType type) 407private static extern RuntimeAssembly? GetAssemblyIfExists(RuntimeType type); 412internal static RuntimeModule GetModule(RuntimeType type) 417static RuntimeModule GetModuleWorker(RuntimeType type) 426private static extern RuntimeModule? GetModuleIfExists(RuntimeType type); 442internal static extern TypeAttributes GetAttributes(RuntimeType type); 447internal static RuntimeType? GetElementType(RuntimeType type) 455RuntimeType result = GetRuntimeTypeFromHandle(handle); 461internal static extern bool CompareCanonicalHandles(RuntimeType left, RuntimeType right); 464internal static extern int GetArrayRank(RuntimeType type); 467internal static extern int GetToken(RuntimeType type); 473internal static RuntimeMethodHandleInternal GetMethodAt(RuntimeType type, int slot) 489internal static Type[] GetArgumentTypesFromFunctionPointer(RuntimeType type) 501internal static extern bool IsUnmanagedFunctionPointer(RuntimeType type); 509internal IntroducedMethodEnumerator(RuntimeType type) 537internal static IntroducedMethodEnumerator GetIntroducedMethods(RuntimeType type) 543private static extern RuntimeMethodHandleInternal GetFirstIntroducedMethod(RuntimeType type); 552internal static bool GetFields(RuntimeType type, Span<IntPtr> buffer, out int count) 574internal static Type[] GetInterfaces(RuntimeType type) 622internal static extern int GetNumVirtuals(RuntimeType type); 627internal static int GetNumVirtualsAndStaticVirtuals(RuntimeType type) 657internal static bool IsVisible(RuntimeType type) 680internal static MdUtf8String GetUtf8Name(RuntimeType type) 696internal static bool CanCastTo(RuntimeType type, RuntimeType target) 710internal static RuntimeType? GetDeclaringType(RuntimeType type) 732RuntimeType result = GetRuntimeTypeFromHandle(retTypeHandle); 740internal static IRuntimeMethodInfo? GetDeclaringMethodForGenericParameter(RuntimeType type) 752internal RuntimeType[] GetInstantiationInternal() 754RuntimeType[]? types = null; 772internal RuntimeType Instantiate(RuntimeType inst) 776RuntimeType? type = null; 783internal RuntimeType Instantiate(Type[]? inst) 789RuntimeType? type = null; 800internal RuntimeType MakeArray(int rank) 802RuntimeType? type = null; 811internal RuntimeType MakeSZArray() 813RuntimeType? type = null; 822internal RuntimeType MakeByRef() 824RuntimeType? type = null; 834internal RuntimeType MakeFunctionPointer(Type[] parameterTypes, bool isUnmanaged) 843RuntimeType? type = null; 857internal RuntimeType MakePointer() 859RuntimeType? type = null; 869internal static extern bool IsGenericVariable(RuntimeType type); 872private static extern int GetGenericVariableIndex(RuntimeType type); 876RuntimeType type = GetRuntimeTypeChecked(); 885internal static extern bool ContainsGenericVariables(RuntimeType handle); 895internal static bool SatisfiesConstraints(RuntimeType paramType, RuntimeType? typeContext, RuntimeMethodInfo? methodContext, RuntimeType toType) 906internal static void RegisterCollectibleTypeDependency(RuntimeType type, RuntimeAssembly? assembly) 1130internal static unsafe RuntimeType GetDeclaringType(RuntimeMethodHandleInternal method) 1137internal static RuntimeType GetDeclaringType(IRuntimeMethodInfo method) 1139RuntimeType type = GetDeclaringType(method.Value); 1239internal static object ReboxToNullable(object? src, RuntimeType destNullableType) 1256internal static RuntimeType[] GetMethodInstantiationInternal(IRuntimeMethodInfo method) 1258RuntimeType[]? types = null; 1264internal static RuntimeType[] GetMethodInstantiationInternal(RuntimeMethodHandleInternal method) 1266RuntimeType[]? types = null; 1290private static extern RuntimeMethodHandleInternal GetStubIfNeededInternal(RuntimeMethodHandleInternal method, RuntimeType declaringType); 1295internal static RuntimeMethodHandleInternal GetStubIfNeeded(RuntimeMethodHandleInternal method, RuntimeType declaringType, RuntimeType[]? methodInstantiation) 1307static RuntimeMethodHandleInternal GetStubIfNeededWorker(RuntimeMethodHandleInternal method, RuntimeType declaringType, RuntimeType[]? methodInstantiation) 1312internal static extern RuntimeMethodHandleInternal GetMethodFromCanonical(RuntimeMethodHandleInternal method, RuntimeType declaringType); 1371internal static RuntimeMethodBody? GetMethodBody(IRuntimeMethodInfo method, RuntimeType declaringType) 1567internal static RuntimeType GetApproxDeclaringType(RuntimeFieldHandleInternal field) 1576internal static RuntimeType GetApproxDeclaringType(IRuntimeFieldInfo field) 1578RuntimeType type = GetApproxDeclaringType(field.Value); 1635internal static object? GetValue(RtFieldInfo field, object? instance, RuntimeType fieldType, RuntimeType? declaringType, ref bool isClassInitialized) 1657internal static object? GetValueDirect(RtFieldInfo field, RuntimeType fieldType, TypedReference typedRef, RuntimeType? contextType) 1679internal static void SetValue(RtFieldInfo field, object? obj, object? value, RuntimeType fieldType, RuntimeType? declaringType, ref bool isClassInitialized) 1699internal static void SetValueDirect(RtFieldInfo field, RuntimeType fieldType, TypedReference typedRef, object? value, RuntimeType? contextType) 1714internal static RuntimeFieldHandleInternal GetStaticFieldForGenericType(RuntimeFieldHandleInternal field, RuntimeType declaringType) 1896RuntimeType? type = null; 2033internal static RuntimeType GetModuleType(RuntimeModule module) 2035RuntimeType? type = null; 2069private RuntimeType[]? _arguments; 2070private RuntimeType _declaringType; 2071private RuntimeType _returnTypeORfieldType; 2110RuntimeType[] arguments, 2111RuntimeType returnType, 2125public Signature(IRuntimeMethodInfo methodHandle, RuntimeType declaringType) 2132public Signature(IRuntimeFieldInfo fieldHandle, RuntimeType declaringType) 2140public Signature(void* pCorSig, int cCorSig, RuntimeType declaringType) 2149internal RuntimeType[] Arguments 2157internal RuntimeType ReturnType => _returnTypeORfieldType; 2158internal RuntimeType FieldType => _returnTypeORfieldType; 2261internal abstract RuntimeType? GetJitContext(out int securityControlFlags); 2276internal static unsafe void GetJitContext(Resolver* pResolver, int* pSecurityControlFlags, RuntimeType* ppResult, Exception* pException)
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)
18public static BoxCache Create(RuntimeType type) => new(type); 30private readonly RuntimeType _originalRuntimeType; 33private BoxCache(RuntimeType rt) 59internal object? Box(RuntimeType rt, ref byte data) 110RuntimeType rt,
src\System\RuntimeType.CoreCLR.cs (129)
210internal MethodBase AddMethod(RuntimeType declaringType, RuntimeMethodHandleInternal method, CacheType cacheType) 311RuntimeType approxDeclaringType = RuntimeFieldHandle.GetApproxDeclaringType(field); 582RuntimeType declaringType = ReflectedType; 763RuntimeType declaringType = ReflectedType; 818RuntimeType declaringType = ReflectedType; 824RuntimeType? populatingType = declaringType; 849PopulateLiteralFields(filter, (RuntimeType)iface, ref list); 850PopulateRtFields(filter, (RuntimeType)iface, ref list); 857private unsafe void PopulateRtFields(Filter filter, RuntimeType declaringType, ref ListBuilder<RuntimeFieldInfo> list) 874ReadOnlySpan<IntPtr> fieldHandles, RuntimeType declaringType, ref ListBuilder<RuntimeFieldInfo> list) 926private void PopulateLiteralFields(Filter filter, RuntimeType declaringType, ref ListBuilder<RuntimeFieldInfo> list) 993ref ListBuilder<RuntimeType> list, 995[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] RuntimeType iList, 1008RuntimeType iFace = (RuntimeType)iFaces[j]; 1020private RuntimeType[] PopulateInterfaces(Filter filter) 1022ListBuilder<RuntimeType> list = default; 1024RuntimeType declaringType = ReflectedType; 1031RuntimeType interfaceType = (RuntimeType)iface; 1045RuntimeType arrayType = (RuntimeType)ReflectedType.GetElementType()!; 1049AddSpecialInterface(ref list, filter, (RuntimeType)typeof(IList<>).MakeGenericType(arrayType), true); 1053AddSpecialInterface(ref list, filter, (RuntimeType)typeof(IReadOnlyList<>).MakeGenericType(arrayType), false); 1054AddSpecialInterface(ref list, filter, (RuntimeType)typeof(IReadOnlyCollection<>).MakeGenericType(arrayType), false); 1060var al = new HashSet<RuntimeType>(); 1068RuntimeType constraint = (RuntimeType)constraints[i]; 1074al.Add((RuntimeType)temp[j]); 1078foreach (RuntimeType rt in al) 1094private RuntimeType[] PopulateNestedClasses(Filter filter) 1096RuntimeType declaringType = ReflectedType; 1109ListBuilder<RuntimeType> list = default; 1118RuntimeType nestedType; 1151RuntimeType declaringType = ReflectedType; 1160RuntimeType? populatingType = declaringType; 1177Filter filter, RuntimeType declaringType, Dictionary<string, RuntimeEventInfo>? csEventInfos, ref ListBuilder<RuntimeEventInfo> list) 1247RuntimeType declaringType = ReflectedType; 1267RuntimeType? populatingType = declaringType; 1285RuntimeType declaringType, 1444internal RuntimeType ReflectedType => m_runtimeTypeCache.GetRuntimeType(); 1451private readonly RuntimeType m_runtimeType; 1452private RuntimeType? m_enclosingType; 1463private MemberInfoCache<RuntimeType>? m_interfaceCache; 1464private MemberInfoCache<RuntimeType>? m_nestedClassesCache; 1473private RuntimeType? _genericTypeDefinition; 1477internal RuntimeTypeCache(RuntimeType runtimeType) 1528public static FunctionPointerCache Create(RuntimeType type) 1533public void InitializeCompositeCache(RuntimeType.CompositeCacheEntry compositeEntry) => compositeEntry._functionPointerCache = this; 1534public static ref FunctionPointerCache? GetStorageRef(RuntimeType.CompositeCacheEntry compositeEntry) => ref compositeEntry._functionPointerCache; 1574RuntimeModule module = ((RuntimeType)type).GetRuntimeModule(); 1588internal RuntimeType? GetEnclosingType() 1593RuntimeType? enclosingType = RuntimeTypeHandle.GetDeclaringType(GetRuntimeType()); 1595m_enclosingType = enclosingType ?? (RuntimeType)typeof(void); 1601internal RuntimeType GetRuntimeType() => m_runtimeType; 1613for (RuntimeType? t = m_runtimeType; t != null; t = t.GetBaseType()) 1638internal RuntimeType GetGenericTypeDefinition() 1645RuntimeType CacheGenericDefinition() 1647RuntimeType genericDefinition = null!; 1654RuntimeType type = m_runtimeType; 1742internal RuntimeType[] GetInterfaceList(MemberListType listType, string? name) 1747internal RuntimeType[] GetNestedTypeList(MemberListType listType, string? name) 1752internal MethodBase GetMethod(RuntimeType declaringType, RuntimeMethodHandleInternal method) 1758internal MethodBase GetConstructor(RuntimeType declaringType, RuntimeMethodHandleInternal constructor) 1780internal unsafe RuntimeType? GetParentType() 1794RuntimeType result = RuntimeTypeHandle.GetRuntimeType(pParentMT); 1810internal static MethodBase? GetMethodBase(RuntimeType? reflectedType, IRuntimeMethodInfo methodHandle) 1820internal static MethodBase? GetMethodBase(RuntimeType? reflectedType, RuntimeMethodHandleInternal methodHandle) 1835RuntimeType declaredType = RuntimeMethodHandle.GetDeclaringType(methodHandle); 1837RuntimeType[]? methodInstantiation = null; 1873RuntimeType declaringDefinition = (RuntimeType)declaredType.GetGenericTypeDefinition(); 1875RuntimeType? baseType = reflectedType; 1879RuntimeType baseDefinition = baseType; 1882baseDefinition = (RuntimeType)baseDefinition.GetGenericTypeDefinition(); 1973internal static FieldInfo GetFieldInfo(RuntimeType? reflectedType, IRuntimeFieldInfo field) 1984RuntimeType declaredType = RuntimeFieldHandle.GetApproxDeclaringType(fieldHandle); 2004private static RuntimePropertyInfo GetPropertyInfo(RuntimeType reflectedType, int tkProperty) 2021internal static void ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception? e) 2023RuntimeType? typeContext; 2025RuntimeType[] genericParameters; 2029typeContext = (RuntimeType)definition; 2035typeContext = (RuntimeType?)methodContext.DeclaringType; 2252Debug.Assert(type is RuntimeType); 2414internal static readonly RuntimeType ValueType = (RuntimeType)typeof(ValueType); 2416private static readonly RuntimeType ObjectType = (RuntimeType)typeof(object); 2417private static readonly RuntimeType StringType = (RuntimeType)typeof(string); 2440return (o is RuntimeType t) && (t.m_handle == m_handle); 2647RuntimeType[] cache = Cache.GetNestedTypeList(listType, name); 2652RuntimeType nestedClass = cache[i]; 2697RuntimeType[] candidates = Cache.GetInterfaceList(MemberListType.All, null); 2745RuntimeType ifaceRtType = interfaceType as RuntimeType ?? 2793RuntimeType reflectedType = RuntimeMethodHandle.GetDeclaringType(classRtMethodHandle); 3023RuntimeType[] cache = Cache.GetInterfaceList(listType, name); 3025RuntimeType? match = null; 3029RuntimeType iface = cache[i]; 3052RuntimeType[] cache = Cache.GetNestedTypeList(listType, name); 3054RuntimeType? match = null; 3058RuntimeType nestedType = cache[i]; 3158RuntimeType? runtimeType = this; 3183private static RuntimeMethodInfo? GetMethodWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo method) 3199private static RuntimeConstructorInfo? GetConstructorWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo constructor) 3215private static RuntimePropertyInfo? GetPropertyWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo property) 3231private static RuntimeFieldInfo? GetFieldWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo field) 3247private static RuntimeEventInfo? GetEventWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo eventInfo) 3263private static RuntimeType? GetNestedTypeWithSameMetadataDefinitionAs(RuntimeType runtimeType, MemberInfo nestedType) 3265RuntimeType[] cache = runtimeType.Cache.GetNestedTypeList(MemberListType.CaseSensitive, nestedType.Name); 3269RuntimeType candidate = cache[i]; 3316RuntimeType? rtType = type as RuntimeType; 3320RuntimeType? baseType = GetBaseType(); 3594internal RuntimeType[] GetGenericArgumentsInternal() 3612RuntimeType[] genericParameters = GetGenericArgumentsInternal(); 3616if (typeArguments.Length == 1 && typeArguments[0] is RuntimeType rt) 3630RuntimeType[] instantiationRuntimeType = new RuntimeType[typeArguments.Length]; 3637RuntimeType? rtInstantiationElem = instantiationElem as RuntimeType; 3718public sealed override bool HasSameMetadataDefinitionAs(MemberInfo other) => HasSameMetadataDefinitionAsCore<RuntimeType>(other); 3744if (paramType is not RuntimeType) 3760private static bool CanValueSpecialCast(RuntimeType valueType, RuntimeType targetType) 3796RuntimeType srcType = pointer != null ? pointer.GetPointerType() : (RuntimeType)value.GetType();
src\System\RuntimeType.CreateUninitializedCache.CoreCLR.cs (7)
18public static CreateUninitializedCache Create(RuntimeType type) => new(type); 19public void InitializeCompositeCache(RuntimeType.CompositeCacheEntry compositeEntry) => compositeEntry._createUninitializedCache = this; 20public static ref CreateUninitializedCache? GetStorageRef(RuntimeType.CompositeCacheEntry compositeEntry) => ref compositeEntry._createUninitializedCache; 27private readonly RuntimeType _originalRuntimeType; 30private CreateUninitializedCache(RuntimeType rt) 41internal object CreateUninitializedObject(RuntimeType rt) 62RuntimeType 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 (2)
983RuntimeType marshalerType = RuntimeTypeHandle.GetRuntimeType((MethodTable*)pMT); 1255int allocSize = Marshal.SizeOfHelper((RuntimeType)pManagedHome.GetType(), false);
src\System\TypedReference.CoreCLR.cs (1)
20private TypedReference(ref byte target, RuntimeType type)