예제 #1
0
        public Compilation(CompilationOptions options, CompilerTypeSystemContext context, CompilationModuleGroup compilationGroup)
        {
            _options = options;

            _nameMangler = new NameMangler(options.IsCppCodeGen);

            _typeSystemContext = context;
            _compilationModuleGroup = compilationGroup;
        }
예제 #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);
            }
        }
예제 #3
0
 public PreinitializationInfoHashtable(CompilationModuleGroup compilationGroup, ILProvider ilProvider)
 {
     _compilationGroup = compilationGroup;
     _ilProvider       = ilProvider;
 }
예제 #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);
        }
예제 #5
0
 public void SetCompilationGroup(CompilationModuleGroup compilationModuleGroup)
 {
     _r2rFieldLayoutAlgorithm.SetCompilationGroup(compilationModuleGroup);
 }
예제 #6
0
 public RyuJitCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group)
     : base(new RyuJitNodeFactory(context, group))
 {
 }
예제 #7
0
 public ILScannerBuilder GetILScannerBuilder(CompilationModuleGroup compilationGroup = null)
 {
     return(new ILScannerBuilder(_context, compilationGroup ?? _compilationGroup, _nameMangler));
 }
예제 #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));
 }
예제 #9
0
 public RyuJitCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group)
     : base(context, group,
            new CoreRTNameMangler(context.Target.IsWindows ? (NodeMangler) new WindowsNodeMangler() : (NodeMangler) new UnixNodeMangler(), false))
 {
 }
예제 #10
0
 internal ILScannerBuilder(CompilerTypeSystemContext context, CompilationModuleGroup compilationGroup, NameMangler mangler)
 {
     _context          = context;
     _compilationGroup = compilationGroup;
     _nameMangler      = mangler;
 }
예제 #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);
        }
예제 #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));
            }
        }
예제 #13
0
 public EmptyMetadataManager(CompilationModuleGroup group, CompilerTypeSystemContext typeSystemContext)
     : base(group, typeSystemContext, new FullyBlockedMetadataPolicy(), new NoStackTraceEmissionPolicy())
 {
 }
예제 #14
0
 public MetadataManager(CompilationModuleGroup compilationModuleGroup, CompilerTypeSystemContext typeSystemContext, MetadataBlockingPolicy blockingPolicy)
 {
     _compilationModuleGroup = compilationModuleGroup;
     _typeSystemContext      = typeSystemContext;
     _blockingPolicy         = blockingPolicy;
 }
예제 #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()));
     }
 }
예제 #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;
 }
예제 #17
0
 public MetadataManager(CompilationModuleGroup compilationModuleGroup, CompilerTypeSystemContext typeSystemContext)
 {
     _compilationModuleGroup = compilationModuleGroup;
     _typeSystemContext      = typeSystemContext;
 }
예제 #18
0
 public InteropStubManager(CompilationModuleGroup compilationModuleGroup, CompilerTypeSystemContext typeSystemContext, InteropStateManager interopStateManager)
 {
     _compilationModuleGroup = compilationModuleGroup;
     _typeSystemContext      = typeSystemContext;
     InteropStateManager     = interopStateManager;
 }
예제 #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)
 {
 }
예제 #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))
 {
 }
예제 #23
0
 public CppCodegenCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group)
     : base(new CppCodegenNodeFactory(context, group))
 {
 }
예제 #24
0
 public EmptyMetadataManager(CompilationModuleGroup group, CompilerTypeSystemContext typeSystemContext) : base(group, typeSystemContext)
 {
 }
예제 #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);
 }
예제 #27
0
 public CppCodegenCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group)
     : base(context, group, new CoreRTNameMangler(new CppNodeMangler(), true))
 {
 }
예제 #28
0
 public RyuJitCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group)
     : base(new RyuJitNodeFactory(context, group))
 {
 }
예제 #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);
        }
 public CppCodegenCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group)
     : base(new CppCodegenNodeFactory(context, group))
 {
 }
 public RyuJitCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group)
     : base(context, group)
 {
 }
예제 #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;
 }
예제 #34
0
        public Compilation(CompilationOptions options, CompilerTypeSystemContext context, CompilationModuleGroup compilationGroup)
        {
            _options = options;

            _nameMangler = new NameMangler(options.IsCppCodeGen);

            _typeSystemContext      = context;
            _compilationModuleGroup = compilationGroup;
        }