• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CompilerPipeline类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: 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.AddRange (new IMethodCompilerStage[] {
         new LongOperandTransformationStage (),
         new InstructionLogger (typeof(LongOperandTransformationStage)),
         new AddressModeConversionStage (),
         new InstructionLogger (typeof(AddressModeConversionStage)),
         new CILTransformationStage (),
         new InstructionLogger (typeof(CILTransformationStage)),
         new IRTransformationStage (),
         new InstructionLogger (typeof(IRTransformationStage)),
         new TweakTransformationStage (),
         new InstructionLogger (typeof(TweakTransformationStage)),
         new MemToMemConversionStage (),
         new InstructionLogger (typeof(MemToMemConversionStage)),
         new SimplePeepholeOptimizationStage (),
         new InstructionLogger (typeof(SimplePeepholeOptimizationStage))
         //FlowGraphVisualizationStage.Instance,
     });
 }
开发者ID:hj1980,项目名称:Mosa,代码行数:27,代码来源:Architecture.cs


示例17: ExtendMethodCompilerPipeline

        /// <summary>
        /// Extends the method compiler pipeline with ARMv6 specific stages.
        /// </summary>
        /// <param name="methodCompilerPipeline">The method compiler pipeline to extend.</param>
        public override void ExtendMethodCompilerPipeline(CompilerPipeline methodCompilerPipeline)
        {
            methodCompilerPipeline.InsertAfterLast<PlatformStubStage>(
                new IMethodCompilerStage[]
                {
                    //new LongOperandTransformationStage(),
                    new IRTransformationStage(),
                });

            //methodCompilerPipeline.InsertAfterLast<CodeGenerationStage>(
            //    new ExceptionLayoutStage()
            //);

            methodCompilerPipeline.InsertBefore<GreedyRegisterAllocatorStage>(
                new StopStage()
            );
        }
开发者ID:charsleysa,项目名称:MOSA-Project,代码行数:21,代码来源:Architecture.cs


示例18: ExtendCompilerPipeline

 /// <summary>
 /// Extends the assembly compiler pipeline with ARMv6 specific stages.
 /// </summary>
 /// <param name="compilerPipeline">The pipeline to extend.</param>
 public override void ExtendCompilerPipeline(CompilerPipeline compilerPipeline)
 {
     // TODO
 }
开发者ID:charsleysa,项目名称:MOSA-Project,代码行数:8,代码来源:Architecture.cs


示例19: 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)
        {
            methodCompilerPipeline.InsertAfterLast<PlatformStubStage>(
                new IMethodCompilerStage[]
                {
                    //new CheckOperandCountStage(),
                    new PlatformIntrinsicStage(),
                    new LongOperandTransformationStage(),

                    //new StopStage(),

                    new IRTransformationStage(),
                    new TweakTransformationStage(),

                    new FixedRegisterAssignmentStage(),
                    new SimpleDeadCodeRemovalStage(),
                    new AddressModeConversionStage(),
                    new FloatingPointStage(),
                });

            methodCompilerPipeline.InsertAfterLast<StackLayoutStage>(
                new BuildStackStage()
            );

            methodCompilerPipeline.InsertBefore<CodeGenerationStage>(
                new FinalTweakTransformationStage()
            );

            methodCompilerPipeline.InsertBefore<CodeGenerationStage>(
                new JumpOptimizationStage()
            );
        }
开发者ID:Profi-Concept,项目名称:MOSA-Project,代码行数:36,代码来源:Architecture.cs


示例20: ExtendPostCompilerPipeline

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CompletionDataCollector类代码示例发布时间:2022-05-24
下一篇:
C# CompilerOptions类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap