Ejemplo n.º 1
0
        public Compilation(CompilationOptions options, CompilerTypeSystemContext context, CompilationModuleGroup compilationGroup)
        {
            _options = options;

            _nameMangler = new NameMangler(options.IsCppCodeGen);

            _typeSystemContext = context;
            _compilationModuleGroup = compilationGroup;
        }
Ejemplo n.º 2
0
        public Compilation(CompilationOptions options)
        {
            _options = options;

            _typeSystemContext = new CompilerTypeSystemContext(new TargetDetails(options.TargetArchitecture, options.TargetOS));
            _typeSystemContext.InputFilePaths = options.InputFilePaths;
            _typeSystemContext.ReferenceFilePaths = options.ReferenceFilePaths;

            _typeSystemContext.SetSystemModule(_typeSystemContext.GetModuleForSimpleName(options.SystemModuleName));

            _nameMangler = new NameMangler(this);

            _typeInitManager = new TypeInitialization();

            if (options.MultiFile)
            {
                _compilationModuleGroup = new MultiFileCompilationModuleGroup(_typeSystemContext, this);
            }
            else
            {
                _compilationModuleGroup = new SingleFileCompilationModuleGroup(_typeSystemContext, this);
            }
        }
Ejemplo n.º 3
0
 public PreinitializationInfoHashtable(CompilationModuleGroup compilationGroup, ILProvider ilProvider)
 {
     _compilationGroup = compilationGroup;
     _ilProvider       = ilProvider;
 }
Ejemplo n.º 4
0
        public ReadyToRunCodegenCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group, string inputFilePath)
            : base(context, group, new CoreRTNameMangler())
        {
            _inputFilePath = inputFilePath;
            _inputModule   = context.GetModuleFromPath(_inputFilePath);

            // R2R field layout needs compilation group information
            ((ReadyToRunCompilerContext)context).SetCompilationGroup(group);
        }
Ejemplo n.º 5
0
 public void SetCompilationGroup(CompilationModuleGroup compilationModuleGroup)
 {
     _r2rFieldLayoutAlgorithm.SetCompilationGroup(compilationModuleGroup);
 }
Ejemplo n.º 6
0
 public RyuJitCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group)
     : base(new RyuJitNodeFactory(context, group))
 {
 }
Ejemplo n.º 7
0
 public ILScannerBuilder GetILScannerBuilder(CompilationModuleGroup compilationGroup = null)
 {
     return(new ILScannerBuilder(_context, compilationGroup ?? _compilationGroup, _nameMangler));
 }
Ejemplo n.º 8
0
 private static InteropStubManager NewEmptyInteropStubManager(CompilerTypeSystemContext context, CompilationModuleGroup compilationModuleGroup)
 {
     // On Project N, the compiler doesn't generate the interop code on the fly
     return(new EmptyInteropStubManager(compilationModuleGroup, context, null));
 }
Ejemplo n.º 9
0
 public RyuJitCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group)
     : base(context, group,
            new CoreRTNameMangler(context.Target.IsWindows ? (NodeMangler) new WindowsNodeMangler() : (NodeMangler) new UnixNodeMangler(), false))
 {
 }
Ejemplo n.º 10
0
 internal ILScannerBuilder(CompilerTypeSystemContext context, CompilationModuleGroup compilationGroup, NameMangler mangler)
 {
     _context          = context;
     _compilationGroup = compilationGroup;
     _nameMangler      = mangler;
 }
Ejemplo n.º 11
0
        public ReadyToRunCodegenCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group, string inputFilePath)
            : base(context, group, new CoreRTNameMangler(new ReadyToRunNodeMangler(), false))
        {
            _inputFilePath           = inputFilePath;
            _devirtualizationManager = new DependencyAnalysis.ReadyToRun.DevirtualizationManager(group);

            _inputModule = context.GetModuleFromPath(_inputFilePath);
        }
Ejemplo n.º 12
0
        private static MetadataManager PickMetadataManager(CompilerTypeSystemContext context, CompilationModuleGroup compilationModuleGroup, IEnumerable <ModuleDesc> inputModules, IEnumerable <ModuleDesc> inputMetadataOnlyAssemblies, string metadataFile, bool emitStackTraceMetadata, bool disableExceptionMessages, bool disableInvokeThunks)
        {
            if (metadataFile == null)
            {
                return(new EmptyMetadataManager(context));
            }
            else
            {
                // Set Policies according to passed arguments
                StackTraceEmissionPolicy stackTraceEmissionPolicy;
                if (emitStackTraceMetadata)
                {
                    stackTraceEmissionPolicy = new UtcStackTraceEmissionPolicy();
                }
                else
                {
                    stackTraceEmissionPolicy = new NoStackTraceEmissionPolicy();
                }

                ManifestResourceBlockingPolicy resourceBlockingPolicy;
                if (disableExceptionMessages)
                {
                    resourceBlockingPolicy = new FrameworkStringResourceBlockingPolicy();
                }
                else
                {
                    resourceBlockingPolicy = new NoManifestResourceBlockingPolicy();
                }

                return(new PrecomputedMetadataManager(compilationModuleGroup, context, FindMetadataDescribingModuleInInputSet(inputModules), inputModules, inputMetadataOnlyAssemblies, ReadBytesFromFile(metadataFile), stackTraceEmissionPolicy, resourceBlockingPolicy, disableInvokeThunks));
            }
        }
Ejemplo n.º 13
0
 public EmptyMetadataManager(CompilationModuleGroup group, CompilerTypeSystemContext typeSystemContext)
     : base(group, typeSystemContext, new FullyBlockedMetadataPolicy(), new NoStackTraceEmissionPolicy())
 {
 }
Ejemplo n.º 14
0
 public MetadataManager(CompilationModuleGroup compilationModuleGroup, CompilerTypeSystemContext typeSystemContext, MetadataBlockingPolicy blockingPolicy)
 {
     _compilationModuleGroup = compilationModuleGroup;
     _typeSystemContext      = typeSystemContext;
     _blockingPolicy         = blockingPolicy;
 }
Ejemplo n.º 15
0
 private static MetadataManager PickMetadataManager(CompilerTypeSystemContext context, CompilationModuleGroup compilationModuleGroup, IEnumerable <ModuleDesc> inputModules, IEnumerable <ModuleDesc> inputMetadataOnlyAssemblies, string metadataFile)
 {
     if (metadataFile == null)
     {
         return(new EmptyMetadataManager(context));
     }
     else
     {
         return(new PrecomputedMetadataManager(compilationModuleGroup, context, FindMetadataDescribingModuleInInputSet(inputModules), inputModules, inputMetadataOnlyAssemblies, ReadBytesFromFile(metadataFile), new UtcStackTraceEmissionPolicy(), new NoManifestResourceBlockingPolicy()));
     }
 }
Ejemplo n.º 16
0
 public PreinitializationManager(TypeSystemContext context, CompilationModuleGroup compilationGroup, ILProvider ilprovider, bool enableInterpreter)
 {
     _supportsLazyCctors = context.SystemModule.GetType("System.Runtime.CompilerServices", "ClassConstructorRunner", throwIfNotFound: false) != null;
     _preinitHashTable   = new PreinitializationInfoHashtable(compilationGroup, ilprovider);
     _enableInterpreter  = enableInterpreter;
 }
Ejemplo n.º 17
0
 public MetadataManager(CompilationModuleGroup compilationModuleGroup, CompilerTypeSystemContext typeSystemContext)
 {
     _compilationModuleGroup = compilationModuleGroup;
     _typeSystemContext      = typeSystemContext;
 }
Ejemplo n.º 18
0
 public InteropStubManager(CompilationModuleGroup compilationModuleGroup, CompilerTypeSystemContext typeSystemContext, InteropStateManager interopStateManager)
 {
     _compilationModuleGroup = compilationModuleGroup;
     _typeSystemContext      = typeSystemContext;
     InteropStateManager     = interopStateManager;
 }
Ejemplo n.º 19
0
 private static MetadataManager PickMetadataManager(CompilerTypeSystemContext context, CompilationModuleGroup compilationModuleGroup, IEnumerable <ModuleDesc> inputModules, string metadataFile)
 {
     if (metadataFile == null)
     {
         return(new EmptyMetadataManager(compilationModuleGroup, context));
     }
     else
     {
         return(new PrecomputedMetadataManager(compilationModuleGroup, context, FindMetadataDescribingModuleInInputSet(inputModules), inputModules, ReadBytesFromFile(metadataFile)));
     }
 }
 public CompilerGeneratedInteropStubManager(CompilationModuleGroup compilationModuleGroup, CompilerTypeSystemContext typeSystemContext, InteropStateManager interopStateManager) :
     base(compilationModuleGroup, typeSystemContext, interopStateManager)
 {
 }
Ejemplo n.º 21
0
 public CompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup compilationGroup)
 {
     _context          = context;
     _compilationGroup = compilationGroup;
 }
 public WebAssemblyCodegenCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group)
     : base(context, group, new CoreRTNameMangler(new WebAssemblyNodeMangler(), false))
 {
 }
Ejemplo n.º 23
0
 public CppCodegenCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group)
     : base(new CppCodegenNodeFactory(context, group))
 {
 }
Ejemplo n.º 24
0
 public EmptyMetadataManager(CompilationModuleGroup group, CompilerTypeSystemContext typeSystemContext) : base(group, typeSystemContext)
 {
 }
Ejemplo n.º 25
0
 public CompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup compilationGroup, NameMangler nameMangler)
 {
     _context          = context;
     _compilationGroup = compilationGroup;
     _nameMangler      = nameMangler;
 }
 public CompilerGeneratedMetadataManager(CompilationModuleGroup group, CompilerTypeSystemContext typeSystemContext) : base(group, typeSystemContext)
 {
     _metadataPolicy = new GeneratedTypesAndCodeMetadataPolicy(this);
 }
Ejemplo n.º 27
0
 public CppCodegenCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group)
     : base(context, group, new CoreRTNameMangler(new CppNodeMangler(), true))
 {
 }
Ejemplo n.º 28
0
 public RyuJitCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group)
     : base(new RyuJitNodeFactory(context, group))
 {
 }
Ejemplo n.º 29
0
 public ILCache(ILProvider provider, CompilationModuleGroup compilationModuleGroup)
 {
     ILProvider = provider;
     _compilationModuleGroup = compilationModuleGroup;
 }
        public ReadyToRunCodegenCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group, IEnumerable <string> inputFiles)
            : base(context, group, new CoreRTNameMangler())
        {
            _inputFiles = inputFiles;

            // R2R field layout needs compilation group information
            ((ReadyToRunCompilerContext)context).SetCompilationGroup(group);
        }
Ejemplo n.º 31
0
 public CppCodegenCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group)
     : base(new CppCodegenNodeFactory(context, group))
 {
 }
Ejemplo n.º 32
0
 public RyuJitCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group)
     : base(context, group)
 {
 }
Ejemplo n.º 33
0
 /// <summary>
 /// Set up compilation group needed for proper calculation of base class alignment in auto layout.
 /// </summary>
 /// <param name="compilationGroup"></param>
 public void SetCompilationGroup(CompilationModuleGroup compilationGroup)
 {
     _compilationGroup = compilationGroup;
 }
Ejemplo n.º 34
0
        public Compilation(CompilationOptions options, CompilerTypeSystemContext context, CompilationModuleGroup compilationGroup)
        {
            _options = options;

            _nameMangler = new NameMangler(options.IsCppCodeGen);

            _typeSystemContext      = context;
            _compilationModuleGroup = compilationGroup;
        }