Ejemplo n.º 1
0
        /// <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,
        }
Ejemplo n.º 2
0
 public static CompilerPipeline AdjustPipeline(EvaluationContext context, CompilerPipeline pipeline)
 {
     pipeline.InsertAfter(typeof(IntroduceUnityGlobalNamespaces), new IntroduceScriptingNamespace(context));
     pipeline.InsertAfter(typeof(IntroduceScriptingNamespace), new IntroduceImports(context));
     pipeline.InsertAfter(typeof(ApplySemantics), new IntroduceEvaluationContext(context));
     pipeline.Replace(typeof(ProcessUnityScriptMethods), new ProcessScriptingMethods(context));
     pipeline.InsertAfter(typeof(ProcessScriptingMethods), new IntroduceReturnValue());
     return(pipeline);
 }
 public static CompilerPipeline AdjustBooPipeline(CompilerPipeline pipeline)
 {
     pipeline.Insert(0, new PreProcess());
     pipeline.Replace(typeof(Parsing), new UnityScript.Steps.Parse());
     pipeline.Replace(typeof(IntroduceGlobalNamespaces), new IntroduceUnityGlobalNamespaces());
     pipeline.InsertAfter(typeof(PreErrorChecking), new ApplySemantics());
     pipeline.InsertAfter(typeof(ApplySemantics), new ApplyDefaultVisibility());
     pipeline.InsertBefore(typeof(ExpandDuckTypedExpressions), new ProcessAssignmentToDuckMembers());
     pipeline.Replace(typeof(ProcessMethodBodiesWithDuckTyping), new ProcessUnityScriptMethods());
     pipeline.InsertAfter(typeof(ProcessUnityScriptMethods), new AutoExplodeVarArgsInvocations());
     pipeline.InsertAfter(typeof(ProcessUnityScriptMethods), new ProcessEvalInvocations());
     pipeline.ReplaceOptional(typeof(ExpandDuckTypedExpressions), new ExpandUnityDuckTypedExpressions());
     pipeline.InsertBefore(typeof(EmitAssembly), new Lint());
     pipeline.InsertBefore(typeof(EmitAssembly), new EnableRawArrayIndexing());
     pipeline.InsertAfter(typeof(BindBaseTypes), new CheckBaseTypes());
     return(pipeline);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Customise the compiler to fit the etl engine
        /// </summary>
        protected override void CustomizeCompiler(BooCompiler compiler, CompilerPipeline pipeline, string[] urls)
        {
            compiler.Parameters.References.Add(typeof(EtlDslEngine).Assembly);
            compiler.Parameters.References.Add(typeof(EtlProcess).Assembly);
            pipeline.Insert(1, new AutoReferenceFilesCompilerStep());
            pipeline.Insert(2, new UseModuleNameAsNamespaceIfMissing());
            pipeline.Insert(3, new AutoImportCompilerStep(_namespaces));

            pipeline.InsertAfter(typeof(MacroAndAttributeExpansion),
                                 new CorrelateTypesToModuleName(moduleNameToContainedTypes));
        }
Ejemplo n.º 5
0
        /// <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,
        }