1 write to _type
ILCompiler.Compiler (1)
Compiler\DependencyAnalysis\EETypeNode.cs (1)
91
_type
= type;
149 references to _type
ILCompiler.Compiler (149)
Compiler\DependencyAnalysis\ConstructedEETypeNode.cs (15)
31
if (
_type
.IsIDynamicInterfaceCastable)
39
dependencyList.Add(factory.MetadataTypeSymbol(
_type
), "MetadataType for constructed type");
41
DefType closestDefType =
_type
.GetClosestDefType();
43
if (
_type
.IsArray)
47
dependencyList.Add(factory.ConstructedTypeSymbol(
_type
.BaseType), "Array base type");
49
ArrayType arrayType = (ArrayType)
_type
;
60
if (!
_type
.IsCanonicalSubtype(CanonicalFormKind.Any))
62
factory.InteropStubManager.AddInterestingInteropConstructedTypeDependencies(ref dependencyList, factory,
_type
);
70
return
_type
.BaseType != null ? factory.ConstructedTypeSymbol(
_type
.BaseType.NormalizeInstantiation()) : null;
75
Debug.Assert(!
_type
.IsCanonicalSubtype(CanonicalFormKind.Any));
76
return factory.SerializedMetadataRuntimeTypeObject(
_type
);
81
return factory.ConstructedTypeSymbol(((ArrayType)
_type
).ElementType);
90
protected override int GCDescSize => GCDescEncoder.GetGCDescSize(
_type
);
94
GCDescEncoder.EncodeGCDesc(ref builder,
_type
);
Compiler\DependencyAnalysis\EETypeNode.cs (106)
92
_writableDataNode = !
_type
.IsCanonicalSubtype(CanonicalFormKind.Any) ? new WritableDataNode(this) : null;
193
_mightHaveInterfaceDispatchMap = EmitVirtualSlots && InterfaceDispatchMapNode.MightHaveInterfaceDispatchMap(
_type
, factory);
203
return factory.MetadataTypeSymbol(
_type
).Marked;
208
return factory.NecessaryTypeSymbol(
_type
);
211
public TypeDesc Type =>
_type
;
221
public int MinimumObjectSize => EETypeBuilderHelpers.GetMinimumObjectSize(
_type
.Context);
234
sb.Append(nameMangler.NodeMangler.MethodTable(
_type
));
240
public override bool IsShareable => IsTypeNodeShareable(
_type
);
246
if (
_type
.IsArrayTypeWithoutGenericInterfaces())
249
if (!
_type
.Context.SupportsCanon)
253
if (
_type
.IsCanonicalSubtype(CanonicalFormKind.Any))
257
return (
_type
.ConvertToCanonForm(CanonicalFormKind.Specific) !=
_type
);
276
if (
_type
.RuntimeInterfaces.Length > 0)
293
DefType currentType =
_type
.GetClosestDefType();
296
if (currentType ==
_type
|| (currentType is MetadataType mdType && mdType.IsAbstract))
321
factory.MetadataManager.GetConditionalDependenciesDueToEETypePresence(ref result, factory,
_type
, allocated: EmitVirtualSlots);
323
if (!
_type
.IsCanonicalSubtype(CanonicalFormKind.Any))
325
foreach (DefType iface in
_type
.RuntimeInterfaces)
336
IEETypeNode maximallyConstructableType = factory.MaximallyConstructableType(
_type
);
345
result.Add(new CombinedDependencyListEntry(maximallyConstructableType, factory.MaximallyConstructableType(
_type
.ConvertToCanonForm(CanonicalFormKind.Specific)), "Trigger full type generation if canonical form exists"));
350
TypeDesc canonOwningType =
_type
.ConvertToCanonForm(CanonicalFormKind.Specific);
351
if (
_type
.IsDefType &&
_type
!= canonOwningType)
354
factory.GenericStaticBaseInfo((MetadataType)
_type
),
362
DefType defType =
_type
.GetClosestDefType();
423
_type
== defType ||
424
((System.Collections.IStructuralEquatable)defType.RuntimeInterfaces).Equals(
_type
.RuntimeInterfaces,
447
bool isVariantInterfaceImpl = VariantInterfaceMethodUseNode.IsVariantInterfaceImplementation(factory,
_type
, interfaceType);
596
if (
_type
.IsInterface)
597
dependencies.Add(factory.InterfaceUse(
_type
.GetTypeDefinition()), "Interface is used");
603
if (
_type
.IsArrayTypeWithoutGenericInterfaces())
605
IEETypeNode maximallyConstructableType = factory.MaximallyConstructableType(
_type
);
614
if (!
_type
.IsArrayTypeWithoutGenericInterfaces())
617
dependencies.Add(new DependencyListEntry(factory.SealedVTable(
_type
.ConvertToCanonForm(CanonicalFormKind.Specific)), "Sealed Vtable"));
623
foreach (TypeDesc intface in
_type
.RuntimeInterfaces)
629
TypeDesc canonicalType =
_type
.ConvertToCanonForm(CanonicalFormKind.Specific);
630
if (canonicalType !=
_type
)
635
if (factory.CompilationModuleGroup.PresenceOfEETypeImpliesAllMethodsOnType(
_type
))
637
if (
_type
.IsArray ||
_type
.IsDefType)
650
foreach (var method in
_type
.GetClosestDefType().ConvertToCanonForm(CanonicalFormKind.Specific).GetAllMethodsAndAsyncVariants())
661
if (!ConstructedEETypeNode.CreationAllowed(
_type
))
665
factory.MetadataManager.GetDependenciesDueToEETypePresence(ref dependencies, factory,
_type
);
668
if (
_type
is MetadataType mdType)
672
if (
_type
.IsFunctionPointer)
673
FunctionPointerMapNode.GetHashtableDependencies(ref dependencies, factory, (FunctionPointerType)
_type
);
695
objData.EmitInt(
_type
.GetHashCode());
702
OutputVirtualSlots(factory, ref objData,
_type
,
_type
,
_type
, relocsOnly);
756
uint flags = EETypeBuilderHelpers.ComputeFlags(
_type
);
758
if (
_type
.GetTypeDefinition() == factory.TypeSystemContext.ArrayOfTEnumeratorType)
764
if (factory.TypeSystemContext.IsGenericArrayInterfaceType(
_type
))
772
if (EmitVirtualSlots && !
_type
.IsArrayTypeWithoutGenericInterfaces())
774
SealedVTableNode sealedVTable = factory.SealedVTable(
_type
.ConvertToCanonForm(CanonicalFormKind.Specific));
784
if (
_type
.IsArray ||
_type
.IsString)
793
if (
_type
.IsArray)
795
TypeDesc elementType = ((ArrayType)
_type
).ElementType;
800
else if (
_type
.IsString)
806
ushort flagsEx = EETypeBuilderHelpers.ComputeFlagsEx(
_type
);
817
return EETypeBuilderHelpers.ComputeBaseSize(
_type
);
823
return
_type
.BaseType != null ? factory.NecessaryTypeSymbol(
_type
.BaseType.NormalizeInstantiation()) : null;
828
Debug.Assert(!
_type
.IsCanonicalSubtype(CanonicalFormKind.Any));
829
return factory.SerializedNecessaryRuntimeTypeObject(
_type
);
834
return factory.NecessaryTypeSymbol(((ArrayType)
_type
).ElementType);
841
if (
_type
.IsParameterizedType)
843
var parameterType = ((ParameterizedType)
_type
).ParameterType;
844
if (
_type
.IsArray && parameterType.IsValueType && !parameterType.IsNullable)
856
else if (
_type
.IsFunctionPointer)
858
relatedTypeNode = factory.NecessaryTypeSymbol(((FunctionPointerType)
_type
).Signature.ReturnType);
862
TypeDesc baseType =
_type
.BaseType;
959
if (
_type
.IsInterface)
1044
if (
_type
.IsCanonicalSubtype(CanonicalFormKind.Any))
1048
foreach (DefType itf in
_type
.RuntimeInterfaces)
1060
foreach (var itf in
_type
.RuntimeInterfaces)
1075
if (
_type
.HasFinalizer)
1077
MethodDesc finalizerMethod =
_type
.GetFinalizer();
1114
if (EmitVirtualSlots && !
_type
.IsArrayTypeWithoutGenericInterfaces())
1117
SealedVTableNode sealedVTable = factory.SealedVTable(
_type
.ConvertToCanonForm(CanonicalFormKind.Specific));
1131
if (
_type
.HasInstantiation)
1133
if (!
_type
.IsTypeDefinition)
1136
factory.MetadataTypeSymbol(
_type
.GetTypeDefinition()) : factory.NecessaryTypeSymbol(
_type
.GetTypeDefinition());
1145
&& factory.MetadataManager.IsTypeInstantiationReflectionVisible(
_type
))
1147
compositionNode =
_type
.Instantiation.Length > 1
1148
? factory.ConstructedGenericComposition(
_type
.Instantiation)
1149
: factory.MaximallyConstructableType(
_type
.Instantiation[0]);
1153
compositionNode =
_type
.Instantiation.Length > 1
1154
? factory.GenericComposition(
_type
.Instantiation)
1155
: factory.NecessaryTypeSymbol(
_type
.Instantiation[0]);
1166
if (
_type
== factory.TypeSystemContext.ArrayOfTEnumeratorType)
1171
else if (factory.TypeSystemContext.IsGenericArrayInterfaceType(
_type
))
1176
details = new GenericVarianceDetails(
_type
);
1178
else if (
_type
.HasVariance)
1180
details = new GenericVarianceDetails(
_type
);
1201
if (
_type
.IsFunctionPointer)
1203
MethodSignature sig = ((FunctionPointerType)
_type
).Signature;
1219
ISymbolNode dispatchMap = factory.InterfaceDispatchMap(
_type
.ConvertToCanonForm(CanonicalFormKind.Specific));
1229
Debug.Assert(
_type
.IsTypeDefinition || !
_type
.HasSameTypeDefinition(context.ArrayOfTClass), "Asking for Array<T> MethodTable");
1236
return comparer.Compare(
_type
, ((EETypeNode)other).
_type
);
1241
return
_type
.ToString();
Compiler\DependencyAnalysis\GenericDefinitionEETypeNode.cs (11)
26
return factory.NecessaryTypeSymbol(
_type
);
36
uint flags = EETypeBuilderHelpers.ComputeFlags(
_type
);
41
if (
_type
== factory.TypeSystemContext.ArrayOfTEnumeratorType || factory.TypeSystemContext.IsGenericArrayInterfaceType(
_type
))
44
if (
_type
.IsByRefLike)
48
dataBuilder.EmitInt(checked((ushort)
_type
.Instantiation.Length)); // Base size (we put instantiation length)
52
dataBuilder.EmitInt(
_type
.GetHashCode());
72
return factory.MetadataTypeSymbol(
_type
).Marked;
96
return factory.SerializedMetadataRuntimeTypeObject(
_type
);
105
dependencyList.Add(factory.NecessaryTypeSymbol(
_type
), "Reflection invisible type for a visible type");
108
factory.MetadataManager.GetDependenciesDueToEETypePresence(ref dependencyList, factory,
_type
);
Compiler\DependencyAnalysis\MetadataEETypeNode.cs (17)
25
if (ConstructedEETypeNode.CreationAllowed(
_type
))
26
return factory.ConstructedTypeSymbol(
_type
).Marked;
38
dependencyList.Add(factory.NecessaryTypeSymbol(
_type
), "NecessaryType for metadata type");
40
if (
_type
is MetadataType mdType)
44
factory.MetadataManager.GetDependenciesDueToEETypePresence(ref dependencyList, factory,
_type
);
48
if (
_type
.IsValueType)
49
dependencyList.Add(factory.MaximallyConstructableType(
_type
), "Reflection visible valuetype");
52
if (
_type
.IsDelegate)
53
dependencyList.Add(factory.MaximallyConstructableType(
_type
), "Reflection visible delegate");
56
if (
_type
.IsArray)
57
dependencyList.Add(factory.MaximallyConstructableType(
_type
), "Reflection visible array");
63
foreach (MetadataType intface in
_type
.RuntimeInterfaces)
75
dependencyList.Add(factory.MaximallyConstructableType(
_type
), "Has static virtual methods");
82
return
_type
.BaseType != null ? factory.MetadataTypeSymbol(
_type
.BaseType.NormalizeInstantiation()) : null;
87
return factory.SerializedMetadataRuntimeTypeObject(
_type
);
92
return factory.MetadataTypeSymbol(((ArrayType)
_type
).ElementType);