public override bool ComputeIsUnsafeValueType(DefType type) { RuntimeDeterminedType runtimeDeterminedType = (RuntimeDeterminedType)type; DefType canonicalType = runtimeDeterminedType.CanonicalType; return(canonicalType.IsUnsafeValueType); }
public override bool ComputeContainsGCPointers(DefType type) { RuntimeDeterminedType runtimeDeterminedType = (RuntimeDeterminedType)type; DefType canonicalType = runtimeDeterminedType.CanonicalType; return(canonicalType.ContainsGCPointers); }
public override ValueTypeShapeCharacteristics ComputeValueTypeShapeCharacteristics(DefType type) { RuntimeDeterminedType runtimeDeterminedType = (RuntimeDeterminedType)type; DefType canonicalType = runtimeDeterminedType.CanonicalType; return(canonicalType.ValueTypeShapeCharacteristics); }
public override DefType ComputeHomogeneousFloatAggregateElementType(DefType type) { RuntimeDeterminedType runtimeDeterminedType = (RuntimeDeterminedType)type; DefType canonicalType = runtimeDeterminedType.CanonicalType; return(canonicalType.HfaElementType); }
internal MethodForRuntimeDeterminedType(MethodDesc typicalMethodDef, RuntimeDeterminedType rdType) { Debug.Assert(typicalMethodDef.IsTypicalMethodDefinition); _typicalMethodDef = typicalMethodDef; _rdType = rdType; }
public override bool ComputeIsByRefLike(DefType type) { RuntimeDeterminedType runtimeDeterminedType = (RuntimeDeterminedType)type; DefType canonicalType = runtimeDeterminedType.CanonicalType; return(canonicalType.IsByRefLike); }
public override ComputedInstanceFieldLayout ComputeInstanceLayout(DefType defType, InstanceLayoutKind layoutKind) { // Individual field offset layout for a RuntimeDeterminedType is not a supported operation if (layoutKind != InstanceLayoutKind.TypeOnly) { throw new NotSupportedException(); } RuntimeDeterminedType type = (RuntimeDeterminedType)defType; DefType canonicalType = type.CanonicalType; ComputedInstanceFieldLayout result = new ComputedInstanceFieldLayout { ByteCountUnaligned = canonicalType.InstanceByteCountUnaligned, ByteCountAlignment = canonicalType.InstanceByteAlignment, FieldAlignment = canonicalType.InstanceFieldAlignment, FieldSize = canonicalType.InstanceFieldSize, Offsets = Array.Empty <FieldAndOffset>() }; return(result); }
// This constructor is a performance optimization - it allows supplying the hash code if it has already // been computed prior to the allocation of this type. The supplied hash code still has to match the // hash code this type would compute on it's own (and we assert to enforce that). internal MethodForRuntimeDeterminedType(MethodDesc typicalMethodDef, RuntimeDeterminedType rdType, int hashcode) : this(typicalMethodDef, rdType) { SetHashCode(hashcode); }
public MethodForRuntimeDeterminedTypeKey(MethodDesc typicalMethodDef, RuntimeDeterminedType rdType) { _typicalMethodDef = typicalMethodDef; _rdType = rdType; _hashcode = TypeHashingAlgorithms.ComputeMethodHashCode(rdType.CanonicalType.GetHashCode(), TypeHashingAlgorithms.ComputeNameHashCode(typicalMethodDef.Name)); }
public MethodDesc GetMethodForRuntimeDeterminedType(MethodDesc typicalMethodDef, RuntimeDeterminedType rdType) { Debug.Assert(!(typicalMethodDef is MethodForRuntimeDeterminedType)); Debug.Assert(typicalMethodDef.IsTypicalMethodDefinition); return(_methodForRDTypes.GetOrCreateValue(new MethodForRuntimeDeterminedTypeKey(typicalMethodDef, rdType))); }