public ReadyToRunCompilerContext(TargetDetails details, SharedGenericsMode genericsMode, bool bubbleIncludesCorelib, CompilerTypeSystemContext oldTypeSystemContext = null)
            : base(details, genericsMode)
        {
            _r2rFieldLayoutAlgorithm          = new ReadyToRunMetadataFieldLayoutAlgorithm();
            _systemObjectFieldLayoutAlgorithm = new SystemObjectFieldLayoutAlgorithm(_r2rFieldLayoutAlgorithm);

            // Only the Arm64 JIT respects the OS rules for vector type abi currently
            _vectorFieldLayoutAlgorithm = new VectorFieldLayoutAlgorithm(_r2rFieldLayoutAlgorithm, (details.Architecture == TargetArchitecture.ARM64) ? true : bubbleIncludesCorelib);

            string matchingVectorType = "Unknown";

            if (details.MaximumSimdVectorLength == SimdVectorLength.Vector128Bit)
            {
                matchingVectorType = "Vector128`1";
            }
            else if (details.MaximumSimdVectorLength == SimdVectorLength.Vector256Bit)
            {
                matchingVectorType = "Vector256`1";
            }

            // No architecture has completely stable handling of Vector<T> in the abi (Arm64 may change to SVE)
            _vectorOfTFieldLayoutAlgorithm = new VectorOfTFieldLayoutAlgorithm(_r2rFieldLayoutAlgorithm, _vectorFieldLayoutAlgorithm, matchingVectorType, bubbleIncludesCorelib);

            if (oldTypeSystemContext != null)
            {
                InheritOpenModules(oldTypeSystemContext);
            }
        }
예제 #2
0
 public override FieldLayoutAlgorithm GetLayoutAlgorithmForType(DefType type)
 {
     if (type.IsObject)
     {
         return(_systemObjectFieldLayoutAlgorithm);
     }
     else if (type == UniversalCanonType)
     {
         throw new NotImplementedException();
     }
     else if (type.IsRuntimeDeterminedType)
     {
         throw new NotImplementedException();
     }
     else if (VectorOfTFieldLayoutAlgorithm.IsVectorOfTType(type))
     {
         return(_vectorOfTFieldLayoutAlgorithm);
     }
     else if (VectorFieldLayoutAlgorithm.IsVectorType(type))
     {
         return(_vectorFieldLayoutAlgorithm);
     }
     else
     {
         Debug.Assert(_r2rFieldLayoutAlgorithm != null);
         return(_r2rFieldLayoutAlgorithm);
     }
 }
예제 #3
0
 public ReadyToRunCompilerContext(TargetDetails details, SharedGenericsMode genericsMode)
     : base(details, genericsMode)
 {
     _r2rFieldLayoutAlgorithm          = new ReadyToRunMetadataFieldLayoutAlgorithm();
     _systemObjectFieldLayoutAlgorithm = new SystemObjectFieldLayoutAlgorithm(_r2rFieldLayoutAlgorithm);
     _vectorFieldLayoutAlgorithm       = new VectorFieldLayoutAlgorithm(_r2rFieldLayoutAlgorithm);
 }
예제 #4
0
 public override FieldLayoutAlgorithm GetLayoutAlgorithmForType(DefType type)
 {
     if (type == UniversalCanonType)
     {
         return(UniversalCanonLayoutAlgorithm.Instance);
     }
     else if (type.IsRuntimeDeterminedType)
     {
         return(_runtimeDeterminedFieldLayoutAlgorithm);
     }
     else if (VectorOfTFieldLayoutAlgorithm.IsVectorOfTType(type))
     {
         return(_vectorOfTFieldLayoutAlgorithm);
     }
     else if (VectorFieldLayoutAlgorithm.IsVectorType(type))
     {
         return(_vectorFieldLayoutAlgorithm);
     }
     else if (Int128FieldLayoutAlgorithm.IsIntegerType(type))
     {
         return(_int128FieldLayoutAlgorithm);
     }
     else
     {
         return(_metadataFieldLayoutAlgorithm);
     }
 }
예제 #5
0
        public CompilerTypeSystemContext(TargetDetails details, SharedGenericsMode genericsMode)
            : base(details)
        {
            _genericsMode = genericsMode;

            _vectorOfTFieldLayoutAlgorithm = new VectorOfTFieldLayoutAlgorithm(_metadataFieldLayoutAlgorithm);
            _vectorFieldLayoutAlgorithm = new VectorFieldLayoutAlgorithm(_metadataFieldLayoutAlgorithm);

            GenericsConfig = new SharedGenericsConfiguration();
        }
예제 #6
0
        public CompilerTypeSystemContext(TargetDetails details, SharedGenericsMode genericsMode, DelegateFeature delegateFeatures)
            : base(details)
        {
            _genericsMode = genericsMode;

            _vectorOfTFieldLayoutAlgorithm = new VectorOfTFieldLayoutAlgorithm(_metadataFieldLayoutAlgorithm);
            _vectorFieldLayoutAlgorithm    = new VectorFieldLayoutAlgorithm(_metadataFieldLayoutAlgorithm);

            _delegateInfoHashtable = new DelegateInfoHashtable(delegateFeatures);

            GenericsConfig = new SharedGenericsConfiguration();
        }
예제 #7
0
 public override FieldLayoutAlgorithm GetLayoutAlgorithmForType(DefType type)
 {
     if (type == UniversalCanonType)
         return UniversalCanonLayoutAlgorithm.Instance;
     else if (type.IsRuntimeDeterminedType)
         return _runtimeDeterminedFieldLayoutAlgorithm;
     else if (_simdHelper.IsVectorOfT(type))
         return _vectorOfTFieldLayoutAlgorithm;
     else if (VectorFieldLayoutAlgorithm.IsVectorType(type))
         return _vectorFieldLayoutAlgorithm;
     else
         return _metadataFieldLayoutAlgorithm;
 }
예제 #8
0
        public CompilerTypeSystemContext(TargetDetails details, SharedGenericsMode genericsMode, DelegateFeature delegateFeatures, int genericCycleCutoffPoint = DefaultGenericCycleCutoffPoint)
            : base(details)
        {
            _genericsMode = genericsMode;

            _vectorOfTFieldLayoutAlgorithm = new VectorOfTFieldLayoutAlgorithm(_metadataFieldLayoutAlgorithm);
            _vectorFieldLayoutAlgorithm    = new VectorFieldLayoutAlgorithm(_metadataFieldLayoutAlgorithm);

            _delegateInfoHashtable = new DelegateInfoHashtable(delegateFeatures);

            _genericCycleDetector = new LazyGenericsSupport.GenericCycleDetector(genericCycleCutoffPoint);

            GenericsConfig = new SharedGenericsConfiguration();
        }
        public ReadyToRunCompilerContext(TargetDetails details, SharedGenericsMode genericsMode)
            : base(details, genericsMode)
        {
            _r2rFieldLayoutAlgorithm          = new ReadyToRunMetadataFieldLayoutAlgorithm();
            _systemObjectFieldLayoutAlgorithm = new SystemObjectFieldLayoutAlgorithm(_r2rFieldLayoutAlgorithm);
            _vectorFieldLayoutAlgorithm       = new VectorFieldLayoutAlgorithm(_r2rFieldLayoutAlgorithm);

            string matchingVectorType = "Unknown";

            if (details.MaximumSimdVectorLength == SimdVectorLength.Vector128Bit)
            {
                matchingVectorType = "Vector128`1";
            }
            else if (details.MaximumSimdVectorLength == SimdVectorLength.Vector256Bit)
            {
                matchingVectorType = "Vector256`1";
            }

            _vectorOfTFieldLayoutAlgorithm = new VectorOfTFieldLayoutAlgorithm(_r2rFieldLayoutAlgorithm, _vectorFieldLayoutAlgorithm, matchingVectorType);
        }