示例#1
0
        public override bool ComputeIsUnsafeValueType(DefType type)
        {
            RuntimeDeterminedType runtimeDeterminedType = (RuntimeDeterminedType)type;
            DefType canonicalType = runtimeDeterminedType.CanonicalType;

            return(canonicalType.IsUnsafeValueType);
        }
示例#2
0
        public override bool ComputeContainsGCPointers(DefType type)
        {
            RuntimeDeterminedType runtimeDeterminedType = (RuntimeDeterminedType)type;
            DefType canonicalType = runtimeDeterminedType.CanonicalType;

            return(canonicalType.ContainsGCPointers);
        }
示例#3
0
        public override ValueTypeShapeCharacteristics ComputeValueTypeShapeCharacteristics(DefType type)
        {
            RuntimeDeterminedType runtimeDeterminedType = (RuntimeDeterminedType)type;
            DefType canonicalType = runtimeDeterminedType.CanonicalType;

            return(canonicalType.ValueTypeShapeCharacteristics);
        }
示例#4
0
        public override DefType ComputeHomogeneousFloatAggregateElementType(DefType type)
        {
            RuntimeDeterminedType runtimeDeterminedType = (RuntimeDeterminedType)type;
            DefType canonicalType = runtimeDeterminedType.CanonicalType;

            return(canonicalType.HfaElementType);
        }
示例#5
0
        internal MethodForRuntimeDeterminedType(MethodDesc typicalMethodDef, RuntimeDeterminedType rdType)
        {
            Debug.Assert(typicalMethodDef.IsTypicalMethodDefinition);

            _typicalMethodDef = typicalMethodDef;
            _rdType           = rdType;
        }
示例#6
0
        public override bool ComputeIsByRefLike(DefType type)
        {
            RuntimeDeterminedType runtimeDeterminedType = (RuntimeDeterminedType)type;
            DefType canonicalType = runtimeDeterminedType.CanonicalType;

            return(canonicalType.IsByRefLike);
        }
示例#7
0
        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);
        }
示例#8
0
 // 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);
 }
示例#9
0
 public MethodForRuntimeDeterminedTypeKey(MethodDesc typicalMethodDef, RuntimeDeterminedType rdType)
 {
     _typicalMethodDef = typicalMethodDef;
     _rdType           = rdType;
     _hashcode         = TypeHashingAlgorithms.ComputeMethodHashCode(rdType.CanonicalType.GetHashCode(), TypeHashingAlgorithms.ComputeNameHashCode(typicalMethodDef.Name));
 }
示例#10
0
        public MethodDesc GetMethodForRuntimeDeterminedType(MethodDesc typicalMethodDef, RuntimeDeterminedType rdType)
        {
            Debug.Assert(!(typicalMethodDef is MethodForRuntimeDeterminedType));
            Debug.Assert(typicalMethodDef.IsTypicalMethodDefinition);

            return(_methodForRDTypes.GetOrCreateValue(new MethodForRuntimeDeterminedTypeKey(typicalMethodDef, rdType)));
        }