当前位置: 首页>>代码示例>>C#>>正文


C# CompilerPipeline类代码示例

本文整理汇总了C#中CompilerPipeline的典型用法代码示例。如果您正苦于以下问题:C# CompilerPipeline类的具体用法?C# CompilerPipeline怎么用?C# CompilerPipeline使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CompilerPipeline类属于命名空间,在下文中一共展示了CompilerPipeline类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BaseMethodCompiler

        /// <summary>
        /// Initializes a new instance of the <see cref="BaseMethodCompiler" /> class.
        /// </summary>
        /// <param name="compiler">The assembly compiler.</param>
        /// <param name="method">The method to compile by this instance.</param>
        /// <param name="basicBlocks">The basic blocks.</param>
        /// <param name="threadID">The thread identifier.</param>
        protected BaseMethodCompiler(BaseCompiler compiler, MosaMethod method, BasicBlocks basicBlocks, int threadID)
        {
            Compiler = compiler;
            Method = method;
            Type = method.DeclaringType;
            Scheduler = compiler.CompilationScheduler;
            Architecture = compiler.Architecture;
            TypeSystem = compiler.TypeSystem;
            TypeLayout = compiler.TypeLayout;
            Trace = compiler.CompilerTrace;
            Linker = compiler.Linker;
            BasicBlocks = basicBlocks ?? new BasicBlocks();
            Pipeline = new CompilerPipeline();
            StackLayout = new StackLayout(Architecture, method.Signature.Parameters.Count + (method.HasThis || method.HasExplicitThis ? 1 : 0));
            VirtualRegisters = new VirtualRegisters(Architecture);
            LocalVariables = emptyOperandList;
            ThreadID = threadID;
            DominanceAnalysis = new Dominance(Compiler.CompilerOptions.DominanceAnalysisFactory, BasicBlocks);
            PluggedMethod = compiler.PlugSystem.GetPlugMethod(Method);
            stop = false;

            MethodData = compiler.CompilerData.GetCompilerMethodData(Method);
            MethodData.Counters.Clear();

            EvaluateParameterOperands();
        }
开发者ID:Profi-Concept,项目名称:MOSA-Project,代码行数:33,代码来源:BaseMethodCompiler.cs

示例2: AssemblyCompiler

        /// <summary>
        /// Initializes a new compiler instance.
        /// </summary>
        /// <param name="architecture">The compiler target architecture.</param>
        /// <param name="typeSystem">The type system.</param>
        protected AssemblyCompiler(IArchitecture architecture, ITypeSystem typeSystem)
        {
            if (architecture == null)
                throw new ArgumentNullException(@"architecture");

            this.architecture = architecture;
            this.pipeline = new CompilerPipeline();
            this.typeSystem = typeSystem;
        }
开发者ID:illuminus86,项目名称:MOSA-Project,代码行数:14,代码来源:AssemblyCompiler.cs

示例3: AssemblyCompiler

        /// <summary>
        /// Initializes a new compiler instance.
        /// </summary>
        /// <param name="architecture">The compiler target architecture.</param>
        /// <param name="assembly">The assembly of this compiler.</param>
        /// <exception cref="System.ArgumentNullException">Either <paramref name="architecture"/> or <paramref name="assembly"/> is null.</exception>
        protected AssemblyCompiler(IArchitecture architecture, IMetadataModule assembly)
        {
            if (architecture == null)
                throw new ArgumentNullException(@"architecture");

            _architecture = architecture;
            _assembly = assembly;
            _pipeline = new CompilerPipeline();
        }
开发者ID:hj1980,项目名称:MOSA-Project,代码行数:15,代码来源:AssemblyCompiler.cs

示例4: AssemblyCompiler

        /// <summary>
        /// Initializes a new compiler instance.
        /// </summary>
        /// <param name="architecture">The compiler target architecture.</param>
        /// <param name="typeSystem">The type system.</param>
        protected AssemblyCompiler(IArchitecture architecture, ITypeSystem typeSystem, ITypeLayout typeLayout, IInternalTrace internalTrace, CompilerOptions compilerOptions)
        {
            if (architecture == null)
                throw new ArgumentNullException(@"architecture");

            this.pipeline = new CompilerPipeline();
            this.architecture = architecture;
            this.typeSystem = typeSystem;
            this.typeLayout = typeLayout;
            this.internalTrace = internalTrace;
            this.compilerOptions = compilerOptions;
            this.genericTypePatcher = new GenericTypePatcher(typeSystem);
        }
开发者ID:GeroL,项目名称:MOSA-Project,代码行数:18,代码来源:AssemblyCompiler.cs

示例5: BaseCompiler

        /// <summary>
        /// Initializes a new compiler instance.
        /// </summary>
        /// <param name="architecture">The compiler target architecture.</param>
        /// <param name="typeSystem">The type system.</param>
        /// <param name="typeLayout">The type layout.</param>
        /// <param name="compilationScheduler">The compilation scheduler.</param>
        /// <param name="compilerTrace">The compiler trace.</param>
        /// <param name="linker">The linker.</param>
        /// <param name="compilerOptions">The compiler options.</param>
        /// <exception cref="System.ArgumentNullException">@Architecture</exception>
        protected BaseCompiler(BaseArchitecture architecture, TypeSystem typeSystem, MosaTypeLayout typeLayout, ICompilationScheduler compilationScheduler, CompilerTrace compilerTrace, BaseLinker linker, CompilerOptions compilerOptions)
        {
            if (architecture == null)
                throw new ArgumentNullException(@"Architecture");

            Pipeline = new CompilerPipeline();
            Architecture = architecture;
            TypeSystem = typeSystem;
            TypeLayout = typeLayout;
            CompilerTrace = compilerTrace;
            CompilerOptions = compilerOptions;
            Counters = new Counters();
            CompilationScheduler = compilationScheduler;
            PlugSystem = new PlugSystem();
            Linker = linker;

            if (Linker == null)
            {
                Linker = compilerOptions.LinkerFactory();
                Linker.Initialize(compilerOptions.BaseAddress, architecture.Endianness, architecture.ElfMachineType);
            }

            // Create new dictionary
            IntrinsicTypes = new Dictionary<string, Type>();

            // Get all the classes that implement the IIntrinsicInternalMethod interface
            IEnumerable<Type> types = AppDomain.CurrentDomain.GetAssemblies()
                .SelectMany(s => s.GetTypes())
                .Where(p => typeof(IIntrinsicInternalMethod).IsAssignableFrom(p) && p.IsClass);

            // Iterate through all the found types
            foreach (var t in types)
            {
                // Now get all the ReplacementTarget attributes
                var attributes = (ReplacementTargetAttribute[])t.GetCustomAttributes(typeof(ReplacementTargetAttribute), true);
                for (int i = 0; i < attributes.Length; i++)
                {
                    // Finally add the dictionary entry mapping the target string and the type
                    IntrinsicTypes.Add(attributes[i].Target, t);
                }
            }

            PlatformInternalRuntimeType = GetPlatformInternalRuntimeType();
        }
开发者ID:Boddlnagg,项目名称:MOSA-Project,代码行数:55,代码来源:BaseCompiler.cs

示例6: BaseCompiler

        /// <summary>
        /// Initializes a new compiler instance.
        /// </summary>
        /// <param name="architecture">The compiler target architecture.</param>
        /// <param name="typeSystem">The type system.</param>
        /// <param name="typeLayout">The type layout.</param>
        /// <param name="compilationScheduler">The compilation scheduler.</param>
        /// <param name="internalTrace">The internal trace.</param>
        /// <param name="compilerOptions">The compiler options.</param>
        protected BaseCompiler(BaseArchitecture architecture, TypeSystem typeSystem, MosaTypeLayout typeLayout, ICompilationScheduler compilationScheduler, IInternalTrace internalTrace, ILinker linker, CompilerOptions compilerOptions)
        {
            if (architecture == null)
                throw new ArgumentNullException(@"Architecture");

            Pipeline = new CompilerPipeline();
            Architecture = architecture;
            TypeSystem = typeSystem;
            TypeLayout = typeLayout;
            InternalTrace = internalTrace;
            CompilerOptions = compilerOptions;
            Counters = new Counters();
            CompilationScheduler = compilationScheduler;
            PlugSystem = new PlugSystem();
            Linker = linker;

            if (Linker == null)
            {
                Linker = compilerOptions.LinkerFactory();
                Linker.Initialize(compilerOptions.OutputFile, architecture.Endianness, architecture.ElfMachineType);
            }
        }
开发者ID:tea,项目名称:MOSA-Project,代码行数:31,代码来源:BaseCompiler.cs

示例7: ExtendMethodCompilerPipeline

 /// <summary>
 /// Extends the method compiler pipeline with ARM specific stages.
 /// </summary>
 /// <param name="methodCompilerPipeline">The method compiler pipeline to extend.</param>
 public override void ExtendMethodCompilerPipeline(CompilerPipeline methodCompilerPipeline)
 {
 }
开发者ID:pdelprat,项目名称:MOSA-Project,代码行数:7,代码来源:Architecture.cs

示例8: ExtendMethodCompilerPipeline

        /// <summary>
        /// Extends the method compiler pipeline with x86 specific stages.
        /// </summary>
        /// <param name="methodCompilerPipeline">The method compiler pipeline to extend.</param>
        public override void ExtendMethodCompilerPipeline(CompilerPipeline methodCompilerPipeline)
        {
            // FIXME: Create a specific code generator instance using requested feature flags.
            // FIXME: Add some more optimization passes, which take advantage of advanced x86 instructions
            // and packed operations available with MMX/SSE extensions
            methodCompilerPipeline.InsertAfter<PlatformStubStage>(
                new IMethodCompilerStage[]
                {
                    //InstructionLogger.Instance,
                    new LongOperandTransformationStage(),
                    //InstructionLogger.Instance,
                    new AddressModeConversionStage(),
                    //InstructionLogger.Instance,
                    new IRTransformationStage(),
                    //InstructionLogger.Instance,
                    new TweakTransformationStage(),
                    //InstructionLogger.Instance,
                    new MemToMemConversionStage(),
                    //InstructionLogger.Instance,
                    new ExceptionHeaderPreprocessingStage(),
                });

            methodCompilerPipeline.InsertAfter<IBlockOrderStage>(
                new IMethodCompilerStage[]
                {
                    new SimplePeepholeOptimizationStage(),
                    //InstructionLogger.Instance,
                });

            //FlowGraphVisualizationStage.Instance,
        }
开发者ID:davidleon,项目名称:MOSA-Project,代码行数:35,代码来源:Architecture.cs

示例9: ExtendAssemblyCompilerPipeline

        /// <summary>
        /// Extends the assembly compiler pipeline with ARM specific stages.
        /// </summary>
        /// <param name="assemblyCompilerPipeline">The assembly compiler pipeline to extend.</param>
        public override void ExtendAssemblyCompilerPipeline(CompilerPipeline assemblyCompilerPipeline)
        {
            //assemblyCompilerPipeline.InsertAfterFirst<IAssemblyCompilerStage>(
            //    new InterruptVectorStage()
            //);

            //assemblyCompilerPipeline.InsertAfterFirst<InterruptVectorStage>(
            //    new ExceptionVectorStage()
            //);

            //assemblyCompilerPipeline.InsertAfterLast<TypeLayoutStage>(
            //    new MethodTableBuilderStage()
            //);
        }
开发者ID:GeroL,项目名称:MOSA-Project,代码行数:18,代码来源:Architecture.cs

示例10: ExtendAssemblyCompilerPipeline

 /// <summary>
 /// Extends the assembly compiler pipeline with architecture specific assembly compiler stages.
 /// </summary>
 /// <param name="assemblyPipeline">The pipeline to extend.</param>
 public abstract void ExtendAssemblyCompilerPipeline(CompilerPipeline assemblyPipeline);
开发者ID:davidleon,项目名称:MOSA-Project,代码行数:5,代码来源:BasicArchitecture.cs

示例11: CompilerBase

 /// <summary>
 /// Initializes a new instance of.
 /// </summary>
 protected CompilerBase()
 {
     _pipeline = new CompilerPipeline();
 }
开发者ID:rtownsend,项目名称:MOSA-Project,代码行数:7,代码来源:CompilerBase.cs

示例12: ExtendPreCompilerPipeline

        /// <summary>
        /// Extends the pre-compiler pipeline with x86 compiler stages.
        /// </summary>
        /// <param name="compilerPipeline">The pipeline to extend.</param>
        public override void ExtendPreCompilerPipeline(CompilerPipeline compilerPipeline)
        {
            compilerPipeline.InsertAfterFirst<ICompilerStage>(
                new InterruptVectorStage()
            );

            compilerPipeline.InsertAfterLast<ICompilerStage>(
                new SSESetupStage()
            );
        }
开发者ID:Profi-Concept,项目名称:MOSA-Project,代码行数:14,代码来源:Architecture.cs

示例13: ExtendCompilerPipeline

        /// <summary>
        /// Extends the compiler pipeline with x86 specific stages.
        /// </summary>
        /// <param name="compilerPipeline">The pipeline to extend.</param>
        public override void ExtendCompilerPipeline(CompilerPipeline compilerPipeline)
        {
            compilerPipeline.InsertAfterFirst<ICompilerStage>(
                new InterruptVectorStage()
            );

            compilerPipeline.InsertAfterFirst<InterruptVectorStage>(
                new ExceptionVectorStage()
            );

            compilerPipeline.InsertAfterLast<TypeLayoutStage>(
                new MethodTableBuilderStage()
            );
        }
开发者ID:pdelprat,项目名称:MOSA-Project,代码行数:18,代码来源:Architecture.cs

示例14: ExtendCompilerPipeline

        /// <summary>
        /// Extends the pre-compiler pipeline with x86 compiler stages.
        /// </summary>
        /// <param name="compilerPipeline">The pipeline to extend.</param>
        public override void ExtendCompilerPipeline(CompilerPipeline compilerPipeline)
        {
            compilerPipeline.Add(
                new StartUpStage()
            );

            compilerPipeline.Add(
                new InterruptVectorStage()
            );

            compilerPipeline.Add(
                new SSEInitStage()
            );
        }
开发者ID:tgiphil,项目名称:MOSA-Project,代码行数:18,代码来源:Architecture.cs

示例15: BaseMethodCompiler

        /// <summary>
        /// Initializes a new instance of the <see cref="BaseMethodCompiler"/> class.
        /// </summary>
        /// <param name="compiler">The assembly compiler.</param>
        /// <param name="method">The method to compile by this instance.</param>
        /// <param name="instructionSet">The instruction set.</param>
        protected BaseMethodCompiler(BaseCompiler compiler, RuntimeMethod method, InstructionSet instructionSet)
        {
            this.compiler = compiler;
            this.method = method;
            this.type = method.DeclaringType;
            this.compilationScheduler = compiler.Scheduler;
            this.moduleTypeSystem = method.Module;
            this.architecture = compiler.Architecture;
            this.typeSystem = compiler.TypeSystem;
            this.typeLayout = Compiler.TypeLayout;
            this.internalTrace = Compiler.InternalTrace;
            this.linker = compiler.Linker;

            this.basicBlocks = new BasicBlocks();

            this.instructionSet = instructionSet ?? new InstructionSet(256);

            this.pipeline = new CompilerPipeline();

            this.stackLayout = new StackLayout(architecture, method.Parameters.Count + (method.Signature.HasThis || method.Signature.HasExplicitThis ? 1 : 0));

            this.virtualRegisterLayout = new VirtualRegisterLayout(architecture, stackLayout);

            EvaluateParameterOperands();

            this.stopMethodCompiler = false;
        }
开发者ID:pdelprat,项目名称:MOSA-Project,代码行数:33,代码来源:BaseMethodCompiler.cs


注:本文中的CompilerPipeline类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。