Compiler\AnalysisBasedMetadataManager.cs (10)
27private readonly List<TypeDesc> _forcedTypes;
29private readonly Dictionary<TypeDesc, MetadataCategory> _reflectableTypes = new Dictionary<TypeDesc, MetadataCategory>();
38new NoDynamicInvokeThunkGenerationPolicy(), null, Array.Empty<ModuleDesc>(), Array.Empty<TypeDesc>(),
39Array.Empty<ReflectableEntity<TypeDesc>>(), Array.Empty<ReflectableEntity<MethodDesc>>(),
55IEnumerable<TypeDesc> forcedTypes,
56IEnumerable<ReflectableEntity<TypeDesc>> reflectableTypes,
65_forcedTypes = new List<TypeDesc>(forcedTypes);
171protected sealed override MetadataCategory GetMetadataCategory(TypeDesc type)
201foreach (var type in _forcedTypes)
Compiler\CustomAttributeExtensions.cs (5)
13public static CustomAttributeValue<TypeDesc>? GetDecodedCustomAttribute(this PropertyPseudoDesc prop, string attributeNamespace, string attributeName)
27public static IEnumerable<CustomAttributeValue<TypeDesc>> GetDecodedCustomAttributes(this PropertyPseudoDesc prop, string attributeNamespace, string attributeName)
42public static CustomAttributeValue<TypeDesc>? GetDecodedCustomAttribute(this EventPseudoDesc @event, string attributeNamespace, string attributeName)
56public static IEnumerable<CustomAttributeValue<TypeDesc>> GetDecodedCustomAttributes(this EventPseudoDesc @event, string attributeNamespace, string attributeName)
71public static IEnumerable<CustomAttributeValue<TypeDesc>> GetDecodedCustomAttributesForModule(this EcmaModule module, string attributeNamespace, string attributeName)
Compiler\Dataflow\DiagnosticUtilities.cs (17)
33return ((TypeDesc)parent).GetDisplayName();
36internal static bool TryGetRequiresAttribute(TypeSystemEntity member, string requiresAttributeName, [NotNullWhen(returnValue: true)] out CustomAttributeValue<TypeDesc>? attribute)
39CustomAttributeValue<TypeDesc>? decoded;
72internal static string GetRequiresAttributeMessage(CustomAttributeValue<TypeDesc> attribute)
80internal static string GetRequiresAttributeUrl(CustomAttributeValue<TypeDesc> attribute)
98internal static bool IsInRequiresScope(this MethodDesc method, string requiresAttribute, [NotNullWhen(returnValue: true)] out CustomAttributeValue<TypeDesc>? attribute)
103if (method.OwningType is TypeDesc type && TryGetRequiresAttribute(type, requiresAttribute, out attribute))
121internal static bool DoesMethodRequire(this MethodDesc method, string requiresAttribute, [NotNullWhen(returnValue: true)] out CustomAttributeValue<TypeDesc>? attribute)
130if ((method.Signature.IsStatic || method.IsConstructor) && method.OwningType is TypeDesc owningType &&
151internal static bool DoesFieldRequire(this FieldDesc field, string requiresAttribute, [NotNullWhen(returnValue: true)] out CustomAttributeValue<TypeDesc>? attribute)
153if (!field.IsStatic || field.OwningType is not TypeDesc owningType || owningType.IsArray)
162internal static bool DoesPropertyRequire(this PropertyPseudoDesc property, string requiresAttribute, [NotNullWhen(returnValue: true)] out CustomAttributeValue<TypeDesc>? attribute) =>
165internal static bool DoesEventRequire(this EventPseudoDesc @event, string requiresAttribute, [NotNullWhen(returnValue: true)] out CustomAttributeValue<TypeDesc>? attribute) =>
168internal static bool DoesTypeRequire(this TypeDesc type, string requiresAttribute, [NotNullWhen(returnValue: true)] out CustomAttributeValue<TypeDesc>? attribute) =>
176internal static bool DoesMemberRequire(this TypeSystemEntity member, string requiresAttribute, [NotNullWhen(returnValue: true)] out CustomAttributeValue<TypeDesc>? attribute)
189private static bool ExcludeStatics(CustomAttributeValue<TypeDesc> attribute)
Compiler\Dataflow\GenericArgumentDataFlow.cs (11)
27TypeDesc type,
28TypeDesc contextType,
43public static void ProcessGenericArgumentDataFlow(ref DependencyList dependencies, NodeFactory factory, in MessageOrigin origin, TypeDesc type, MethodDesc contextMethod)
52TypeDesc type,
61TypeDesc instantiatedType = type.InstantiateSignature(typeContext, methodContext);
98public static void ProcessGenericArgumentDataFlow(in DiagnosticContext diagnosticContext, ReflectionMarker reflectionMarker, TypeDesc type)
100TypeDesc typeDefinition = type.GetTypeDefinition();
128var genericArgument = instantiation[i];
161foreach (TypeDesc typeParameter in method.Instantiation)
181public static bool RequiresGenericArgumentDataFlow(FlowAnnotations flowAnnotations, TypeDesc type)
190foreach (TypeDesc typeParameter in type.Instantiation)
Compiler\Dataflow\HandleCallAction.cs (21)
72TypeDesc typeInstantiated = typeValue.RepresentedType.Type;
247TypeDesc canonArrayType = _reflectionMarker.Factory.TypeSystemContext.CanonType.MakeArrayType();
376TypeDesc? staticType = (valueNode as IValueWithStaticType)?.StaticType?.Type;
422TypeDesc? staticType = (valueNode as IValueWithStaticType)?.StaticType?.Type;
432foreach (TypeDesc constraint in genericParam.TypeConstraints)
528TypeDesc typeMapGroup = calledMethod.Method.Instantiation[0];
546TypeDesc typeMapGroup = calledMethod.Method.Instantiation[0];
573foreach (TypeDesc constraint in p.TypeConstraints)
615TypeDesc[]? sigInst = null;
616TypeDesc[]? defInst = null;
618ArrayBuilder<TypeDesc> result = default;
629TypeDesc? type = singleValue switch
652TypeDesc contextType = contextMethod.OwningType;
653sigInst = new TypeDesc[contextType.Instantiation.Length + contextMethod.Instantiation.Length];
654defInst = new TypeDesc[contextType.Instantiation.Length + contextMethod.Instantiation.Length];
685TypeDesc? type = method.Method.OwningType;
731if (!_reflectionMarker.TryResolveTypeNameAndMark(resolvedAssembly, typeName, _diagnosticContext, "Reflection", fallbackToCoreLib: true, out TypeDesc? foundType))
764if (!_reflectionMarker.TryResolveTypeNameAndMark(resolvedAssembly, typeName, _diagnosticContext, "Reflection", fallbackToCoreLib: false, out TypeDesc? foundType))
833private readonly TypeDesc _type;
835public MakeGenericTypeSite(TypeDesc type) => _type = type;
840TypeDesc instantiatedType = _type.InstantiateSignature(typeInstantiation, methodInstantiation);
Compiler\Dataflow\ReflectionMarker.cs (17)
62internal void MarkTypeForDynamicallyAccessedMembers(in MessageOrigin origin, TypeDesc typeDefinition, DynamicallyAccessedMemberTypes requiredMemberTypes, TypeSystemEntity reason, bool declaredOnly = false)
98internal bool TryResolveTypeNameAndMark(string typeName, in DiagnosticContext diagnosticContext, bool needsAssemblyName, TypeSystemEntity reason, [NotNullWhen(true)] out TypeDesc? type)
103TypeDesc foundType = CustomAttributeTypeNameParser.GetTypeByCustomAttributeTypeNameForDataFlow(typeName, callingModule, diagnosticContext.Origin.MemberDefinition!.Context,
135internal bool TryResolveTypeNameAndMark(ModuleDesc assembly, string typeName, in DiagnosticContext diagnosticContext, string reason, bool fallbackToCoreLib, [NotNullWhen(true)] out TypeDesc? type)
138TypeDesc foundType = CustomAttributeTypeNameParser.GetTypeByCustomAttributeTypeNameForDataFlow(typeName, assembly, assembly.Context,
165internal void MarkType(in MessageOrigin origin, TypeDesc type, TypeSystemEntity reason, AccessKind accessKind = AccessKind.Unspecified)
173internal void MarkType(in MessageOrigin origin, TypeDesc type, string reason, AccessKind accessKind = AccessKind.Unspecified)
239internal void MarkConstructorsOnType(in MessageOrigin origin, TypeDesc type, Func<MethodDesc, bool>? filter, TypeSystemEntity reason, BindingFlags? bindingFlags = null)
249internal void MarkFieldsOnTypeHierarchy(in MessageOrigin origin, TypeDesc type, Func<FieldDesc, bool> filter, TypeSystemEntity reason, BindingFlags? bindingFlags = BindingFlags.Default)
259internal void MarkPropertiesOnTypeHierarchy(in MessageOrigin origin, TypeDesc type, Func<PropertyPseudoDesc, bool> filter, TypeSystemEntity reason, BindingFlags? bindingFlags = BindingFlags.Default)
269internal void MarkEventsOnTypeHierarchy(in MessageOrigin origin, TypeDesc type, Func<EventPseudoDesc, bool> filter, TypeSystemEntity reason, BindingFlags? bindingFlags = BindingFlags.Default)
279internal void MarkStaticConstructor(in MessageOrigin origin, TypeDesc type, TypeSystemEntity reason)
313_logger.ShouldSuppressAnalysisWarningsForRequires(entity, DiagnosticUtilities.RequiresUnreferencedCodeAttribute, out CustomAttributeValue<TypeDesc>? requiresAttribute) &&
367static bool IsDeclaredWithinType(TypeSystemEntity member, TypeDesc type)
369TypeDesc owningType = member.GetOwningType();
388bool isReflectionAccessCoveredByRUC = _logger.ShouldSuppressAnalysisWarningsForRequires(entity, DiagnosticUtilities.RequiresUnreferencedCodeAttribute, out CustomAttributeValue<TypeDesc>? requiresUnreferencedCodeAttribute);
407private void ReportRequires(in MessageOrigin origin, TypeSystemEntity entity, string requiresAttributeName, in CustomAttributeValue<TypeDesc> requiresAttribute)
Compiler\DependencyAnalysis\CustomAttributeBasedDependencyAlgorithm.cs (16)
120CustomAttributeValue<TypeDesc> decodedValue = attribute.DecodeValue(attributeTypeProvider);
162private static bool AddDependenciesFromCustomAttributeBlob(DependencyList dependencies, NodeFactory factory, TypeDesc attributeType, CustomAttributeValue<TypeDesc> value)
164foreach (CustomAttributeTypedArgument<TypeDesc> decodedArgument in value.FixedArguments)
170foreach (CustomAttributeNamedArgument<TypeDesc> decodedArgument in value.NamedArguments)
193private static bool AddDependenciesFromField(DependencyList dependencies, NodeFactory factory, TypeDesc attributeType, string fieldName)
207TypeDesc baseType = attributeType.BaseType;
216private static bool AddDependenciesFromPropertySetter(DependencyList dependencies, NodeFactory factory, TypeDesc attributeType, string propertyName)
250TypeDesc baseType = attributeType.BaseType;
259private static bool AddDependenciesFromCustomAttributeArgument(DependencyList dependencies, NodeFactory factory, TypeDesc type, object value)
274TypeDesc elementType = ((ArrayType)type).ElementType;
278foreach (CustomAttributeTypedArgument<TypeDesc> arrayElement in (ImmutableArray<CustomAttributeTypedArgument<TypeDesc>>)value)
289Debug.Assert(value is TypeDesc);
291TypeDesc typeofType = (TypeDesc)value;
Compiler\DependencyAnalysis\InterfaceGenericVirtualMethodTableNode.cs (10)
22private Dictionary<object, Dictionary<TypeDesc, HashSet<int>>> _interfaceImpls;
28_interfaceImpls = new Dictionary<object, Dictionary<TypeDesc, HashSet<int>>>();
48public static void GetGenericVirtualMethodImplementationDependencies(ref DependencyList dependencies, NodeFactory factory, MethodDesc callingMethod, TypeDesc implementationType, MethodDesc implementationMethod)
54TypeDesc openImplementationType = implementationType.GetTypeDefinition();
73TypeDesc currentInterface = openImplementationType.RuntimeInterfaces[index];
81private void AddGenericVirtualMethodImplementation(MethodDesc callingMethod, TypeDesc implementationType, MethodDesc implementationMethod, DefaultInterfaceMethodResolution resolution)
88TypeDesc openImplementationType = implementationType.GetTypeDefinition();
102_interfaceImpls[openImplementationMethod] = new Dictionary<TypeDesc, HashSet<int>>();
197TypeDesc implementationType = currentImpl.Key;
208TypeDesc currentInterface = implementationType.RuntimeInterfaces[ifaceId];
Compiler\DependencyAnalysis\NativeLayoutVertexNode.cs (45)
137foreach (var arg in _method.Instantiation)
309protected readonly TypeDesc _type;
311protected NativeLayoutTypeSignatureVertexNode(TypeDesc type)
318public static NativeLayoutTypeSignatureVertexNode NewTypeSignatureVertexNode(NodeFactory factory, TypeDesc type)
351public NativeLayoutParameterizedTypeSignatureVertexNode(NodeFactory factory, TypeDesc type) : base(type)
395public NativeLayoutFunctionPointerTypeSignatureVertexNode(NodeFactory factory, TypeDesc type) : base(type)
413public NativeLayoutGenericVarSignatureVertexNode(TypeDesc type) : base(type)
443public NativeLayoutInstantiatedTypeSignatureVertexNode(NodeFactory factory, TypeDesc type) : base(type)
478public NativeLayoutEETypeSignatureVertexNode(TypeDesc type) : base(type)
684foreach (var arg in _method.Instantiation)
715TypeDesc owningType = (TypeDesc)owningMethodOrType;
732TypeDesc owningType = (TypeDesc)_owningMethodOrType;
750new DependencyListEntry(context.NativeLayout.TypeSignatureVertex((TypeDesc)_owningMethodOrType), "DeclaringType signature"),
786signature = nativeWriter.GetTuple(factory.NativeLayout.TypeSignatureVertex((TypeDesc)_owningMethodOrType).WriteVertex(factory), sequence);
822foreach (var type in _method.Instantiation)
832foreach (TypeDesc typeConstraint in genericParam.TypeConstraints)
878private TypeDesc _type;
880public TypeDesc CanonType => _type.ConvertToCanonForm(CanonicalFormKind.Specific);
884public NativeLayoutTemplateTypeLayoutVertexNode(NodeFactory factory, TypeDesc type)
892private static TypeDesc GetActualTemplateTypeForType(NodeFactory factory, TypeDesc type)
941foreach (TypeDesc iface in _type.RuntimeInterfaces)
958foreach (TypeDesc typeConstraint in genericParam.TypeConstraints)
978TypeDesc baseType = _type.BaseType;
1019foreach (TypeDesc iface in _type.RuntimeInterfaces)
1104private TypeDesc _type;
1106public NativeLayoutTypeSignatureBasedGenericDictionarySlotNode(NodeFactory factory, TypeDesc type)
1133public NativeLayoutTypeHandleGenericDictionarySlotNode(NodeFactory factory, TypeDesc type) : base(factory, type)
1144public NativeLayoutUnwrapNullableGenericDictionarySlotNode(NodeFactory factory, TypeDesc type) : base(factory, type)
1155public NativeLayoutAllocateObjectGenericDictionarySlotNode(NodeFactory factory, TypeDesc type) : base(factory, type)
1166public NativeLayoutThreadStaticBaseIndexDictionarySlotNode(NodeFactory factory, TypeDesc type) : base(factory, type)
1177public NativeLayoutDefaultConstructorGenericDictionarySlotNode(NodeFactory factory, TypeDesc type) : base(factory, type)
1189private TypeDesc _type;
1191public NativeLayoutStaticsGenericDictionarySlotNode(NodeFactory factory, TypeDesc type)
1221public NativeLayoutGcStaticsGenericDictionarySlotNode(NodeFactory factory, TypeDesc type) : base(factory, type)
1230public NativeLayoutNonGcStaticsGenericDictionarySlotNode(NodeFactory factory, TypeDesc type) : base(factory, type)
1305foreach (var type in _method.Instantiation)
1346foreach (var type in _method.Instantiation)
1430foreach (var type in _method.Instantiation)
1457private TypeDesc _constraintType;
1460public NativeLayoutConstrainedMethodDictionarySlotNode(MethodDesc constrainedMethod, TypeDesc constraintType, bool directCall)
1510foreach (var type in _constrainedMethod.Instantiation)
1592foreach (var type in _method.Instantiation)
Compiler\DependencyAnalysis\NodeFactory.cs (65)
143private static bool TypeCannotHaveEEType(TypeDesc type)
196_importedTypeSymbols = new NodeCache<TypeDesc, IEETypeNode>((TypeDesc type) =>
348_gvmTableEntries = new NodeCache<TypeDesc, TypeGVMEntriesNode>(type =>
373_reflectedDelegates = new NodeCache<TypeDesc, ReflectedDelegateNode>(type =>
388_reflectedTypes = new NodeCache<TypeDesc, ReflectedTypeNode>(type =>
429_interfaceUses = new NodeCache<TypeDesc, InterfaceUseNode>((TypeDesc type) =>
449_frozenMetadataRuntimeTypeNodes = new NodeCache<TypeDesc, FrozenRuntimeTypeNode>(key =>
454_frozenNecessaryRuntimeTypeNodes = new NodeCache<TypeDesc, FrozenRuntimeTypeNode>(key =>
464_interfaceDispatchMaps = new NodeCache<TypeDesc, InterfaceDispatchMapNode>((TypeDesc type) =>
469_sealedVtableNodes = new NodeCache<TypeDesc, SealedVTableNode>((TypeDesc type) =>
489_dataflowAnalyzedTypeDefinitions = new NodeCache<TypeDesc, DataflowAnalyzedTypeDefinitionNode>((TypeDesc type) =>
550_typeGenericDictionaries = new NodeCache<TypeDesc, TypeGenericDictionaryNode>(type =>
614_externalTypeMapRequests = new NodeCache<TypeDesc, ExternalTypeMapRequestNode>(type =>
619_proxyTypeMapRequests = new NodeCache<TypeDesc, ProxyTypeMapRequestNode>(type =>
647private IEETypeNode CreateNecessaryTypeNode(TypeDesc type)
671private IEETypeNode CreateMetadataTypeNode(TypeDesc type)
694private IEETypeNode CreateConstructedTypeNode(TypeDesc type)
722private abstract class TypeSymbolHashtable : LockFreeReaderHashtable<TypeDesc, IEETypeNode>
726protected override bool CompareKeyToValue(TypeDesc key, IEETypeNode value) => key == value.Type;
728protected override int GetKeyHashCode(TypeDesc key) => key.GetHashCode();
735protected override IEETypeNode CreateValueFromKey(TypeDesc key) => _factory.CreateNecessaryTypeNode(key);
741public IEETypeNode NecessaryTypeSymbol(TypeDesc type)
766protected override IEETypeNode CreateValueFromKey(TypeDesc key) => _factory.CreateMetadataTypeNode(key);
771public IEETypeNode MetadataTypeSymbol(TypeDesc type)
794protected override IEETypeNode CreateValueFromKey(TypeDesc key) => _factory.CreateConstructedTypeNode(key);
799public IEETypeNode ConstructedTypeSymbol(TypeDesc type)
816public IEETypeNode MaximallyConstructableType(TypeDesc type)
826public IEETypeNode MaximallyMetadataEnabledType(TypeDesc type)
834private NodeCache<TypeDesc, IEETypeNode> _importedTypeSymbols;
836private IEETypeNode ImportedEETypeSymbol(TypeDesc type)
919private NodeCache<TypeDesc, DataflowAnalyzedTypeDefinitionNode> _dataflowAnalyzedTypeDefinitions;
921public DataflowAnalyzedTypeDefinitionNode DataflowAnalyzedTypeDefinition(TypeDesc type)
962private NodeCache<TypeDesc, SealedVTableNode> _sealedVtableNodes;
964internal SealedVTableNode SealedVTable(TypeDesc type)
969private NodeCache<TypeDesc, InterfaceDispatchMapNode> _interfaceDispatchMaps;
971internal InterfaceDispatchMapNode InterfaceDispatchMap(TypeDesc type)
1038private sealed class VTableSliceHashtable : LockFreeReaderHashtable<TypeDesc, VTableSliceNode>
1042protected override bool CompareKeyToValue(TypeDesc key, VTableSliceNode value) => key == value.Type;
1044protected override VTableSliceNode CreateValueFromKey(TypeDesc key)
1051protected override int GetKeyHashCode(TypeDesc key) => key.GetHashCode();
1057public VTableSliceNode VTable(TypeDesc type)
1068private NodeCache<TypeDesc, TypeGenericDictionaryNode> _typeGenericDictionaries;
1069public TypeGenericDictionaryNode TypeGenericDictionary(TypeDesc type)
1217private NodeCache<TypeDesc, TypeGVMEntriesNode> _gvmTableEntries;
1218internal TypeGVMEntriesNode TypeGVMEntries(TypeDesc type)
1251private NodeCache<TypeDesc, ReflectedDelegateNode> _reflectedDelegates;
1252public ReflectedDelegateNode ReflectedDelegate(TypeDesc type)
1272private NodeCache<TypeDesc, ReflectedTypeNode> _reflectedTypes;
1273public ReflectedTypeNode ReflectedType(TypeDesc type)
1420private NodeCache<TypeDesc, InterfaceUseNode> _interfaceUses;
1422public DependencyNodeCore<NodeFactory> InterfaceUse(TypeDesc type)
1558private NodeCache<TypeDesc, FrozenRuntimeTypeNode> _frozenMetadataRuntimeTypeNodes;
1560public FrozenRuntimeTypeNode SerializedMetadataRuntimeTypeObject(TypeDesc type)
1565private NodeCache<TypeDesc, FrozenRuntimeTypeNode> _frozenNecessaryRuntimeTypeNodes;
1567public FrozenRuntimeTypeNode SerializedNecessaryRuntimeTypeObject(TypeDesc type)
1604private NodeCache<TypeDesc, ExternalTypeMapRequestNode> _externalTypeMapRequests;
1606public ExternalTypeMapRequestNode ExternalTypeMapRequest(TypeDesc type)
1611private NodeCache<TypeDesc, ProxyTypeMapRequestNode> _proxyTypeMapRequests;
1613public ProxyTypeMapRequestNode ProxyTypeMapRequest(TypeDesc type)
1718public Vertex EncodeReferenceToType(NativeWriter writer, TypeDesc type, ModuleDesc module)
Compiler\DependencyAnalysis\NodeFactory.GenericLookups.cs (30)
25_typeSymbols = new NodeCache<TypeDesc, GenericLookupResult>(type =>
30_necessaryTypeSymbols = new NodeCache<TypeDesc, GenericLookupResult>(type =>
35_metadataTypeSymbols = new NodeCache<TypeDesc, GenericLookupResult>(type =>
40_unwrapNullableSymbols = new NodeCache<TypeDesc, GenericLookupResult>(type =>
70_typeThreadStaticBaseIndexSymbols = new NodeCache<TypeDesc, GenericLookupResult>(type =>
75_typeGCStaticBaseSymbols = new NodeCache<TypeDesc, GenericLookupResult>(type =>
80_typeNonGCStaticBaseSymbols = new NodeCache<TypeDesc, GenericLookupResult>(type =>
85_objectAllocators = new NodeCache<TypeDesc, GenericLookupResult>(type =>
90_defaultCtors = new NodeCache<TypeDesc, GenericLookupResult>(type =>
101private NodeCache<TypeDesc, GenericLookupResult> _typeSymbols;
103public GenericLookupResult Type(TypeDesc type)
108private NodeCache<TypeDesc, GenericLookupResult> _necessaryTypeSymbols;
110public GenericLookupResult NecessaryType(TypeDesc type)
115private NodeCache<TypeDesc, GenericLookupResult> _metadataTypeSymbols;
117public GenericLookupResult MetadataType(TypeDesc type)
122private NodeCache<TypeDesc, GenericLookupResult> _unwrapNullableSymbols;
124public GenericLookupResult UnwrapNullableType(TypeDesc type)
154private NodeCache<TypeDesc, GenericLookupResult> _typeThreadStaticBaseIndexSymbols;
156public GenericLookupResult TypeThreadStaticBaseIndex(TypeDesc type)
161private NodeCache<TypeDesc, GenericLookupResult> _typeGCStaticBaseSymbols;
163public GenericLookupResult TypeGCStaticBase(TypeDesc type)
168private NodeCache<TypeDesc, GenericLookupResult> _typeNonGCStaticBaseSymbols;
170public GenericLookupResult TypeNonGCStaticBase(TypeDesc type)
196private NodeCache<TypeDesc, GenericLookupResult> _objectAllocators;
198public GenericLookupResult ObjectAllocator(TypeDesc type)
203private NodeCache<TypeDesc, GenericLookupResult> _defaultCtors;
205public GenericLookupResult DefaultCtorLookupResult(TypeDesc type)
211public GenericLookupResult ConstrainedMethodUse(MethodDesc constrainedMethod, TypeDesc constraintType, bool directCall)
221public ConstrainedMethodUseKey(MethodDesc constrainedMethod, TypeDesc constraintType, bool directCall)
229public readonly TypeDesc ConstraintType;
Compiler\DependencyAnalysis\NodeFactory.NativeLayout.cs (33)
30_typeSignatures = new NodeCache<TypeDesc, NativeLayoutTypeSignatureVertexNode>(type =>
70_templateTypeLayouts = new NodeCache<TypeDesc, NativeLayoutTemplateTypeLayoutVertexNode>(type =>
75_typeHandle_GenericDictionarySlots = new NodeCache<TypeDesc, NativeLayoutTypeHandleGenericDictionarySlotNode>(type =>
80_gcStatic_GenericDictionarySlots = new NodeCache<TypeDesc, NativeLayoutGcStaticsGenericDictionarySlotNode>(type =>
85_nonGcStatic_GenericDictionarySlots = new NodeCache<TypeDesc, NativeLayoutNonGcStaticsGenericDictionarySlotNode>(type =>
90_unwrapNullable_GenericDictionarySlots = new NodeCache<TypeDesc, NativeLayoutUnwrapNullableGenericDictionarySlotNode>(type =>
95_allocateObject_GenericDictionarySlots = new NodeCache<TypeDesc, NativeLayoutAllocateObjectGenericDictionarySlotNode>(type =>
100_threadStaticIndex_GenericDictionarySlots = new NodeCache<TypeDesc, NativeLayoutThreadStaticBaseIndexDictionarySlotNode>(type =>
105_defaultConstructor_GenericDictionarySlots = new NodeCache<TypeDesc, NativeLayoutDefaultConstructorGenericDictionarySlotNode>(type =>
156public IEnumerable<IDependencyNode> TemplateConstructableTypes(TypeDesc type)
161TypeDesc arrayCanonicalType = type.ConvertToCanonForm(CanonicalFormKind.Specific);
183foreach (var param in sig)
191TypeDesc canonicalType = type.ConvertToCanonForm(CanonicalFormKind.Specific);
201foreach (TypeDesc instantiationType in type.Instantiation)
208private NodeCache<TypeDesc, NativeLayoutTypeSignatureVertexNode> _typeSignatures;
209internal NativeLayoutTypeSignatureVertexNode TypeSignatureVertex(TypeDesc type)
333private NodeCache<TypeDesc, NativeLayoutTemplateTypeLayoutVertexNode> _templateTypeLayouts;
334public NativeLayoutTemplateTypeLayoutVertexNode TemplateTypeLayout(TypeDesc type)
339private NodeCache<TypeDesc, NativeLayoutTypeHandleGenericDictionarySlotNode> _typeHandle_GenericDictionarySlots;
340public NativeLayoutTypeHandleGenericDictionarySlotNode TypeHandleDictionarySlot(TypeDesc type)
345private NodeCache<TypeDesc, NativeLayoutGcStaticsGenericDictionarySlotNode> _gcStatic_GenericDictionarySlots;
346public NativeLayoutGcStaticsGenericDictionarySlotNode GcStaticDictionarySlot(TypeDesc type)
351private NodeCache<TypeDesc, NativeLayoutNonGcStaticsGenericDictionarySlotNode> _nonGcStatic_GenericDictionarySlots;
352public NativeLayoutNonGcStaticsGenericDictionarySlotNode NonGcStaticDictionarySlot(TypeDesc type)
357private NodeCache<TypeDesc, NativeLayoutUnwrapNullableGenericDictionarySlotNode> _unwrapNullable_GenericDictionarySlots;
358public NativeLayoutUnwrapNullableGenericDictionarySlotNode UnwrapNullableTypeDictionarySlot(TypeDesc type)
363private NodeCache<TypeDesc, NativeLayoutAllocateObjectGenericDictionarySlotNode> _allocateObject_GenericDictionarySlots;
364public NativeLayoutAllocateObjectGenericDictionarySlotNode AllocateObjectDictionarySlot(TypeDesc type)
369private NodeCache<TypeDesc, NativeLayoutThreadStaticBaseIndexDictionarySlotNode> _threadStaticIndex_GenericDictionarySlots;
370public NativeLayoutThreadStaticBaseIndexDictionarySlotNode ThreadStaticBaseIndexDictionarySlotNode(TypeDesc type)
375private NodeCache<TypeDesc, NativeLayoutDefaultConstructorGenericDictionarySlotNode> _defaultConstructor_GenericDictionarySlots;
376public NativeLayoutDefaultConstructorGenericDictionarySlotNode DefaultConstructorDictionarySlot(TypeDesc type)
471public NativeLayoutConstrainedMethodDictionarySlotNode ConstrainedMethodUse(MethodDesc constrainedMethod, TypeDesc constraintType, bool directCall)
Compiler\DescriptorMarker.cs (8)
106private void MarkAndPreserve(TypeDesc type, XPathNavigator nav, TypePreserve preserve)
176protected override void ProcessType(TypeDesc type, XPathNavigator nav)
236protected override void ProcessField(TypeDesc type, FieldDesc field, XPathNavigator nav)
241protected override void ProcessMethod(TypeDesc type, MethodDesc method, XPathNavigator nav, object? customData)
254private void ProcessMethodIfNotNull(TypeDesc type, MethodDesc method, XPathNavigator nav, object? customData)
262protected override MethodDesc? GetMethod(TypeDesc type, string signature)
272protected override void ProcessEvent(TypeDesc type, EventPseudoDesc @event, XPathNavigator nav, object? customData)
279protected override void ProcessProperty(TypeDesc type, PropertyPseudoDesc property, XPathNavigator nav, object? customData, bool fromSignature)
Compiler\ILScanner.cs (52)
296private readonly Dictionary<TypeDesc, MethodDesc[]> _vtableSlices = new Dictionary<TypeDesc, MethodDesc[]>();
319internal override VTableSliceNode GetSlice(TypeDesc type)
370var constructedTypeLookups = new HashSet<TypeDesc>();
371var metadataTypeLookups = new HashSet<TypeDesc>();
440if (methodOrType is TypeDesc type)
456private HashSet<TypeDesc> _constructedMethodTables = new HashSet<TypeDesc>();
457private HashSet<TypeDesc> _metadataMethodTables = new HashSet<TypeDesc>();
458private HashSet<TypeDesc> _reflectionVisibleGenericDefinitionMethodTables = new HashSet<TypeDesc>();
459private HashSet<TypeDesc> _canonConstructedMethodTables = new HashSet<TypeDesc>();
460private HashSet<TypeDesc> _canonConstructedTypes = new HashSet<TypeDesc>();
461private HashSet<TypeDesc> _unsealedTypes = new HashSet<TypeDesc>();
462private Dictionary<TypeDesc, HashSet<TypeDesc>> _implementators = new();
463private HashSet<TypeDesc> _disqualifiedTypes = new();
480var vtables = new Dictionary<TypeDesc, List<MethodDesc>>();
481var dynamicInterfaceCastableImplementationTargets = new HashSet<TypeDesc>();
501TypeDesc type = (node as ConstructedEETypeNode)?.Type;
506TypeDesc canonForm = type.ConvertToCanonForm(CanonicalFormKind.Specific);
576TypeDesc canonType = type.ConvertToCanonForm(CanonicalFormKind.Specific);
577TypeDesc baseType;
601static List<MethodDesc> BuildVTable(NodeFactory factory, TypeDesc currentType, TypeDesc implType, List<MethodDesc> vtable)
645private static bool CanAssumeWholeProgramViewOnTypeUse(NodeFactory factory, TypeDesc implementingType, DefType baseType)
676private void RecordImplementation(TypeDesc type, TypeDesc implType)
680HashSet<TypeDesc> implList;
689public override bool IsEffectivelySealed(TypeDesc type)
692TypeDesc canonType = type.ConvertToCanonForm(CanonicalFormKind.Specific);
751public override bool CanReferenceConstructedMethodTable(TypeDesc type)
758public override bool CanReferenceMetadataMethodTable(TypeDesc type)
765public override bool CanReferenceConstructedTypeOrCanonicalFormOfType(TypeDesc type)
772public override bool IsGenericDefinitionMethodTableReflectionVisible(TypeDesc type)
778public override TypeDesc[] GetImplementingClasses(TypeDesc type)
786if (_implementators.TryGetValue(type, out HashSet<TypeDesc> implementations))
788TypeDesc[] types;
792types = new TypeDesc[implementations.Count + 1];
797types = new TypeDesc[implementations.Count];
800foreach (TypeDesc implementation in implementations)
809public override bool CanHaveDynamicInterfaceImplementations(TypeDesc type) => _canHaveDynamicInterfaceImplementations;
814private readonly HashSet<TypeDesc> _constructedTypes = new HashSet<TypeDesc>();
825TypeDesc type = eetypeNode.Type;
941private readonly HashSet<TypeDesc> _canonFormsWithCctorChecks = new HashSet<TypeDesc>();
Compiler\Logging\DocumentationSignatureParser.cs (15)
55public static TypeDesc GetTypeByDocumentationSignature(IAssemblyDesc assembly, string signature)
61return results.Count == 0 ? null : (TypeDesc)results[0];
75private static string GetSignaturePart(TypeDesc type)
143TypeDesc containingType = null;
173Debug.Assert(result is TypeDesc);
175containingType = result as TypeDesc;
198public static void GetMatchingMembers(string id, ref int index, ModuleDesc module, TypeDesc containingType, string memberName, int arity, MemberType memberTypes, List<TypeSystemEntity> results, bool acceptName = false)
358typeParameterContext is TypeDesc
381var typeContext = typeParameterContext is MethodDesc methodContext
383: typeParameterContext as TypeDesc;
527private static void GetMatchingTypes(ModuleDesc module, TypeDesc declaringType, string name, int arity, List<TypeSystemEntity> results)
576private static void GetMatchingMethods(string id, ref int index, TypeDesc type, string memberName, int arity, List<TypeSystemEntity> results, bool acceptName = false)
633private static void GetMatchingProperties(string id, ref int index, TypeDesc typeDesc, string memberName, List<TypeSystemEntity> results, bool acceptName = false)
679private static void GetMatchingFields(TypeDesc type, string memberName, List<TypeSystemEntity> results)
691private static void GetMatchingEvents(TypeDesc typeDesc, string memberName, List<TypeSystemEntity> results)
Compiler\MetadataManager.cs (34)
22using CustomAttributeValue = System.Reflection.Metadata.CustomAttributeValue<Internal.TypeSystem.TypeDesc>;
70private readonly SortedSet<TypeDesc> _typesWithEETypesGenerated = new SortedSet<TypeDesc>(TypeSystemComparer.Instance);
71private readonly SortedSet<TypeDesc> _typesWithConstructedEETypesGenerated = new SortedSet<TypeDesc>(TypeSystemComparer.Instance);
82private readonly SortedSet<TypeDesc> _typeTemplates = new SortedSet<TypeDesc>(TypeSystemComparer.Instance);
86private readonly HashSet<TypeDesc> _usedInterfaces = new HashSet<TypeDesc>();
376public bool IsTypeInstantiationReflectionVisible(TypeDesc type)
384foreach (TypeDesc instArg in type.Instantiation)
403TypeDesc owningType = method.OwningType;
537TypeDesc owningCanonicalType = field.OwningType.ConvertToCanonForm(CanonicalFormKind.Specific);
571public virtual void GetDependenciesDueToEETypePresence(ref DependencyList dependencies, NodeFactory factory, TypeDesc type)
586protected virtual void GetMetadataDependenciesDueToReflectability(ref DependencyList dependencies, NodeFactory factory, TypeDesc type)
593public virtual void GetConditionalDependenciesDueToEETypePresence(ref CombinedDependencyList dependencies, NodeFactory factory, TypeDesc type, bool allocated)
599public virtual bool HasConditionalDependenciesDueToEETypePresence(TypeDesc type)
622public void GetDependenciesDueToDelegateCreation(ref DependencyList dependencies, NodeFactory factory, TypeDesc delegateType, MethodDesc target)
634public virtual void GetDependenciesDueToDelegateCreation(ref CombinedDependencyList dependencies, NodeFactory factory, TypeDesc delegateType, MethodDesc target)
836foreach (var type in factory.MetadataManager.GetTypesWithEETypes())
901TypeDesc canonOwningType = field.OwningType.ConvertToCanonForm(CanonicalFormKind.Specific);
949TypeDesc owningTypeToGenerateMetadataFor = methodToGenerateMetadataFor.OwningType;
1081internal bool HasConstructedEEType(TypeDesc type) => _typesWithConstructedEETypesGenerated.Contains(type);
1113public IEnumerable<TypeDesc> GetTypeTemplates()
1138public bool IsInterfaceUsed(TypeDesc type)
1149internal bool TypeGeneratesEEType(TypeDesc type)
1154internal IEnumerable<TypeDesc> GetTypesWithEETypes()
1159internal IEnumerable<TypeDesc> GetTypesWithConstructedEETypes()
1169public bool IsReflectionBlocked(TypeDesc type)
1177TypeDesc parameterType = ((ParameterizedType)type).ParameterType;
1196TypeDesc typeDefinition = type.GetTypeDefinition();
1214foreach (TypeDesc type in instantiation)
1296protected abstract MetadataCategory GetMetadataCategory(TypeDesc type);
1299public virtual void GetDependenciesDueToAccess(ref DependencyList dependencies, NodeFactory factory, MethodIL methodIL, TypeDesc accessedType)
Compiler\TypePreinit.cs (60)
44private readonly Dictionary<TypeDesc, RuntimeTypeValue> _internedTypes = new Dictionary<TypeDesc, RuntimeTypeValue>();
157private ForeignTypeInstance GetOrCreateForeignInstance(TypeDesc type, AllocationSite allocationSite, ReferenceTypeValue data)
231TypeDesc constrainedType = null;
273TypeDesc type = (TypeDesc)methodIL.GetObject(reader.ReadILToken());
291TypeDesc elementType = (TypeDesc)methodIL.GetObject(reader.ReadILToken());
497TypeDesc owningType = method.OwningType;
556TypeDesc owningType = ctor.OwningType;
662TypeDesc currentType = owningType;
670TypeDesc fieldType = field.FieldType;
993TypeDesc argType = GetArgType(methodIL.OwningMethod, index);
1013else if (token is TypeDesc type)
1079TypeDesc localType = localTypes[index].Type;
1131TypeDesc token = (TypeDesc)methodIL.GetObject(reader.ReadILToken());
1585TypeDesc elementType = opcode switch
1594_ => (TypeDesc)methodIL.GetObject(reader.ReadILToken()),
1636TypeDesc elementType = opcode switch
1648_ => (TypeDesc)methodIL.GetObject(reader.ReadILToken()),
1687TypeDesc type = (TypeDesc)methodIL.GetObject(reader.ReadILToken());
1711TypeDesc type = (TypeDesc)methodIL.GetObject(reader.ReadILToken());
1734TypeDesc type = opcode switch
1743_ /* ldobj */ => (TypeDesc)methodIL.GetObject(reader.ReadILToken()),
1771TypeDesc type = methodIL.GetObject(reader.ReadILToken()) as TypeDesc;
1806constrainedType = methodIL.GetObject(reader.ReadILToken()) as TypeDesc;
1846private static bool TryGetSpanElementType(TypeDesc type, bool isReadOnlySpan, out MetadataType elementType)
1862private static BaseValueTypeValue NewUninitializedLocationValue(TypeDesc locationType, FieldDesc fieldThatOwnsMemory)
1880else if (ComInterfaceEntryArrayValue.IsCompatible(locationType, out TypeDesc comInterfaceEntryType))
1971static bool IsSystemType(TypeDesc type)
1979private static TypeDesc GetArgType(MethodDesc method, int index)
2061public void PushFromLocation(TypeDesc locationType, Value value)
2105public Value PopIntoLocation(TypeDesc locationType)
2235TypeDesc Type { get; }
2328public ValueTypeValue(TypeDesc type)
2431public ComInterfaceEntryArrayValue(TypeDesc type, TypeDesc entryType)
2446private static bool IsComInterfaceEntryType(TypeDesc type)
2453public static bool IsCompatible(TypeDesc type, out TypeDesc entryType)
2622public static bool IsCompatible(TypeDesc type)
2739public override bool TryLoad(TypeDesc type, out Value value)
2850public TypeDesc Type { get; }
2852public RuntimeTypeHandleValue(TypeDesc type)
2885public TypeDesc TypeRepresented { get; }
2887public RuntimeTypeValue(TypeDesc type)
3078public virtual bool TryLoad(TypeDesc type, out Value value)
3145public override bool TryLoad(TypeDesc type, out Value value)
3177public TypeDesc Type { get; }
3179protected ReferenceTypeValue(TypeDesc type) { Type = type; }
3217public AllocatedReferenceTypeValue(TypeDesc type, AllocationSite allocationSite)
3254public DelegateInstance(TypeDesc delegateType, MethodDesc methodPointed, ReferenceTypeValue firstParameter, AllocationSite allocationSite)
3438public ForeignTypeInstance(TypeDesc type, AllocationSite allocationSite, ReferenceTypeValue data)
3477public StringInstance(TypeDesc stringType, string value)
3483private static byte[] ConstructStringInstance(TypeDesc stringType, ReadOnlySpan<char> value)
3561public bool TryUnboxAny(TypeDesc type, out Value value)
Compiler\UsageBasedMetadataManager.cs (25)
24using CustomAttributeValue = System.Reflection.Metadata.CustomAttributeValue<Internal.TypeSystem.TypeDesc>;
52private readonly List<TypeDesc> _typesWithForcedEEType = new List<TypeDesc>();
210protected override MetadataCategory GetMetadataCategory(TypeDesc type)
296protected override void GetMetadataDependenciesDueToReflectability(ref DependencyList dependencies, NodeFactory factory, TypeDesc type)
319TypeDesc elementType = ((ArrayType)type).ElementType;
367foreach (TypeDesc t in mdType.Module.GetAllTypes())
403public override void GetDependenciesDueToEETypePresence(ref DependencyList dependencies, NodeFactory factory, TypeDesc type)
410public override bool HasConditionalDependenciesDueToEETypePresence(TypeDesc type)
425public override void GetConditionalDependenciesDueToEETypePresence(ref CombinedDependencyList dependencies, NodeFactory factory, TypeDesc type, bool allocated)
562foreach (TypeDesc instArg in method.Instantiation)
570public override void GetDependenciesDueToDelegateCreation(ref CombinedDependencyList dependencies, NodeFactory factory, TypeDesc delegateType, MethodDesc target)
578TypeDesc canonDelegateType = delegateType.ConvertToCanonForm(CanonicalFormKind.Specific);
748TypeDesc fieldOwningTypeNormalized = fieldOwningType.NormalizeInstantiation();
767public override void GetDependenciesDueToAccess(ref DependencyList dependencies, NodeFactory factory, MethodIL methodIL, TypeDesc accessedType)
796public bool GeneratesAttributeMetadata(TypeDesc attributeType)
852var reflectableTypes = ReflectableEntityBuilder<TypeDesc>.Create();
860foreach (var constructedType in GetTypesWithEETypes())
868TypeDesc constructedTypeDefinition = constructedType.GetTypeDefinition();
1099public HashSet<TypeDesc> RemovedAttributes { get; }
1104RemovedAttributes = new HashSet<TypeDesc>();
1149private readonly HashSet<TypeDesc> _removedAttributes = new();
1158private void ProcessAttribute(TypeDesc type, XPathNavigator nav)
1174public static HashSet<TypeDesc> GetRemovedAttributes(Logger logger, TypeSystemContext context, Stream documentStream, ManifestResource resource, ModuleDesc resourceAssembly, string xmlDocumentLocation, IReadOnlyDictionary<string, bool> featureSwitchValues, bool globalAttributeRemoval)
1201protected override void ProcessType(TypeDesc type, XPathNavigator nav)
Compiler\UserDefinedTypeDescriptor.cs (42)
36public uint GetVariableTypeIndex(TypeDesc type)
44public uint GetStateMachineThisVariableTypeIndex(TypeDesc type)
118TypeDesc fieldType = GetFieldDebugType(fieldDesc);
160public uint GetThisTypeIndex(TypeDesc type)
245private static TypeDesc DebuggerCanonicalize(TypeDesc type)
253private uint GetVariableTypeIndex(TypeDesc type, bool needsCompleteIndex)
313public uint GetTypeIndex(TypeDesc type, bool needsCompleteType)
328private uint GetNewTypeIndex(TypeDesc type, bool needsCompleteType)
355private uint GetPointerTypeIndex(TypeDesc pointeeType)
377private uint GetByRefTypeIndex(TypeDesc pointeeType)
399private uint GetEnumTypeIndex(TypeDesc type)
431private uint GetArrayTypeIndex(TypeDesc type)
506private bool ShouldUseCanonicalTypeRecord(TypeDesc type)
511static int GetGenericDepth(TypeDesc type)
516foreach (TypeDesc instantiationType in type.Instantiation)
531private TypeDesc GetDebugType(TypeDesc type)
547private TypeDesc GetFieldDebugType(FieldDesc field)
552private uint GetClassTypeIndex(TypeDesc type, bool needsCompleteType)
554TypeDesc debugType = GetDebugType(type);
635TypeDesc fieldType = GetFieldDebugType(fieldDesc);
847private uint GetPrimitiveTypeIndex(TypeDesc type)
863private Dictionary<TypeDesc, uint> _knownTypes = new Dictionary<TypeDesc, uint>();
864private Dictionary<TypeDesc, uint> _completeKnownTypes = new Dictionary<TypeDesc, uint>();
865private Dictionary<TypeDesc, uint> _knownReferenceWrappedTypes = new Dictionary<TypeDesc, uint>();
866private Dictionary<TypeDesc, uint> _knownStateMachineThisTypes = new Dictionary<TypeDesc, uint>();
867private Dictionary<TypeDesc, uint> _pointerTypes = new Dictionary<TypeDesc, uint>();
868private Dictionary<TypeDesc, uint> _enumTypes = new Dictionary<TypeDesc, uint>();
869private Dictionary<TypeDesc, uint> _byRefTypes = new Dictionary<TypeDesc, uint>();
870private Dictionary<TypeDesc, uint> _thisTypes = new Dictionary<TypeDesc, uint>();
871private Dictionary<TypeDesc, uint> _primitiveTypes = new Dictionary<TypeDesc, uint>();
875public ICollection<KeyValuePair<TypeDesc, uint>> CompleteKnownTypes => _completeKnownTypes;
Compiler\VirtualMethodCallHelper.cs (9)
13public static int GetDefaultInterfaceMethodSlot(NodeFactory factory, MethodDesc method, TypeDesc implType, DefType interfaceOnDefinition, bool countDictionarySlots = true)
35public static int GetVirtualMethodSlot(NodeFactory factory, MethodDesc method, TypeDesc implType, bool countDictionarySlots = true)
62TypeDesc owningType = method.OwningType;
92private static int GetNumberOfSlotsInCurrentType(NodeFactory factory, TypeDesc implType, bool countDictionarySlots)
121private static int GetNumberOfBaseSlots(NodeFactory factory, TypeDesc owningType, bool countDictionarySlots)
125TypeDesc baseType = owningType.BaseType;
126TypeDesc templateBaseType = owningType.ConvertToCanonForm(CanonicalFormKind.Specific).BaseType;
181public static int GetGenericDictionarySlot(NodeFactory factory, TypeDesc type)
191public static bool HasGenericDictionarySlot(this TypeDesc type)
IL\ILImporter.Scanner.cs (50)
67private TypeDesc _constrained;
135TypeDesc owningType = _canonMethod.OwningType;
214private ISymbolNode GetGenericLookupHelper(ReadyToRunHelperId helperId, TypeDesc type)
274TypeDesc catchType = (TypeDesc)_methodIL.GetObject(region.ClassToken);
320TypeDesc type = (TypeDesc)_methodIL.GetObject(token);
613TypeDesc owningType = runtimeDeterminedMethod.OwningType;
667TypeDesc type = method.Instantiation[0];
724TypeDesc exactType = method.OwningType;
739TypeDesc constrained = _constrained;
834TypeDesc constraintForDelegate = !resolvedConstraint || forceUseRuntimeLookup ? _constrained : null;
1061TypeDesc canonDelegateType = ctorMethod.OwningType.ConvertToCanonForm(CanonicalFormKind.Specific);
1107TypeDesc awaiterType = runtimeDeterminedMethod.Instantiation[0];
1191TypeDesc typeEqualityCheckType = (TypeDesc)_canonMethodIL.GetObject(_typeEqualityPatternAnalyzer.Token1);
1211TypeDesc isinstCheckType = (TypeDesc)_canonMethodIL.GetObject(_isInstCheckPatternAnalyzer.Token);
1253TypeDesc type = (TypeDesc)_methodIL.GetObject(token);
1299_factory.MetadataManager.GetDependenciesDueToAccess(ref _dependencies, _factory, _methodIL, (TypeDesc)_canonMethodIL.GetObject(token));
1305var type = (TypeDesc)_methodIL.GetObject(token);
1320if (obj is TypeDesc type)
1339_factory.MetadataManager.GetDependenciesDueToAccess(ref _dependencies, _factory, _methodIL, (TypeDesc)_canonMethodIL.GetObject(token));
1419_constrained = (TypeDesc)_methodIL.GetObject(token);
1451TypeDesc canonFieldOwningType = fieldOwningType.ConvertToCanonForm(CanonicalFormKind.Specific);
1500TypeDesc owningType = field.OwningType;
1534var type = (TypeDesc)_methodIL.GetObject(token);
1550var type2 = (TypeDesc)_methodIL.GetObject(reader.ReadILToken());
1566type2 = (TypeDesc)_methodIL.GetObject(reader.ReadILToken());
1579private void AddBoxingDependencies(TypeDesc type, string reason)
1588TypeDesc typeForAccessCheck = type.IsRuntimeDeterminedSubtype ? type.ConvertToCanonForm(CanonicalFormKind.Specific) : type;
1617var elementType = (TypeDesc)_methodIL.GetObject(token);
1618_factory.MetadataManager.GetDependenciesDueToAccess(ref _dependencies, _factory, _methodIL, (TypeDesc)_canonMethodIL.GetObject(token));
1637private void ImportLoadElement(TypeDesc elementType)
1644ImportStoreElement((TypeDesc)_methodIL.GetObject(token));
1647private void ImportStoreElement(TypeDesc elementType)
1659TypeDesc elementType = (TypeDesc)_methodIL.GetObject(token);
2045TypeDesc taskReturnType = taskReturningMethod.Signature.ReturnType;
2053TypeDesc returnType = runtimeDeterminedCaller.Signature.ReturnType;
2057TypeDesc parameterType = isValueTask
2065TypeDesc signatureVariable = context.GetSignatureVariable(0, method: true);
2066TypeDesc parameterType = isValueTask
2109private static void ImportLoadIndirect(TypeDesc type) { }
2111private static void ImportStoreIndirect(TypeDesc type) { }
parent\parent\Common\Compiler\CompilerTypeSystemContext.Async.cs (16)
16public static IEnumerable<MethodDesc> GetAllMethodsAndAsyncVariants(this TypeDesc type)
55public override MethodDesc FindVirtualFunctionTargetMethodOnObjectType(MethodDesc targetMethod, TypeDesc objectType)
65public override DefaultInterfaceMethodResolution ResolveInterfaceMethodToDefaultImplementationOnType(MethodDesc interfaceMethod, TypeDesc currentType, out MethodDesc impl)
75public override MethodDesc ResolveInterfaceMethodToStaticVirtualMethodOnType(MethodDesc interfaceMethod, TypeDesc currentType)
84public override MethodDesc ResolveInterfaceMethodToVirtualMethodOnType(MethodDesc interfaceMethod, TypeDesc currentType)
93public override DefaultInterfaceMethodResolution ResolveVariantInterfaceMethodToDefaultImplementationOnType(MethodDesc interfaceMethod, TypeDesc currentType, out MethodDesc impl)
102public override MethodDesc ResolveVariantInterfaceMethodToStaticVirtualMethodOnType(MethodDesc interfaceMethod, TypeDesc currentType)
111public override MethodDesc ResolveVariantInterfaceMethodToVirtualMethodOnType(MethodDesc interfaceMethod, TypeDesc currentType)
121public override IEnumerable<MethodDesc> ComputeAllVirtualSlots(TypeDesc type)
180TypeDesc owningType = asyncVariantMethod.OwningType;
199TypeDesc owningType = taskReturningMethod.OwningType;
219TypeDesc owningType = returnDroppingThunk.OwningType;
251TypeDesc owningType = asyncVariantMethod.OwningType;
273public AsyncResumptionStub GetAsyncResumptionStub(MethodDesc targetMethod, TypeDesc owningType)
281public readonly TypeDesc OwningType;
283public AsyncResumptionStubKey(MethodDesc targetMethod, TypeDesc owningType)
parent\parent\Common\Compiler\CompilerTypeSystemContext.Wasm.cs (26)
16private readonly Dictionary<int, TypeDesc> _structsBySize = new Dictionary<int, TypeDesc>();
17private readonly Dictionary<int, TypeDesc> _alignedStructsBySize = new Dictionary<int, TypeDesc>();
18private readonly Dictionary<int, TypeDesc> _returnStructsBySize = new Dictionary<int, TypeDesc>();
19private volatile TypeDesc _cachedEmptyStruct;
20private volatile TypeDesc _wasmV128Type;
21private volatile TypeDesc _wasmInt128Type;
22private volatile TypeDesc _wasmV256Type;
23private volatile TypeDesc _wasmV512Type;
30public TypeDesc WasmV128Type
34TypeDesc type = _wasmV128Type;
56public TypeDesc GetWasmElevatedType(char slot, int elevation)
58TypeDesc type = (slot, elevation) switch
74TypeDesc InstantiateOverByte(ReadOnlySpan<byte> name) =>
83public TypeDesc CachedEmptyStruct => _cachedEmptyStruct;
88public void CacheEmptyStruct(TypeDesc type)
99public void CacheStruct(TypeDesc type, bool requiresAlignedSlot)
124public void CacheReturnStructBySize(TypeDesc type)
140public TypeDesc GetCachedReturnStructOfSize(int size)
144if (_returnStructsBySize.TryGetValue(size, out TypeDesc result))
153public TypeDesc GetCachedStructOfSize(int size)
157if (_structsBySize.TryGetValue(size, out TypeDesc result))
164public TypeDesc GetCachedAlignedStructOfSize(int size)
168if (_alignedStructsBySize.TryGetValue(size, out TypeDesc result))
parent\parent\Common\Compiler\Dataflow\DynamicallyAccessedMembersBinder.cs (16)
19public static IEnumerable<TypeSystemEntity> GetDynamicallyAccessedMembers(this TypeDesc typeDefinition, DynamicallyAccessedMemberTypes memberTypes, bool declaredOnly = false)
140public static IEnumerable<MethodDesc> GetConstructorsOnType(this TypeDesc type, Func<MethodDesc, bool> filter, BindingFlags? bindingFlags = null)
172public static IEnumerable<MethodDesc> GetMethodsOnTypeHierarchy(this TypeDesc type, Func<MethodDesc, bool> filter, BindingFlags? bindingFlags = null)
225public static IEnumerable<FieldDesc> GetFieldsOnTypeHierarchy(this TypeDesc type, Func<FieldDesc, bool> filter, BindingFlags? bindingFlags = BindingFlags.Default)
266public static IEnumerable<MetadataType> GetNestedTypesOnType(this TypeDesc type, Func<MetadataType, bool> filter, BindingFlags? bindingFlags = BindingFlags.Default)
292public static IEnumerable<PropertyPseudoDesc> GetPropertiesOnTypeHierarchy(this TypeDesc type, Func<PropertyPseudoDesc, bool> filter, BindingFlags? bindingFlags = BindingFlags.Default)
360public static IEnumerable<EventPseudoDesc> GetEventsOnTypeHierarchy(this TypeDesc type, Func<EventPseudoDesc, bool> filter, BindingFlags? bindingFlags = BindingFlags.Default)
430public static IEnumerable<DefType> GetAllInterfaceImplementations(this TypeDesc type, bool declaredOnly)
452public static void GetAllOnType(this TypeDesc type, bool declaredOnly, List<TypeSystemEntity> members) => GetAllOnType(type, declaredOnly, members, new HashSet<TypeDesc>());
454private static void GetAllOnType(TypeDesc type, bool declaredOnly, List<TypeSystemEntity> members, HashSet<TypeDesc> types)
503private static DefType TryGetBaseType(this TypeDesc type)
515private static IEnumerable<T> ApplyIncludeInherited<T>(this TypeDesc type, Func<TypeDesc, IEnumerable<T>> selector, bool includeBases)
529private static DefType[] TryGetExplicitlyImplementedInterfaces(this TypeDesc type)
parent\parent\Common\Compiler\ProcessLinkerXmlBase.cs (21)
240private void MatchType(TypeDesc type, Regex regex, XPathNavigator nav)
252foreach (TypeDesc type in assembly.GetAllTypes())
258protected abstract void ProcessType(TypeDesc type, XPathNavigator nav);
260protected void ProcessTypeChildren(TypeDesc type, XPathNavigator nav, object? customData = null)
271private void ProcessSelectedFields(XPathNavigator nav, TypeDesc type)
281protected virtual void ProcessField(TypeDesc type, XPathNavigator nav)
321protected static FieldDesc? GetField(TypeDesc type, string signature)
335protected virtual void ProcessField(TypeDesc type, FieldDesc field, XPathNavigator nav) { }
337private void ProcessSelectedMethods(XPathNavigator nav, TypeDesc type, object? customData)
347protected virtual void ProcessMethod(TypeDesc type, XPathNavigator nav, object? customData)
385protected virtual MethodDesc? GetMethod(TypeDesc type, string signature) => null;
387protected virtual void ProcessMethod(TypeDesc type, MethodDesc method, XPathNavigator nav, object? customData) { }
389private void ProcessSelectedEvents(XPathNavigator nav, TypeDesc type, object? customData)
399protected virtual void ProcessEvent(TypeDesc type, XPathNavigator nav, object? customData)
439protected static EventPseudoDesc? GetEvent(TypeDesc type, string signature)
447protected virtual void ProcessEvent(TypeDesc type, EventPseudoDesc @event, XPathNavigator nav, object? customData) { }
449private void ProcessSelectedProperties(XPathNavigator nav, TypeDesc type, object? customData)
459protected virtual void ProcessProperty(TypeDesc type, XPathNavigator nav, object? customData)
495protected static PropertyPseudoDesc? GetProperty(TypeDesc type, string signature)
503protected virtual void ProcessProperty(TypeDesc type, PropertyPseudoDesc property, XPathNavigator nav, object? customData, bool fromSignature) { }
615var parameter = type.Signature[i];
parent\parent\Common\Compiler\TypeExtensions.cs (45)
15public static bool IsSealed(this TypeDesc type)
30public static DefType GetClosestDefType(this TypeDesc type)
106public static bool IsCanonicalDefinitionType(this TypeDesc type, CanonicalFormKind kind)
114public static bool IsGenericDepthGreaterThan(this TypeDesc type, int depth)
119foreach (TypeDesc instantiationType in type.Instantiation)
138foreach (TypeDesc type in method.Instantiation)
151public static bool IsArrayTypeWithoutGenericInterfaces(this TypeDesc type)
157TypeDesc elementType = arrayType.ElementType;
161public static bool? CompareTypesForEquality(TypeDesc type1, TypeDesc type2)
177static bool AreGuaranteedToRepresentDifferentTypes(TypeDesc type1, TypeDesc type2)
227public static TypeDesc MergeTypesToCommonParent(TypeDesc ta, TypeDesc tb)
305for (TypeDesc searchType = ta; searchType != null; searchType = searchType.BaseType)
310for (TypeDesc searchType = tb; searchType != null; searchType = searchType.BaseType)
342private static TypeDesc MergeArrayTypesToCommonParent(ArrayType ta, ArrayType tb)
352TypeDesc taElem = ta.ElementType;
353TypeDesc tbElem = tb.ElementType;
356TypeDesc mergeElem;
394private static bool ImplementsEquivalentInterface(this TypeDesc type, TypeDesc interfaceType)
407public static MethodDesc TryResolveConstraintMethodApprox(this TypeDesc constrainedType, TypeDesc interfaceType, MethodDesc interfaceMethod, out bool forceRuntimeLookup)
419public static MethodDesc TryResolveConstraintMethodApprox(this TypeDesc constrainedType, TypeDesc interfaceType, MethodDesc interfaceMethod, out bool forceRuntimeLookup, ref DefaultInterfaceMethodResolution staticResolution)
438foreach (TypeDesc arg in methodInstantiation)
457TypeDesc interfaceTypeCanonical = interfaceType.ConvertToCanonForm(CanonicalFormKind.Specific);
504TypeDesc canonType = constrainedType.ConvertToCanonForm(CanonicalFormKind.Specific);
650private static TypeDesc MergeClassWithInterface(TypeDesc type, TypeDesc interfaceType)
678public static TypeDesc NormalizeInstantiation(this TypeDesc thisType)
688TypeDesc[] resultArray = new TypeDesc[inst.Length];
691TypeDesc instArg = GetTypeThatMeetsConstraints((GenericParameterDesc)inst[i], allowCanon);
700private static TypeDesc GetTypeThatMeetsConstraints(GenericParameterDesc genericParam, bool allowCanon)
716foreach (var c in genericParam.TypeConstraints)
732TypeDesc constrainedType = null;
733foreach (var c in genericParam.TypeConstraints)
756static bool HasStaticVirtualMethods(TypeDesc type)
773foreach (var arg in instantiation)
838TypeDesc firstFieldElementType = firstField.FieldType;
parent\parent\Common\Compiler\TypeMapMetadata.cs (41)
29public TypeWithSerializedName(TypeDesc type, string serializedName)
35public TypeDesc Type { get; }
79TypeDesc type,
81TypeDesc trimmingType,
92public TypeDesc Type { get; }
94public TypeDesc TrimmingType { get; }
101public ProxyTypeMapEntry(TypeDesc type, string serializedSourceTypeName, string serializedTypeName, ModuleDesc declaringModule)
109public TypeDesc Type { get; }
115private static TypeMapAttributeKind LookupTypeMapType(TypeDesc attrType)
138IReadOnlyDictionary<TypeDesc, ProxyTypeMapEntry> TypeMap { get; }
146private readonly TypeDesc _typeMapGroup;
149public ThrowingMethodStub(TypeDesc owningType, TypeDesc typeMapGroup, bool externalTypeMap, TypeSystemException ex)
179public override TypeDesc OwningType { get; }
186private readonly Dictionary<TypeDesc, ProxyTypeMapEntry> _associatedTypeMap = [];
192public Map(TypeDesc typeMapGroup)
197public TypeDesc TypeMapGroup { get; }
208TypeDesc type,
210TypeDesc associatedType,
223TypeDesc type,
225TypeDesc trimmingTarget,
271foreach (KeyValuePair<TypeDesc, ProxyTypeMapEntry> kvp in pendingMap._associatedTypeMap)
348IReadOnlyDictionary<TypeDesc, ProxyTypeMapEntry> IProxyTypeMap.TypeMap => _associatedTypeMap;
353public static readonly TypeMapMetadata Empty = new TypeMapMetadata(new Dictionary<TypeDesc, Map>(), "No type maps", null);
355private readonly IReadOnlyDictionary<TypeDesc, Map> _states;
357private TypeMapMetadata(IReadOnlyDictionary<TypeDesc, Map> states, string diagnosticName, ModuleDesc associatedModule)
366internal IEnumerable<KeyValuePair<TypeDesc, Map>> Maps => _states;
374Dictionary<TypeDesc, Map> typeMapStates = [];
378Dictionary<(EcmaAssembly assembly, TypeDesc typeMapGroup), (TypeDesc scannedDuringGroup, Map map)> pendingMaps = [];
379HashSet<(EcmaAssembly assembly, TypeDesc typeMapGroup)> scannedAssemblies = [];
381Queue<(EcmaAssembly assembly, TypeDesc typeMapGroup)> assembliesToScan = [];
386(EcmaAssembly currentAssembly, TypeDesc currentTypeMapGroup) = assembliesToScan.Dequeue();
430TypeDesc type = (TypeDesc)currentAssembly.GetObject(attributeType, NotFoundBehavior.ReturnNull);
445TypeDesc typeMapGroup = type.Instantiation[0];
566{ Value: TypeWithSerializedName { Type: TypeDesc targetType, SerializedName: string serializedTargetTypeName } }
582{ Value: TypeWithSerializedName { Type: TypeDesc targetType, SerializedName: string serializedTargetTypeName } },
583{ Value: TypeWithSerializedName { Type: TypeDesc trimTargetType, SerializedName: string serializedTrimTargetTypeName } }
608{ Value: TypeWithSerializedName { Type: TypeDesc type, SerializedName: string serializedTypeName } },
609{ Value: TypeWithSerializedName { Type: TypeDesc associatedType, SerializedName: string serializedAssociatedTypeName } }
parent\parent\Common\TypeSystem\Interop\IL\MarshalHelpers.Aot.cs (8)
13public static bool IsStructMarshallingRequired(TypeDesc typeDesc)
48internal static TypeDesc GetNativeMethodParameterType(TypeDesc type, MarshalAsDescriptor marshalAs, InteropStateManager interopStateManager, bool isReturn, bool isAnsi)
67internal static TypeDesc GetNativeStructFieldType(TypeDesc type, MarshalAsDescriptor marshalAs, InteropStateManager interopStateManager, bool isAnsi)
86internal static InlineArrayCandidate GetInlineArrayCandidate(TypeDesc managedElementType, MarshallerKind elementMarshallerKind, InteropStateManager interopStateManager, MarshalAsDescriptor marshalAs)
88TypeDesc nativeType = GetNativeTypeFromMarshallerKind(
125new TypeDesc[] { context.GetWellKnownType(WellKnownType.String) });
parent\parent\Common\TypeSystem\Interop\IL\Marshaller.Aot.cs (7)
409var managedElementType = ((ArrayType)ManagedType).ElementType;
489var managedElementType = ((ArrayType)ManagedType).ElementType;
771TypeDesc nativeStructType = InteropStateManager.GetStructMarshallingNativeType(ManagedType);
957var parameterType = this.ManagedParameterType;
963CustomAttributeValue<TypeDesc>? guidAttributeValue = (parameterType as EcmaType)?
983parameters: new TypeDesc[] { int32Type, int16Type, int16Type, byteType, byteType, byteType, byteType, byteType, byteType, byteType, byteType });
1220var marshallerType = MarshalAsDescriptor.MarshallerType;
parent\parent\Common\TypeSystem\Interop\IL\Marshaller.cs (35)
35public TypeDesc ManagedType;
36public TypeDesc ManagedParameterType;
39private TypeDesc _nativeType;
40private TypeDesc _nativeParamType;
46public TypeDesc NativeType
71public TypeDesc NativeParameterType
77TypeDesc nativeParamType = NativeType;
127public Home(ILLocalVariable var, TypeDesc type, bool isByRef)
134public Home(int argIndex, TypeDesc type, bool isByRef)
207private TypeDesc _type;
227public static Marshaller CreateMarshaller(TypeDesc parameterType,
338public static Marshaller CreateDisabledMarshaller(TypeDesc parameterType,
411TypeDesc parameterType = (i == 0) ? methodSig.ReturnType : methodSig[i - 1]; //first item is the return type
1098protected TypeDesc ManagedElementType
1108protected TypeDesc NativeElementType
1185var indexType = Marshallers[index].ManagedType;
1243TypeDesc nativeElementType = NativeElementType;
1279var elementType = ManagedElementType;
1298TypeDesc nativeElementType = NativeElementType;
1342var elementType = ManagedElementType;
1343var nativeElementType = NativeElementType;
1420var elementType = ManagedElementType;
1451var nativeElementType = NativeElementType;
1649TypeDesc charRefType = Context.GetWellKnownType(WellKnownType.Char).MakeByRefType();
1704new TypeDesc[] {
1823TypeDesc marshallerIn = MarshallerIn;
1841new TypeDesc[] { Context.GetWellKnownType(WellKnownType.Byte) });
1845new TypeDesc[] { Context.GetWellKnownType(WellKnownType.Void).MakePointerType(), Context.GetWellKnownType(WellKnownType.Int32) }))));
1897ManagedType.Context.GetWellKnownType(WellKnownType.Void), TypeDesc.EmptyTypes));
1953new TypeDesc[] { Context.GetWellKnownType(WellKnownType.Boolean).MakeByRefType() }))));
1958new MethodSignature(0, 0, Context.GetWellKnownType(WellKnownType.IntPtr), TypeDesc.EmptyTypes))));
1967new MethodSignature(0, 0, Context.GetWellKnownType(WellKnownType.Void), TypeDesc.EmptyTypes))));
2002new TypeDesc[] { Context.GetWellKnownType(WellKnownType.IntPtr) }))));
2062new TypeDesc[] { Context.GetSignatureVariable(0, method: true) }
2088new TypeDesc[] { Context.GetWellKnownType(WellKnownType.IntPtr) }
parent\parent\Common\TypeSystem\Interop\InteropTypes.cs (20)
72public static bool IsSafeHandle(TypeSystemContext context, TypeDesc type)
77public static bool IsCriticalHandle(TypeSystemContext context, TypeDesc type)
82private static bool IsCoreNamedType(TypeSystemContext context, TypeDesc type, ReadOnlySpan<byte> @namespace, ReadOnlySpan<byte> name)
90public static bool IsHandleRef(TypeSystemContext context, TypeDesc type)
95public static bool IsSystemDateTime(TypeSystemContext context, TypeDesc type)
100public static bool IsStringBuilder(TypeSystemContext context, TypeDesc type)
105public static bool IsSystemDecimal(TypeSystemContext context, TypeDesc type)
110public static bool IsSystemDelegate(TypeSystemContext context, TypeDesc type)
115public static bool IsSystemMulticastDelegate(TypeSystemContext context, TypeDesc type)
120public static bool IsSystemGuid(TypeSystemContext context, TypeDesc type)
125public static bool IsSystemArgIterator(TypeSystemContext context, TypeDesc type)
130public static bool IsSystemSpan(TypeSystemContext context, TypeDesc type)
135public static bool IsSystemReadOnlySpan(TypeSystemContext context, TypeDesc type)
140public static bool IsSystemNullable(TypeSystemContext context, TypeDesc type)
145public static bool IsSystemRuntimeIntrinsicsVector64T(TypeSystemContext context, TypeDesc type)
150public static bool IsSystemRuntimeIntrinsicsVector128T(TypeSystemContext context, TypeDesc type)
155public static bool IsSystemRuntimeIntrinsicsVector256T(TypeSystemContext context, TypeDesc type)
160public static bool IsSystemRuntimeIntrinsicsVector512T(TypeSystemContext context, TypeDesc type)
165public static bool IsSystemNumericsVectorT(TypeSystemContext context, TypeDesc type)
170private static bool IsOrDerivesFromType(TypeDesc type, MetadataType targetType)
Compiler\DependencyAnalysis\ReadyToRun\TypeValidationChecker.cs (25)
20private ConcurrentBag<(TypeDesc type, string reason)> _typeLoadValidationErrors = new ConcurrentBag<(TypeDesc type, string reason)>();
21private ConcurrentDictionary<TypeDesc, Task<bool>> _firstStageValidationChecks = new ConcurrentDictionary<TypeDesc, Task<bool>>();
22private ConcurrentDictionary<TypeDesc, (TypeDesc dependendOnType, string reason)[]> _crossTypeValidationDependencies = new ConcurrentDictionary<TypeDesc, (TypeDesc dependendOnType, string reason)[]>();
30Array.Sort(typeLoadValidationErrors, (ValueTuple<TypeDesc, string> left, ValueTuple<TypeDesc, string> right) =>
43private void AddTypeValidationError(TypeDesc type, string error)
105Task<bool> ValidateTypeWorkerHelper(TypeDesc typeToCheckForSkipValidation)
322foreach (var genericParameterType in method.Instantiation)
324foreach (var constraint in ((GenericParameterDesc)genericParameterType).TypeConstraints)
564HashSet<TypeDesc> constraintsOnDecl = new HashSet<TypeDesc>();
565foreach (var constraint in parameterOfDecl.TypeConstraints)
570foreach (var constraint in parameterOfImpl.TypeConstraints)
599Task<bool> ValidateTypeHelper(TypeDesc typeDesc)
643foreach (var type in functionPointerType.Signature)
653foreach (var type in instantiation)
668foreach (var type in genericParameter.TypeConstraints)
696static bool ValidateVarianceInType(Instantiation associatedTypeInstantiation, TypeDesc type, Internal.TypeSystem.GenericVariance position)
712var typeDef = instantiatedType.GetTypeDefinition();
716foreach (TypeDesc instType in instantiatedType.Instantiation)
Compiler\DependencyAnalysis\ReadyToRunCodegenNodeFactory.cs (15)
206private NodeCache<TypeDesc, AllMethodsOnTypeNode> _allMethodsOnType;
208public AllMethodsOnTypeNode AllMethodsOnType(TypeDesc type)
213private NodeCache<TypeDesc, InheritedVirtualMethodsNode> _inheritedVirtualMethods;
215private InheritedVirtualMethodsNode InheritedVirtualMethods(TypeDesc type)
227public void AddVirtualMethodDiscoveryDependencies(ref DependencyList dependencies, TypeDesc type)
392_allMethodsOnType = new NodeCache<TypeDesc, AllMethodsOnTypeNode>(type =>
397_inheritedVirtualMethods = new NodeCache<TypeDesc, InheritedVirtualMethodsNode>(type =>
425(TypeDesc)helperKey.Target));
436(TypeDesc)helperKey.Target));
794public readonly TypeDesc TypeDesc;
796public TypeFixupKey(ReadyToRunFixupKind fixupKind, TypeDesc typeDesc)
820public TypeFixupSignature TypeSignature(ReadyToRunFixupKind fixupKind, TypeDesc typeDesc)
830public readonly TypeDesc ImplType;
833public VirtualResolutionFixupSignatureFixupKey(ReadyToRunFixupKind fixupKind, MethodWithToken declMethod, TypeDesc implType, MethodWithToken implMethod)
865public VirtualResolutionFixupSignature VirtualResolutionFixupSignature(ReadyToRunFixupKind fixupKind, MethodWithToken declMethod, TypeDesc implType, MethodWithToken implMethod)
Compiler\ReadyToRunCodegenCompilation.cs (17)
123public bool IsEffectivelySealed(TypeDesc type)
133public MethodDesc ResolveVirtualMethod(MethodDesc declMethod, TypeDesc implType, out CORINFO_DEVIRTUALIZATION_DETAIL devirtualizationDetail)
328private ConcurrentDictionary<TypeDesc, bool> _computedFixedLayoutTypes = new ConcurrentDictionary<TypeDesc, bool>();
329private Func<TypeDesc, bool> _computedFixedLayoutTypesUncached;
610private bool IsLayoutFixedInCurrentVersionBubbleInternal(TypeDesc type)
644var fieldType = field.FieldType;
657public bool IsLayoutFixedInCurrentVersionBubble(TypeDesc type) =>
660public bool IsInheritanceChainLayoutFixedInCurrentVersionBubble(TypeDesc type)
981foreach (var type in method.Instantiation)
983foreach (var type in method.OwningType.Instantiation)
994TypeDesc asyncHelpers = TypeSystemContext.SystemModule.GetKnownType("System.Runtime.CompilerServices"u8, "AsyncHelpers"u8);
995TypeDesc[] requiredTypes = [asyncHelpers, continuation];
1006TypeDesc voidType = TypeSystemContext.GetWellKnownType(WellKnownType.Void);
1007TypeDesc taskType = TypeSystemContext.SystemModule.GetKnownType("System.Threading.Tasks"u8, "Task"u8);
1008TypeDesc valueTaskType = TypeSystemContext.SystemModule.GetKnownType("System.Threading.Tasks"u8, "ValueTask"u8);
1011TypeDesc methodVar = TypeSystemContext.GetSignatureVariable(0, method: true);
Compiler\ReadyToRunCompilationModuleGroupBase.cs (38)
42private Dictionary<TypeDesc, ModuleToken> _typeRefsInCompilationModuleSet;
48private readonly ConcurrentDictionary<TypeDesc, CompilationUnitSet> _layoutCompilationUnits = new ConcurrentDictionary<TypeDesc, CompilationUnitSet>();
49private readonly Func<TypeDesc, CompilationUnitSet> _layoutCompilationUnitsUncached;
50private readonly ConcurrentDictionary<TypeDesc, bool> _versionsWithTypeCache = new ConcurrentDictionary<TypeDesc, bool>();
51private readonly Func<TypeDesc, bool> _versionsWithTypeUncached;
52private readonly ConcurrentDictionary<TypeDesc, bool> _versionsWithTypeReferenceCache = new ConcurrentDictionary<TypeDesc, bool>();
53private readonly Func<TypeDesc, bool> _versionsWithTypeReferenceUncached;
58private readonly ConcurrentDictionary<TypeDesc, bool> _crossModuleInlineableTypeCache = new ConcurrentDictionary<TypeDesc, bool>();
59private readonly Func<TypeDesc, bool> _crossModuleInlineableTypeCacheUncached;
131public sealed override bool ContainsType(TypeDesc type)
155public CompilationUnitSet TypeLayoutCompilationUnits(TypeDesc type)
322private CompilationUnitSet TypeLayoutCompilationUnitsUncached(TypeDesc type)
348TypeDesc fieldType = field.FieldType;
384public sealed override bool VersionsWithType(TypeDesc typeDesc)
394public bool CrossModuleInlineableType(TypeDesc typeDesc)
400public sealed override bool VersionsWithTypeReference(TypeDesc typeDesc)
504foreach (var instArgFixed in inst)
506var instArg = instArgFixed;
565foreach (TypeDesc t in method.Instantiation)
572foreach (TypeDesc t in method.OwningType.Instantiation)
657TypeDesc type = methodIL.GetObject(token) as TypeDesc;
738public sealed override bool TryGetModuleTokenForExternalType(TypeDesc type, out ModuleToken token)
748var typeRefsInCompilationModuleSet = new Dictionary<TypeDesc, ModuleToken>();
757TypeDesc typeFromTypeRef = ecmaModule.GetType(typeRefHandle);
780private bool ComputeTypeVersionsWithCode(TypeDesc type)
807private bool ComputeCrossModuleInlineableType(TypeDesc type)
824private bool ComputeTypeReferenceVersionsWithCode(TypeDesc type)
879foreach (TypeDesc instParam in type.Instantiation)
892private static bool ComputeInstantiationVersionsWithCode(Instantiation inst, TypeSystemEntity entityWithInstantiation, Func<TypeDesc, bool> versionsWithTypePredicate)
896TypeDesc instType = inst[iInstantiation];
906if (entityWithInstantiation is TypeDesc type)
944static bool ComputeInstantiationTypeVersionsWithCode(Func<TypeDesc, bool> versionsWithTypePredicate, TypeDesc type)
IBC\IBCProfileParser.cs (12)
465private TypeDesc GetSigTypeFromIBCZapSig(IBCModule ibcModule, EcmaModule ecmaModule, BlobReader sig)
528TypeDesc[] typeArgs = new TypeDesc[numTypeArgs];
531TypeDesc nextTypeArg = GetSigTypeFromIBCZapSig(ibcModule, ecmaModule, sig);
545TypeDesc arrayElementType = GetSigTypeFromIBCZapSig(ibcModule, ecmaModule, sig);
553TypeDesc arrayElementType = GetSigTypeFromIBCZapSig(ibcModule, ecmaModule, sig);
566TypeDesc byRefToType = GetSigTypeFromIBCZapSig(ibcModule, ecmaModule, sig);
574TypeDesc pointerToType = GetSigTypeFromIBCZapSig(ibcModule, ecmaModule, sig);
704TypeDesc methodType = GetSigTypeFromIBCZapSig(ibcModule, ibcModule.EcmaModule, sig);
749List<TypeDesc> instantiationArguments = new List<TypeDesc>();
752TypeDesc instantiationType = GetSigTypeFromIBCZapSig(ibcModule, ibcModule.EcmaModule, sig);
JitInterface\CorInfoImpl.ReadyToRun.cs (80)
145public readonly TypeDesc ConstrainedType;
148public readonly TypeDesc OwningType;
150public MethodWithToken(MethodDesc method, ModuleToken token, TypeDesc constrainedType, bool unboxing, TypeSystemEntity genericContextObject, TypeDesc devirtualizedMethodOwner = null, bool forceOwningTypeFromMethodDesc = false)
153Debug.Assert(genericContextObject is null or MethodDesc or TypeDesc);
169private static TypeDesc GetMethodTokenOwningType(MethodWithToken methodToken, TypeDesc constrainedType, TypeSystemEntity genericContextObject, TypeDesc devirtualizedMethodOwner, out bool owningTypeNotDerivedFromToken)
204static TypeDesc HandleContext(IEcmaModule module, EntityHandle handle, TypeDesc methodTargetOwner, TypeDesc constrainedType, TypeSystemEntity genericContextObject, TypeDesc devirtualizedMethodOwner, ref bool owningTypeNotDerivedFromToken)
206var tokenOnlyOwningType = module.GetType(handle);
207TypeDesc actualOwningType;
225TypeDesc typeContext = (TypeDesc)genericContextObject;
229TypeDesc instantiatedOwningType = null;
236TypeDesc currentType = devirtualizedMethodOwner;
259var canonicalizedOwningType = instantiatedOwningType.ConvertToCanonForm(CanonicalFormKind.Specific);
269TypeDesc ComputeActualOwningType(TypeDesc methodTargetOwner, TypeDesc instantiatedOwningType, TypeDesc canonicalizedOwningType)
281var currentType = canonicalizedOwningType;
438public TypeDesc ContextType { get { return (Context is MethodDesc contextAsMethod ? contextAsMethod.OwningType : (TypeDesc)Context); } }
487private Dictionary<TypeDesc, bool> _preInitedTypes = new Dictionary<TypeDesc, bool>();
600List<TypeDesc> compExactlyDependsOnList = null;
626TypeDesc typeForBypass = fixedArguments[0].Value as TypeDesc;
630compExactlyDependsOnList = new List<TypeDesc>();
646foreach (var intrinsicType in compExactlyDependsOnList)
906var type = HandleToObject(pResolvedToken.hClass);
916var type = HandleToObject(pResolvedToken.hClass);
926var type = HandleToObject(pResolvedToken.hClass);
939var type = HandleToObject(pResolvedToken.hClass);
955var type = HandleToObject(pResolvedToken.hClass);
977TypeDesc delegateTypeDesc = HandleToObject(delegateType);
984TypeDesc constrainedType = null;
988constrainedType = (TypeDesc)ResolveTokenInScope(methodIL, typeOrMethodContext, targetConstraint);
1368private MethodWithToken ComputeMethodWithToken(MethodDesc method, ref CORINFO_RESOLVED_TOKEN pResolvedToken, TypeDesc constrainedType, bool unboxing)
1372TypeDesc devirtualizedMethodOwner = null;
1383ModuleToken _HandleToModuleToken(ref CORINFO_RESOLVED_TOKEN pResolvedToken, MethodDesc methodDesc, out TypeSystemEntity context, ref TypeDesc constrainedType, out bool strippedInstantiation)
1514case TypeDesc typeDesc:
1569&& ((TypeDesc)ResolveTokenInScope(_compilation.GetMethodIL(MethodBeingCompiled), MethodBeingCompiled, (mdToken)classTokenOrOffset)).IsWellKnownType(WellKnownType.Exception))
1637TypeDesc type = HandleToObject(classHandle);
1658private bool IsClassPreInited(TypeDesc type)
1665var uninstantiatedType = type.GetTypeDefinition();
1676static bool ComputeIsClassPreInited(TypeDesc type)
1694static bool IsDynamicStaticsOrHasBoxedRegularStatics(TypeDesc type)
1727foreach (TypeDesc instantiationType in instantiation)
1902private static bool IsTypeSpecForTypicalInstantiation(TypeDesc t)
1922out TypeDesc constrainedType,
1924out TypeDesc exactType,
1937TypeDesc type = HandleToObject(pResolvedToken.hClass);
2410foreach (TypeDesc type in method.Signature)
2421TypeDesc type = HandleToObject(cls);
2425private void classMustBeLoadedBeforeCodeIsRun(TypeDesc type)
2436foreach (TypeDesc t in methodSig)
2477TypeDesc constrainedType;
2479TypeDesc exactType;
2695private bool CanEncodeTypeInSignature(TypeDesc type)
2719foreach (TypeDesc instantiationArgument in type.Instantiation)
2726TypeDesc typeDefinition = type.GetTypeDefinition();
2785TypeDesc constrainedType = null;
2810constrainedType = (TypeDesc)GetRuntimeDeterminedObjectForToken(ref *pConstrainedResolvedToken);
2856helperArg is TypeDesc typeDesc &&
2900TypeDesc td = HandleToObject(pResolvedToken.hClass);
2915TypeDesc td = HandleToObject(pResolvedToken.hClass);
2924TypeDesc td = HandleToObject(pResolvedToken.hClass);
2984TypeDesc type = HandleToObject(handle);
3028TypeDesc typeHandleType = HandleToObject(pResolvedToken.hClass);
3051TypeDesc td = HandleToObject(pResolvedToken.hClass);
3096private bool NeedsTypeLayoutCheck(TypeDesc type)
3123TypeDesc pMT = field.OwningType;
3538TypeDesc clauseType = (TypeDesc)ResolveTokenInScope(methodIL, MethodBeingCompiled, classToken);
3754foreach (var type in signature)
3760void ValidateSafetyOfUsingTypeEquivalenceOfType(TypeDesc type)
parent\parent\Common\Compiler\CompilerTypeSystemContext.Async.cs (16)
16public static IEnumerable<MethodDesc> GetAllMethodsAndAsyncVariants(this TypeDesc type)
55public override MethodDesc FindVirtualFunctionTargetMethodOnObjectType(MethodDesc targetMethod, TypeDesc objectType)
65public override DefaultInterfaceMethodResolution ResolveInterfaceMethodToDefaultImplementationOnType(MethodDesc interfaceMethod, TypeDesc currentType, out MethodDesc impl)
75public override MethodDesc ResolveInterfaceMethodToStaticVirtualMethodOnType(MethodDesc interfaceMethod, TypeDesc currentType)
84public override MethodDesc ResolveInterfaceMethodToVirtualMethodOnType(MethodDesc interfaceMethod, TypeDesc currentType)
93public override DefaultInterfaceMethodResolution ResolveVariantInterfaceMethodToDefaultImplementationOnType(MethodDesc interfaceMethod, TypeDesc currentType, out MethodDesc impl)
102public override MethodDesc ResolveVariantInterfaceMethodToStaticVirtualMethodOnType(MethodDesc interfaceMethod, TypeDesc currentType)
111public override MethodDesc ResolveVariantInterfaceMethodToVirtualMethodOnType(MethodDesc interfaceMethod, TypeDesc currentType)
121public override IEnumerable<MethodDesc> ComputeAllVirtualSlots(TypeDesc type)
180TypeDesc owningType = asyncVariantMethod.OwningType;
199TypeDesc owningType = taskReturningMethod.OwningType;
219TypeDesc owningType = returnDroppingThunk.OwningType;
251TypeDesc owningType = asyncVariantMethod.OwningType;
273public AsyncResumptionStub GetAsyncResumptionStub(MethodDesc targetMethod, TypeDesc owningType)
281public readonly TypeDesc OwningType;
283public AsyncResumptionStubKey(MethodDesc targetMethod, TypeDesc owningType)
parent\parent\Common\Compiler\CompilerTypeSystemContext.Wasm.cs (26)
16private readonly Dictionary<int, TypeDesc> _structsBySize = new Dictionary<int, TypeDesc>();
17private readonly Dictionary<int, TypeDesc> _alignedStructsBySize = new Dictionary<int, TypeDesc>();
18private readonly Dictionary<int, TypeDesc> _returnStructsBySize = new Dictionary<int, TypeDesc>();
19private volatile TypeDesc _cachedEmptyStruct;
20private volatile TypeDesc _wasmV128Type;
21private volatile TypeDesc _wasmInt128Type;
22private volatile TypeDesc _wasmV256Type;
23private volatile TypeDesc _wasmV512Type;
30public TypeDesc WasmV128Type
34TypeDesc type = _wasmV128Type;
56public TypeDesc GetWasmElevatedType(char slot, int elevation)
58TypeDesc type = (slot, elevation) switch
74TypeDesc InstantiateOverByte(ReadOnlySpan<byte> name) =>
83public TypeDesc CachedEmptyStruct => _cachedEmptyStruct;
88public void CacheEmptyStruct(TypeDesc type)
99public void CacheStruct(TypeDesc type, bool requiresAlignedSlot)
124public void CacheReturnStructBySize(TypeDesc type)
140public TypeDesc GetCachedReturnStructOfSize(int size)
144if (_returnStructsBySize.TryGetValue(size, out TypeDesc result))
153public TypeDesc GetCachedStructOfSize(int size)
157if (_structsBySize.TryGetValue(size, out TypeDesc result))
164public TypeDesc GetCachedAlignedStructOfSize(int size)
168if (_alignedStructsBySize.TryGetValue(size, out TypeDesc result))
parent\parent\Common\Compiler\Dataflow\DynamicallyAccessedMembersBinder.cs (16)
19public static IEnumerable<TypeSystemEntity> GetDynamicallyAccessedMembers(this TypeDesc typeDefinition, DynamicallyAccessedMemberTypes memberTypes, bool declaredOnly = false)
140public static IEnumerable<MethodDesc> GetConstructorsOnType(this TypeDesc type, Func<MethodDesc, bool> filter, BindingFlags? bindingFlags = null)
172public static IEnumerable<MethodDesc> GetMethodsOnTypeHierarchy(this TypeDesc type, Func<MethodDesc, bool> filter, BindingFlags? bindingFlags = null)
225public static IEnumerable<FieldDesc> GetFieldsOnTypeHierarchy(this TypeDesc type, Func<FieldDesc, bool> filter, BindingFlags? bindingFlags = BindingFlags.Default)
266public static IEnumerable<MetadataType> GetNestedTypesOnType(this TypeDesc type, Func<MetadataType, bool> filter, BindingFlags? bindingFlags = BindingFlags.Default)
292public static IEnumerable<PropertyPseudoDesc> GetPropertiesOnTypeHierarchy(this TypeDesc type, Func<PropertyPseudoDesc, bool> filter, BindingFlags? bindingFlags = BindingFlags.Default)
360public static IEnumerable<EventPseudoDesc> GetEventsOnTypeHierarchy(this TypeDesc type, Func<EventPseudoDesc, bool> filter, BindingFlags? bindingFlags = BindingFlags.Default)
430public static IEnumerable<DefType> GetAllInterfaceImplementations(this TypeDesc type, bool declaredOnly)
452public static void GetAllOnType(this TypeDesc type, bool declaredOnly, List<TypeSystemEntity> members) => GetAllOnType(type, declaredOnly, members, new HashSet<TypeDesc>());
454private static void GetAllOnType(TypeDesc type, bool declaredOnly, List<TypeSystemEntity> members, HashSet<TypeDesc> types)
503private static DefType TryGetBaseType(this TypeDesc type)
515private static IEnumerable<T> ApplyIncludeInherited<T>(this TypeDesc type, Func<TypeDesc, IEnumerable<T>> selector, bool includeBases)
529private static DefType[] TryGetExplicitlyImplementedInterfaces(this TypeDesc type)
parent\parent\Common\Compiler\ProcessLinkerXmlBase.cs (21)
240private void MatchType(TypeDesc type, Regex regex, XPathNavigator nav)
252foreach (TypeDesc type in assembly.GetAllTypes())
258protected abstract void ProcessType(TypeDesc type, XPathNavigator nav);
260protected void ProcessTypeChildren(TypeDesc type, XPathNavigator nav, object? customData = null)
271private void ProcessSelectedFields(XPathNavigator nav, TypeDesc type)
281protected virtual void ProcessField(TypeDesc type, XPathNavigator nav)
321protected static FieldDesc? GetField(TypeDesc type, string signature)
335protected virtual void ProcessField(TypeDesc type, FieldDesc field, XPathNavigator nav) { }
337private void ProcessSelectedMethods(XPathNavigator nav, TypeDesc type, object? customData)
347protected virtual void ProcessMethod(TypeDesc type, XPathNavigator nav, object? customData)
385protected virtual MethodDesc? GetMethod(TypeDesc type, string signature) => null;
387protected virtual void ProcessMethod(TypeDesc type, MethodDesc method, XPathNavigator nav, object? customData) { }
389private void ProcessSelectedEvents(XPathNavigator nav, TypeDesc type, object? customData)
399protected virtual void ProcessEvent(TypeDesc type, XPathNavigator nav, object? customData)
439protected static EventPseudoDesc? GetEvent(TypeDesc type, string signature)
447protected virtual void ProcessEvent(TypeDesc type, EventPseudoDesc @event, XPathNavigator nav, object? customData) { }
449private void ProcessSelectedProperties(XPathNavigator nav, TypeDesc type, object? customData)
459protected virtual void ProcessProperty(TypeDesc type, XPathNavigator nav, object? customData)
495protected static PropertyPseudoDesc? GetProperty(TypeDesc type, string signature)
503protected virtual void ProcessProperty(TypeDesc type, PropertyPseudoDesc property, XPathNavigator nav, object? customData, bool fromSignature) { }
615var parameter = type.Signature[i];
parent\parent\Common\Compiler\TypeExtensions.cs (45)
15public static bool IsSealed(this TypeDesc type)
30public static DefType GetClosestDefType(this TypeDesc type)
106public static bool IsCanonicalDefinitionType(this TypeDesc type, CanonicalFormKind kind)
114public static bool IsGenericDepthGreaterThan(this TypeDesc type, int depth)
119foreach (TypeDesc instantiationType in type.Instantiation)
138foreach (TypeDesc type in method.Instantiation)
151public static bool IsArrayTypeWithoutGenericInterfaces(this TypeDesc type)
157TypeDesc elementType = arrayType.ElementType;
161public static bool? CompareTypesForEquality(TypeDesc type1, TypeDesc type2)
177static bool AreGuaranteedToRepresentDifferentTypes(TypeDesc type1, TypeDesc type2)
227public static TypeDesc MergeTypesToCommonParent(TypeDesc ta, TypeDesc tb)
305for (TypeDesc searchType = ta; searchType != null; searchType = searchType.BaseType)
310for (TypeDesc searchType = tb; searchType != null; searchType = searchType.BaseType)
342private static TypeDesc MergeArrayTypesToCommonParent(ArrayType ta, ArrayType tb)
352TypeDesc taElem = ta.ElementType;
353TypeDesc tbElem = tb.ElementType;
356TypeDesc mergeElem;
394private static bool ImplementsEquivalentInterface(this TypeDesc type, TypeDesc interfaceType)
407public static MethodDesc TryResolveConstraintMethodApprox(this TypeDesc constrainedType, TypeDesc interfaceType, MethodDesc interfaceMethod, out bool forceRuntimeLookup)
419public static MethodDesc TryResolveConstraintMethodApprox(this TypeDesc constrainedType, TypeDesc interfaceType, MethodDesc interfaceMethod, out bool forceRuntimeLookup, ref DefaultInterfaceMethodResolution staticResolution)
438foreach (TypeDesc arg in methodInstantiation)
457TypeDesc interfaceTypeCanonical = interfaceType.ConvertToCanonForm(CanonicalFormKind.Specific);
504TypeDesc canonType = constrainedType.ConvertToCanonForm(CanonicalFormKind.Specific);
650private static TypeDesc MergeClassWithInterface(TypeDesc type, TypeDesc interfaceType)
678public static TypeDesc NormalizeInstantiation(this TypeDesc thisType)
688TypeDesc[] resultArray = new TypeDesc[inst.Length];
691TypeDesc instArg = GetTypeThatMeetsConstraints((GenericParameterDesc)inst[i], allowCanon);
700private static TypeDesc GetTypeThatMeetsConstraints(GenericParameterDesc genericParam, bool allowCanon)
716foreach (var c in genericParam.TypeConstraints)
732TypeDesc constrainedType = null;
733foreach (var c in genericParam.TypeConstraints)
756static bool HasStaticVirtualMethods(TypeDesc type)
773foreach (var arg in instantiation)
838TypeDesc firstFieldElementType = firstField.FieldType;
parent\parent\Common\Compiler\TypeMapMetadata.cs (41)
29public TypeWithSerializedName(TypeDesc type, string serializedName)
35public TypeDesc Type { get; }
79TypeDesc type,
81TypeDesc trimmingType,
92public TypeDesc Type { get; }
94public TypeDesc TrimmingType { get; }
101public ProxyTypeMapEntry(TypeDesc type, string serializedSourceTypeName, string serializedTypeName, ModuleDesc declaringModule)
109public TypeDesc Type { get; }
115private static TypeMapAttributeKind LookupTypeMapType(TypeDesc attrType)
138IReadOnlyDictionary<TypeDesc, ProxyTypeMapEntry> TypeMap { get; }
146private readonly TypeDesc _typeMapGroup;
149public ThrowingMethodStub(TypeDesc owningType, TypeDesc typeMapGroup, bool externalTypeMap, TypeSystemException ex)
179public override TypeDesc OwningType { get; }
186private readonly Dictionary<TypeDesc, ProxyTypeMapEntry> _associatedTypeMap = [];
192public Map(TypeDesc typeMapGroup)
197public TypeDesc TypeMapGroup { get; }
208TypeDesc type,
210TypeDesc associatedType,
223TypeDesc type,
225TypeDesc trimmingTarget,
271foreach (KeyValuePair<TypeDesc, ProxyTypeMapEntry> kvp in pendingMap._associatedTypeMap)
348IReadOnlyDictionary<TypeDesc, ProxyTypeMapEntry> IProxyTypeMap.TypeMap => _associatedTypeMap;
353public static readonly TypeMapMetadata Empty = new TypeMapMetadata(new Dictionary<TypeDesc, Map>(), "No type maps", null);
355private readonly IReadOnlyDictionary<TypeDesc, Map> _states;
357private TypeMapMetadata(IReadOnlyDictionary<TypeDesc, Map> states, string diagnosticName, ModuleDesc associatedModule)
366internal IEnumerable<KeyValuePair<TypeDesc, Map>> Maps => _states;
374Dictionary<TypeDesc, Map> typeMapStates = [];
378Dictionary<(EcmaAssembly assembly, TypeDesc typeMapGroup), (TypeDesc scannedDuringGroup, Map map)> pendingMaps = [];
379HashSet<(EcmaAssembly assembly, TypeDesc typeMapGroup)> scannedAssemblies = [];
381Queue<(EcmaAssembly assembly, TypeDesc typeMapGroup)> assembliesToScan = [];
386(EcmaAssembly currentAssembly, TypeDesc currentTypeMapGroup) = assembliesToScan.Dequeue();
430TypeDesc type = (TypeDesc)currentAssembly.GetObject(attributeType, NotFoundBehavior.ReturnNull);
445TypeDesc typeMapGroup = type.Instantiation[0];
566{ Value: TypeWithSerializedName { Type: TypeDesc targetType, SerializedName: string serializedTargetTypeName } }
582{ Value: TypeWithSerializedName { Type: TypeDesc targetType, SerializedName: string serializedTargetTypeName } },
583{ Value: TypeWithSerializedName { Type: TypeDesc trimTargetType, SerializedName: string serializedTrimTargetTypeName } }
608{ Value: TypeWithSerializedName { Type: TypeDesc type, SerializedName: string serializedTypeName } },
609{ Value: TypeWithSerializedName { Type: TypeDesc associatedType, SerializedName: string serializedAssociatedTypeName } }
parent\parent\Common\JitInterface\CorInfoImpl.cs (92)
306TypeDesc type = (TypeDesc)handleToObject[likelyClassMethods->handle];
794private TypeDesc HandleToObject(CORINFO_CLASS_STRUCT_* type) => (TypeDesc)HandleToObject((void*)type);
795private CORINFO_CLASS_STRUCT_* ObjectToHandle(TypeDesc type) => (CORINFO_CLASS_STRUCT_*)ObjectToHandle((object)type);
933TypeDesc returnType = signature.ReturnType;
986private CorInfoType asCorInfoType(TypeDesc type)
991private CorInfoType asCorInfoType(TypeDesc type, out TypeDesc typeIfNotPrimitive)
1039private CorInfoType asCorInfoType(TypeDesc type, CORINFO_CLASS_STRUCT_** structType)
1041var corInfoType = asCorInfoType(type, out TypeDesc typeIfNotPrimitive);
1051private CORINFO_CONTEXT_STRUCT* contextFromType(TypeDesc type)
1078private TypeDesc typeFromContext(CORINFO_CONTEXT_STRUCT* contextStruct)
1137CustomAttributeValue<TypeDesc> value = reader.GetCustomAttribute(handle).DecodeValue(new CustomAttributeTypeProvider(module));
1301TypeDesc type = HandleToObject(memberParent);
1455TypeDesc objType = HandleToObject(info->objClass);
1471TypeDesc ownerTypeDesc = typeFromContext(info->context);
1499TypeDesc owningType = originalImpl.OwningType;
1733TypeDesc comparand = HandleToObject(elemType);
1734TypeDesc comparer = IL.Stubs.ComparerIntrinsics.GetComparerForType(comparand);
1740TypeDesc comparand = HandleToObject(elemType);
1741TypeDesc comparer = IL.Stubs.ComparerIntrinsics.GetEqualityComparerForType(comparand);
1747TypeDesc elementType = HandleToObject(elemType);
1758TypeDesc type = HandleToObject(classHnd);
1880result = ((TypeDesc)result).InstantiateSignature(typeInst, methodInst);
1902if (typeOrMethodContext is TypeDesc typeContext)
1949result = ((TypeDesc)result).MakeArrayType();
1981TypeDesc type = (TypeDesc)result;
1986Debug.Assert(((TypeDesc)result).IsRuntimeDeterminedSubtype ||
1990((TypeDesc)methodIL.GetMethodILScopeDefinition().GetObject((int)token)).IsCanonicalDefinitionType(CanonicalFormKind.Any));
2011TypeDesc owningType = methodIL.OwningMethod.GetTypicalMethodDefinition().OwningType;
2073TypeDesc owningClass = field.OwningType;
2088TypeDesc type = (TypeDesc)result;
2238var type = HandleToObject(cls);
2244TypeDesc type = HandleToObject(cls);
2266TypeDesc type = HandleToObject(cls);
2281TypeDesc type = HandleToObject(cls);
2293TypeDesc type = HandleToObject(cls);
2297private uint getClassAttribsInternal(TypeDesc type)
2382TypeDesc type = HandleToObject(cls);
2413TypeDesc type = HandleToObject(cls);
2432TypeDesc type = HandleToObject(cls);
2446TypeDesc type = HandleToObject(cls);
2557var fieldType = field.FieldType;
2628private Dictionary<TypeDesc, uint> _classNumInstanceFields = new();
2632TypeDesc type = HandleToObject(cls);
2634var lookupType = type.GetTypeDefinition(); // The number of fields on an instantiation is the same as on the generic definition
2652TypeDesc classWithFields = HandleToObject(clsHnd);
2781TypeDesc fieldType = fd.FieldType;
2858TypeDesc type = HandleToObject(typeHnd);
2886var type = HandleToObject(cls);
2888var typeForBox = type.IsNullable ? type.Instantiation[0] : type;
2895var type = HandleToObject(cls);
2905var type = HandleToObject(cls);
2916TypeDesc type = fd != null ? fd.OwningType : typeFromContext(context);
3055var type = HandleToObject(cls);
3065var type = HandleToObject(cls);
3078TypeDesc fromType = HandleToObject(fromClass);
3079TypeDesc toType = HandleToObject(toClass);
3160TypeDesc type1 = HandleToObject(cls1);
3161TypeDesc type2 = HandleToObject(cls2);
3173TypeDesc type1 = HandleToObject(cls1);
3174TypeDesc type2 = HandleToObject(cls2);
3184TypeDesc merged = TypeExtensions.MergeTypesToCommonParent(type1, type2);
3192TypeDesc type = HandleToObject(cls);
3246TypeDesc type = HandleToObject(cls);
3258TypeDesc type = HandleToObject(cls);
3273TypeDesc type = HandleToObject(cls);
3297var td = HandleToObject(clsHnd);
3300TypeDesc returnType = ((ParameterizedType)td).ParameterType;
3313var td = HandleToObject(cls);
3397TypeDesc fieldType = fieldDesc.FieldType;
3521TypeDesc type = methodSig[index];
3545TypeDesc type = locals[index].Type;
3561TypeDesc type = methodSig[index];
3567TypeDesc type = locals[index].Type;
3704TypeDesc taskReturnType = taskReturningMethod.Signature.ReturnType;
3710TypeDesc returnType = caller.Signature.ReturnType;
3712TypeDesc runtimeDeterminedReturnType = runtimeDeterminedCaller.Signature.ReturnType;
3718TypeDesc parameterType = isValueTask
3727TypeDesc signatureVariable = context.GetSignatureVariable(0, method: true);
3728TypeDesc parameterType = isValueTask
3781TypeDesc awaiterType = awaitAwaiterMethod.Instantiation[0];
3786TypeDesc runtimeDeterminedAwaiterType = runtimeDeterminedAwaitAwaiterMethod.Instantiation[0];
3993TypeDesc typeDesc = HandleToObject(structHnd);
4042TypeDesc type = HandleToObject(structHnd);
4068TypeDesc abiType = WasmLowering.LowerToAbiType(type);
4790var queryType = HandleToObject(cls);
4825TypeDesc owningType = MethodBeingCompiled.OwningType;
4943public static void ComputeJitPgoInstrumentationSchema(Func<object, IntPtr> objectToHandle, PgoSchemaElem[] pgoResultsSchemas, out PgoInstrumentationSchema[] nativeSchemas, MemoryStream instrumentationData, Func<TypeDesc, bool> typeFilter = null)
parent\parent\Common\TypeSystem\Interop\IL\Marshaller.cs (35)
35public TypeDesc ManagedType;
36public TypeDesc ManagedParameterType;
39private TypeDesc _nativeType;
40private TypeDesc _nativeParamType;
46public TypeDesc NativeType
71public TypeDesc NativeParameterType
77TypeDesc nativeParamType = NativeType;
127public Home(ILLocalVariable var, TypeDesc type, bool isByRef)
134public Home(int argIndex, TypeDesc type, bool isByRef)
207private TypeDesc _type;
227public static Marshaller CreateMarshaller(TypeDesc parameterType,
338public static Marshaller CreateDisabledMarshaller(TypeDesc parameterType,
411TypeDesc parameterType = (i == 0) ? methodSig.ReturnType : methodSig[i - 1]; //first item is the return type
1098protected TypeDesc ManagedElementType
1108protected TypeDesc NativeElementType
1185var indexType = Marshallers[index].ManagedType;
1243TypeDesc nativeElementType = NativeElementType;
1279var elementType = ManagedElementType;
1298TypeDesc nativeElementType = NativeElementType;
1342var elementType = ManagedElementType;
1343var nativeElementType = NativeElementType;
1420var elementType = ManagedElementType;
1451var nativeElementType = NativeElementType;
1649TypeDesc charRefType = Context.GetWellKnownType(WellKnownType.Char).MakeByRefType();
1704new TypeDesc[] {
1823TypeDesc marshallerIn = MarshallerIn;
1841new TypeDesc[] { Context.GetWellKnownType(WellKnownType.Byte) });
1845new TypeDesc[] { Context.GetWellKnownType(WellKnownType.Void).MakePointerType(), Context.GetWellKnownType(WellKnownType.Int32) }))));
1897ManagedType.Context.GetWellKnownType(WellKnownType.Void), TypeDesc.EmptyTypes));
1953new TypeDesc[] { Context.GetWellKnownType(WellKnownType.Boolean).MakeByRefType() }))));
1958new MethodSignature(0, 0, Context.GetWellKnownType(WellKnownType.IntPtr), TypeDesc.EmptyTypes))));
1967new MethodSignature(0, 0, Context.GetWellKnownType(WellKnownType.Void), TypeDesc.EmptyTypes))));
2002new TypeDesc[] { Context.GetWellKnownType(WellKnownType.IntPtr) }))));
2062new TypeDesc[] { Context.GetSignatureVariable(0, method: true) }
2088new TypeDesc[] { Context.GetWellKnownType(WellKnownType.IntPtr) }
parent\parent\Common\TypeSystem\Interop\InteropTypes.cs (20)
72public static bool IsSafeHandle(TypeSystemContext context, TypeDesc type)
77public static bool IsCriticalHandle(TypeSystemContext context, TypeDesc type)
82private static bool IsCoreNamedType(TypeSystemContext context, TypeDesc type, ReadOnlySpan<byte> @namespace, ReadOnlySpan<byte> name)
90public static bool IsHandleRef(TypeSystemContext context, TypeDesc type)
95public static bool IsSystemDateTime(TypeSystemContext context, TypeDesc type)
100public static bool IsStringBuilder(TypeSystemContext context, TypeDesc type)
105public static bool IsSystemDecimal(TypeSystemContext context, TypeDesc type)
110public static bool IsSystemDelegate(TypeSystemContext context, TypeDesc type)
115public static bool IsSystemMulticastDelegate(TypeSystemContext context, TypeDesc type)
120public static bool IsSystemGuid(TypeSystemContext context, TypeDesc type)
125public static bool IsSystemArgIterator(TypeSystemContext context, TypeDesc type)
130public static bool IsSystemSpan(TypeSystemContext context, TypeDesc type)
135public static bool IsSystemReadOnlySpan(TypeSystemContext context, TypeDesc type)
140public static bool IsSystemNullable(TypeSystemContext context, TypeDesc type)
145public static bool IsSystemRuntimeIntrinsicsVector64T(TypeSystemContext context, TypeDesc type)
150public static bool IsSystemRuntimeIntrinsicsVector128T(TypeSystemContext context, TypeDesc type)
155public static bool IsSystemRuntimeIntrinsicsVector256T(TypeSystemContext context, TypeDesc type)
160public static bool IsSystemRuntimeIntrinsicsVector512T(TypeSystemContext context, TypeDesc type)
165public static bool IsSystemNumericsVectorT(TypeSystemContext context, TypeDesc type)
170private static bool IsOrDerivesFromType(TypeDesc type, MetadataType targetType)
parent\parent\Common\TypeSystem\Common\CastingHelper.cs (67)
15public static bool CanCastTo(this TypeDesc thisType, TypeDesc otherType)
26public static bool CanCastToWithCanon(this TypeDesc thisType, TypeDesc otherType)
31public static bool IsArrayElementTypeCastableBySize(TypeDesc elementType)
55private static TypeFlags GetReducedTypeElementType(TypeDesc type)
79private static TypeFlags GetVerificationTypeElementType(TypeDesc type)
97private static bool AreVerificationTypesEqual(TypeDesc type1, TypeDesc type2)
120private static bool IsMethodSignatureCompatibleWith(TypeDesc fn1Ttype, TypeDesc fn2Type)
130public static bool IsCompatibleWith(this TypeDesc thisType, TypeDesc otherType)
135internal static bool IsCompatibleWith(this TypeDesc thisType, TypeDesc otherType, StackOverflowProtect visited)
181public static bool IsEquivalentTo(this TypeDesc thisType, TypeDesc otherType)
190internal static bool IsEquivalentTo(this TypeDesc thisType, TypeDesc otherType, StackOverflowProtect visited)
199static partial void IsEquivalentTo(this TypeDesc thisType, TypeDesc otherType, StackOverflowProtect visited, ref bool isEquivalentTo);
204static abstract bool IsCanonicalCastTarget(TypeDesc thisType, TypeDesc otherType);
205static abstract bool IsCanonicalTypeArgMatch(TypeDesc type, TypeDesc otherType);
206static abstract bool IsCanonEquivalent(TypeDesc thisType, TypeDesc otherType);
212static bool ICanonicalTypeCastingHandler.IsCanonicalCastTarget(TypeDesc thisType, TypeDesc otherType) => false;
213static bool ICanonicalTypeCastingHandler.IsCanonicalTypeArgMatch(TypeDesc type, TypeDesc otherType) => false;
214static bool ICanonicalTypeCastingHandler.IsCanonEquivalent(TypeDesc thisType, TypeDesc otherType) => false;
219internal static bool CanCastToInternal(TypeDesc thisType, TypeDesc otherType, StackOverflowProtect protect)
257private static bool CanCastGenericParameterTo(GenericParameterDesc thisType, TypeDesc otherType, StackOverflowProtect protect)
280typeInstantiation = ((TypeDesc)thisType.AssociatedTypeOrMethod).Instantiation;
282foreach (var typeConstraint in thisType.TypeConstraints)
284TypeDesc instantiatedConstraint = typeConstraint.InstantiateSignature(typeInstantiation, methodInstantiation);
294private static bool CanCastArrayTo(ArrayType thisType, TypeDesc otherType, StackOverflowProtect protect)
327private static bool CanCastParamTo(ParameterizedType thisType, TypeDesc paramType, StackOverflowProtect protect)
338TypeDesc curTypesParm = thisType.ParameterType;
341TypeDesc fromParamUnderlyingType = curTypesParm.UnderlyingType;
356TypeDesc toParamUnderlyingType = paramType.UnderlyingType;
369foreach (var typeConstraint in type.TypeConstraints)
391private static TypeFlags GetNormalizedIntegralArrayElementType(TypeDesc type)
414private static bool CanCastToClassOrInterface(TypeDesc thisType, TypeDesc otherType, StackOverflowProtect protect)
426private static bool CanCastToInterface(TypeDesc thisType, TypeDesc otherType, StackOverflowProtect protect)
453private static bool CanCastToNonVariantInterface(TypeDesc thisType, TypeDesc otherType)
471private static bool CanCastByVarianceToInterfaceOrDelegate(TypeDesc thisType, TypeDesc otherType, StackOverflowProtect protectInput, bool arrayCovariance = false)
501TypeDesc arg = instantiationThis[i];
502TypeDesc targetArg = instantiationTarget[i];
535private static bool CanCastToClass(TypeDesc thisType, TypeDesc otherType, StackOverflowProtect protect)
537TypeDesc curType = thisType;
591private static bool IsBoxedAndCanCastTo(TypeDesc thisType, TypeDesc otherType, StackOverflowProtect protect, bool arrayCovariance)
593TypeDesc fromUnderlyingType = thisType.UnderlyingType;
609TypeDesc toUnderlyingType = otherType.UnderlyingType;
650public readonly TypeDesc FromType;
651public readonly TypeDesc ToType;
653public CastingPair(TypeDesc fromType, TypeDesc toType)
parent\parent\Common\TypeSystem\Common\FieldLayoutIntervalCalculator.cs (7)
58protected abstract bool NeedsRecursiveLayout(TypeDesc fieldType);
60protected abstract TIntervalTag GetIntervalDataForType(int offset, TypeDesc fieldType);
64private int GetFieldSize(TypeDesc fieldType)
81public void AddFields(TypeDesc type, bool addTrailingEmptyInterval = true) => AddToFieldLayout(0, type, addTrailingEmptyInterval: false);
83public void AddToFieldLayout(int offset, TypeDesc fieldType) => AddToFieldLayout(offset, fieldType, addTrailingEmptyInterval: true);
85public void AddToFieldLayout(int offset, TypeDesc fieldType, bool addTrailingEmptyInterval)
127private void AddToFieldLayout(List<FieldLayoutInterval> fieldLayout, int offset, TypeDesc fieldType)
parent\parent\Common\TypeSystem\Common\MetadataVirtualMethodAlgorithm.cs (14)
218public override MethodDesc FindVirtualFunctionTargetMethodOnObjectType(MethodDesc targetMethod, TypeDesc objectType)
273foreach (TypeDesc iface in type.RuntimeInterfaces)
361foreach (TypeDesc iface in type.ExplicitlyImplementedInterfaces)
653public override MethodDesc ResolveInterfaceMethodToVirtualMethodOnType(MethodDesc interfaceMethod, TypeDesc currentType)
658public override MethodDesc ResolveVariantInterfaceMethodToVirtualMethodOnType(MethodDesc interfaceMethod, TypeDesc currentType)
663public override MethodDesc ResolveInterfaceMethodToStaticVirtualMethodOnType(MethodDesc interfaceMethod, TypeDesc currentType)
668public override MethodDesc ResolveVariantInterfaceMethodToStaticVirtualMethodOnType(MethodDesc interfaceMethod, TypeDesc currentType)
786foreach (TypeDesc iface in currentType.RuntimeInterfaces)
846public override DefaultInterfaceMethodResolution ResolveInterfaceMethodToDefaultImplementationOnType(MethodDesc interfaceMethod, TypeDesc currentType, out MethodDesc impl)
851public override DefaultInterfaceMethodResolution ResolveVariantInterfaceMethodToDefaultImplementationOnType(MethodDesc interfaceMethod, TypeDesc currentType, out MethodDesc impl)
868TypeDesc interfaceMT,
934TypeDesc interfaceMT = interfaceMethod.OwningType;
1083public override IEnumerable<MethodDesc> ComputeAllVirtualSlots(TypeDesc type)
1145TypeDesc interfaceType = interfaceMethod.OwningType;
parent\parent\Common\TypeSystem\Common\MethodDesc.cs (31)
41public TypeDesc type;
51internal TypeDesc _returnType;
52internal TypeDesc[] _parameters;
75public MethodSignature(MethodSignatureFlags flags, int genericParameterCount, TypeDesc returnType, TypeDesc[] parameters, EmbeddedSignatureData[] embeddedSignatureData = null)
92TypeDesc[] newParameters = _parameters; // Re-use existing array until conflict appears
93TypeDesc returnTypeNew = _returnType.InstantiateSignature(substitution, default(Instantiation));
97newParameters = (TypeDesc[])_parameters.Clone();
102TypeDesc newParameter = newParameters[i].InstantiateSignature(substitution, default(Instantiation));
108newParameters = (TypeDesc[])_parameters.Clone();
156public TypeDesc ReturnType
168public TypeDesc this[int index]
198TypeDesc modifierType)
338static bool IsTypeEqualHelper(TypeDesc type1, TypeDesc type2, bool allowEquivalence, StackOverflowProtect visited)
382public TypeDesc Current => _signature[_index];
403private TypeDesc _returnType;
404private TypeDesc[] _parameters;
426public TypeDesc ReturnType
435public TypeDesc this[int index]
444TypeDesc[] parameters = new TypeDesc[_parameters.Length];
457_parameters = new TypeDesc[value];
544public abstract TypeDesc OwningType
762TypeDesc owningType = OwningType;
770TypeDesc[] clone = null;
774TypeDesc uninst = instantiation[i];
775TypeDesc inst = uninst.InstantiateSignature(typeInstantiation, methodInstantiation);
780clone = new TypeDesc[instantiation.Length];
792TypeDesc owningType = method.OwningType;
793TypeDesc instantiatedOwningType = owningType.InstantiateSignature(typeInstantiation, methodInstantiation);
parent\parent\Common\TypeSystem\Common\TypeSystemContext.cs (28)
56public ArrayType GetArrayType(TypeDesc elementType)
67private TypeDesc _elementType;
70public ArrayTypeKey(TypeDesc elementType, int rank)
76public TypeDesc ElementType
129public ArrayType GetArrayType(TypeDesc elementType, int rank)
137public class ByRefHashtable : LockFreeReaderHashtable<TypeDesc, ByRefType>
139protected override int GetKeyHashCode(TypeDesc key)
149protected override bool CompareKeyToValue(TypeDesc key, ByRefType value)
159protected override ByRefType CreateValueFromKey(TypeDesc key)
167public ByRefType GetByRefType(TypeDesc parameterType)
175public class PointerHashtable : LockFreeReaderHashtable<TypeDesc, PointerType>
177protected override int GetKeyHashCode(TypeDesc key)
187protected override bool CompareKeyToValue(TypeDesc key, PointerType value)
197protected override PointerType CreateValueFromKey(TypeDesc key)
205public PointerType GetPointerType(TypeDesc parameterType)
258private TypeDesc _typeDef;
261public InstantiatedTypeKey(TypeDesc typeDef, Instantiation instantiation)
267public TypeDesc TypeDef
642public TypeDesc GetSignatureVariable(int index, bool method)
651protected internal virtual IEnumerable<MethodDesc> GetAllMethods(TypeDesc type)
656protected internal virtual IEnumerable<MethodDesc> GetAllVirtualMethods(TypeDesc type)
665public RuntimeInterfacesAlgorithm GetRuntimeInterfacesAlgorithmForType(TypeDesc type)
674TypeDesc elementType = arrType.ElementType;
708public virtual VirtualMethodAlgorithm GetVirtualMethodAlgorithmForType(TypeDesc type)
726internal TypeFlags ComputeTypeFlags(TypeDesc type, TypeFlags flags, TypeFlags mask)
731TypeDesc typeDefinition = type.GetTypeDefinition();
754TypeDesc typeDefinition = type.GetTypeDefinition();
776protected internal abstract bool ComputeHasStaticConstructor(TypeDesc type);
parent\parent\Common\TypeSystem\Common\TypeSystemHelpers.cs (41)
14public static bool IsWellKnownType(this TypeDesc type, WellKnownType wellKnownType)
24public static InstantiatedType MakeInstantiatedType(this MetadataType typeDef, params TypeDesc[] genericParameters)
35public static InstantiatedMethod MakeInstantiatedMethod(this MethodDesc methodDef, params TypeDesc[] genericParameters)
40public static ArrayType MakeArrayType(this TypeDesc type)
49public static ArrayType MakeArrayType(this TypeDesc type, int rank)
54public static ByRefType MakeByRefType(this TypeDesc type)
59public static PointerType MakePointerType(this TypeDesc type)
64public static TypeDesc GetParameterType(this TypeDesc type)
71public static LayoutInt GetElementSize(this TypeDesc type)
86public static MethodDesc GetParameterlessConstructor(this TypeDesc type)
89var sig = new MethodSignature(0, 0, type.Context.GetWellKnownType(WellKnownType.Void), TypeDesc.EmptyTypes);
93public static bool HasExplicitOrImplicitDefaultConstructor(this TypeDesc type)
98internal static MethodDesc FindMethodOnExactTypeWithMatchingTypicalMethod(this TypeDesc type, MethodDesc method)
129public static MethodDesc FindMethodOnTypeWithMatchingTypicalMethod(this TypeDesc targetType, MethodDesc method)
140TypeDesc typicalTypeOfTargetMethod = method.GetTypicalMethodDefinition().OwningType;
141TypeDesc targetOrBase = targetType;
144TypeDesc openTargetOrBase = targetOrBase;
165public static IEnumerable<MethodDesc> GetAllMethods(this TypeDesc type)
173public static IEnumerable<MethodDesc> GetAllVirtualMethods(this TypeDesc type)
178public static IEnumerable<MethodDesc> EnumAllVirtualSlots(this TypeDesc type)
187public static MethodDesc ResolveInterfaceMethodToVirtualMethodOnType(this TypeDesc type, MethodDesc interfaceMethod)
192public static MethodDesc ResolveVariantInterfaceMethodToVirtualMethodOnType(this TypeDesc type, MethodDesc interfaceMethod)
197public static MethodDesc ResolveInterfaceMethodToStaticVirtualMethodOnType(this TypeDesc type, MethodDesc interfaceMethod)
202public static MethodDesc ResolveVariantInterfaceMethodToStaticVirtualMethodOnType(this TypeDesc type, MethodDesc interfaceMethod)
207public static DefaultInterfaceMethodResolution ResolveInterfaceMethodToDefaultImplementationOnType(this TypeDesc type, MethodDesc interfaceMethod, out MethodDesc implMethod)
212public static DefaultInterfaceMethodResolution ResolveVariantInterfaceMethodToDefaultImplementationOnType(this TypeDesc type, MethodDesc interfaceMethod, out MethodDesc implMethod)
220public static MethodDesc FindVirtualFunctionTargetMethodOnObjectType(this TypeDesc type, MethodDesc targetMethod)
229public static TypeDesc InstantiateAsOpen(this TypeDesc type)
239var inst = new TypeDesc[type.Instantiation.Length];
256TypeDesc owner = field.OwningType;
275TypeDesc owner = method.OwningType;
290public static MethodDesc ResolveInterfaceMethodTarget(this TypeDesc thisType, MethodDesc interfaceMethodToResolve)
295TypeDesc currentType = thisType;
310public static MethodDesc ResolveInterfaceMethodTargetWithVariance(this TypeDesc thisType, MethodDesc interfaceMethodToResolve)
315TypeDesc currentType = thisType;
326public static bool ContainsSignatureVariables(this TypeDesc thisType, bool treatGenericParameterLikeSignatureVariable = false)
359foreach (TypeDesc arg in thisType.Instantiation)
405public static bool RequiresAlign8(this TypeDesc type)
414var elementType = ((ArrayType)type).ElementType;
parent\parent\Common\TypeSystem\Common\Utilities\CustomAttributeTypeNameParser.cs (18)
23public static TypeDesc GetTypeByCustomAttributeTypeName(this ModuleDesc module, string name, bool throwIfNotFound = true,
24Func<ModuleDesc, string, TypeDesc> canonGenericResolver = null)
39public static TypeDesc GetTypeByCustomAttributeTypeNameForDataFlow(string name, ModuleDesc callingModule,
65TypeDesc type = resolver.Resolve(parsed);
102internal Func<ModuleDesc, string, TypeDesc> _canonGenericResolver;
106internal TypeDesc Resolve(TypeName typeName)
120TypeDesc type = Resolve(typeName.GetElementType());
138private TypeDesc GetSimpleType(TypeName typeName)
156TypeDesc type = GetSimpleTypeFromModule(typeName, module);
169TypeDesc type = GetSimpleTypeFromModule(typeName, _context.SystemModule);
183private TypeDesc GetSimpleTypeFromModule(TypeName typeName, ModuleDesc module)
187TypeDesc type = GetSimpleTypeFromModule(typeName.DeclaringType, module);
196TypeDesc canonType = _canonGenericResolver(module, fullName);
206private TypeDesc GetGenericType(TypeName typeName)
208TypeDesc typeDefinition = Resolve(typeName.GetGenericTypeDefinition());
213TypeDesc[] instantiation = new TypeDesc[typeArguments.Length];
216TypeDesc type = Resolve(typeArguments[i]);
parent\parent\Common\TypeSystem\IL\UnsafeAccessors.cs (23)
23CustomAttributeValue<TypeDesc>? decodedAttribute = method.GetDecodedCustomAttribute("System.Runtime.CompilerServices", "UnsafeAccessorAttribute");
54TypeDesc retType = context.DeclarationSignature.ReturnType;
56TypeDesc firstArgType = null;
169private static bool TryParseUnsafeAccessorAttribute(MethodDesc method, CustomAttributeValue<TypeDesc> decodedValue, out UnsafeAccessorKind kind, out string name)
223public TypeDesc TargetType;
229private static bool ValidateTargetType(TypeDesc targetTypeMaybe, out TypeDesc validated)
231TypeDesc targetType = targetTypeMaybe.IsByRef
376TypeDesc declType = context.Kind == UnsafeAccessorKind.Constructor ? declSig[i] : declSig[i + 1];
377TypeDesc maybeType = maybeSig[i];
389private static bool VerifyDeclarationSatisfiesTargetConstraints(MethodDesc declaration, TypeDesc targetType, MethodDesc targetMethod)
431TypeDesc targetType = context.TargetType;
480TypeDesc[] methodInstantiation = new TypeDesc[targetMaybe.Instantiation.Length];
494private static SetTargetResult TrySetTargetField(ref GenerationContext context, string name, TypeDesc fieldType)
496TypeDesc targetType = context.TargetType;
516private static bool IsValidInitialTypeForReplacementType(TypeDesc initialType, TypeDesc replacementType)
574TypeDesc initialType = isReturnValue ? originalSignature.ReturnType : originalSignature[parameter.SequenceNumber - 1];
583SetTargetResult decodeResult = DecodeUnsafeAccessorType(method, reader.GetCustomAttribute(unsafeAccessorTypeAttributeHandle), out TypeDesc replacementType);
618private static SetTargetResult DecodeUnsafeAccessorType(EcmaMethod method, CustomAttribute unsafeAccessorTypeAttribute, out TypeDesc replacementType)
621CustomAttributeValue<TypeDesc> decoded = unsafeAccessorTypeAttribute.DecodeValue(
742TypeDesc targetType = byrefType.ParameterType;