Beispiel #1
0
        private static List <BaseMethodCompilerStage> GetDefaultMethodPipeline(CompilerSettings compilerSettings, bool is64BitPlatform)
        {
            return(new List <BaseMethodCompilerStage>()
            {
                new CILDecodingStage(),
                new CILOperandAssignmentStage(),
                new CILProtectedRegionStage(),
                new CILTransformationStage(),
                new ExceptionStage(),
                new StackSetupStage(),
                new StaticAllocationResolutionStage(),
                new DevirtualizeCallStage(),
                new PlugStage(),
                new UnboxValueTypeStage(),
                new RuntimeCallStage(),
                (compilerSettings.InlineMethods) ? new InlineStage() : null,
                (compilerSettings.InlineMethods) ? new BlockMergeStage() : null,
                (compilerSettings.InlineMethods) ? new DeadBlockStage() : null,
                new PromoteTemporaryVariables(),
                new StaticLoadOptimizationStage(),
                (compilerSettings.BasicOptimizations) ? new OptimizationStage() : null,
                (compilerSettings.SSA) ? new EdgeSplitStage() : null,
                (compilerSettings.SSA) ? new EnterSSAStage() : null,
                (compilerSettings.BasicOptimizations && compilerSettings.SSA) ? new OptimizationStage() : null,
                (compilerSettings.ValueNumbering && compilerSettings.SSA) ? new ValueNumberingStage() : null,
                (compilerSettings.LoopInvariantCodeMotion && compilerSettings.SSA) ? new LoopInvariantCodeMotionStage() : null,
                (compilerSettings.SparseConditionalConstantPropagation && compilerSettings.SSA) ? new SparseConditionalConstantPropagationStage() : null,
                (compilerSettings.BasicOptimizations && compilerSettings.SSA && (compilerSettings.BasicOptimizations || compilerSettings.ValueNumbering || compilerSettings.LoopInvariantCodeMotion || compilerSettings.SparseConditionalConstantPropagation)) ? new OptimizationStage() : null,
                (compilerSettings.LongExpansion && !is64BitPlatform) ? new LongExpansionStage() : null,
                (compilerSettings.BasicOptimizations && compilerSettings.LongExpansion && !is64BitPlatform) ? new OptimizationStage() : null,
                (compilerSettings.BitTracker) ? new BitTrackerStage() : null,
                (compilerSettings.TwoPass && compilerSettings.ValueNumbering && compilerSettings.SSA) ? new ValueNumberingStage() : null,
                (compilerSettings.TwoPass && compilerSettings.LoopInvariantCodeMotion && compilerSettings.SSA) ? new LoopInvariantCodeMotionStage() : null,
                (compilerSettings.TwoPass && compilerSettings.SparseConditionalConstantPropagation && compilerSettings.SSA) ? new SparseConditionalConstantPropagationStage() : null,
                (compilerSettings.TwoPass && compilerSettings.BasicOptimizations && compilerSettings.SSA) ? new OptimizationStage() : null,
                (compilerSettings.SSA) ? new ExitSSAStage() : null,
                new DeadBlockStage(),
                new BlockMergeStage(),
                new IRCleanupStage(),
                new NewObjectIRStage(),
                (compilerSettings.InlineMethods) ? new InlineEvaluationStage() : null,

                //new StopStage(),

                new CallStage(),
                new CompoundStage(),
                new PlatformIntrinsicStage(),
                new PlatformEdgeSplitStage(),
                new VirtualRegisterRenameStage(),
                new GreedyRegisterAllocatorStage(),
                new StackLayoutStage(),
                new DeadBlockStage(),
                new BlockOrderingStage(),

                //new PreciseGCStage(),

                new CodeGenerationStage(compilerSettings.EmitBinary),
                (compilerSettings.EmitBinary) ? new ProtectedRegionLayoutStage() : null,
            });
        }
Beispiel #2
0
 private static List <BaseCompilerStage> GetDefaultCompilerPipeline(CompilerSettings compilerSettings, bool is64BitPlatform)
 {
     return(new List <BaseCompilerStage> {
         new InlinedSetupStage(),
         new UnitTestStage(),
         new TypeInitializerStage(),
         compilerSettings.Devirtualization ? new DevirtualizationStage() : null,
         new StaticFieldStage(),
         new MethodTableStage(),
         new ExceptionTableStage(),
         new MetadataStage(),
         (!string.IsNullOrEmpty(compilerSettings.PreLinkHashFile)) ? new PreLinkHashFileStage() : null,
         new LinkerLayoutStage(),
         (!string.IsNullOrEmpty(compilerSettings.PostLinkHashFile)) ? new PostLinkHashFileStage() : null,
         (!string.IsNullOrEmpty(compilerSettings.CompileTimeFile)) ? new MethodCompileTimeStage() : null,
         (!string.IsNullOrEmpty(compilerSettings.OutputFile) && compilerSettings.EmitBinary) ? new LinkerEmitStage() : null,
         (!string.IsNullOrEmpty(compilerSettings.MapFile)) ? new MapFileStage() : null,
         (!string.IsNullOrEmpty(compilerSettings.DebugFile)) ? new DebugFileStage() : null,
         (!string.IsNullOrEmpty(compilerSettings.InlinedFile)) ? new InlinedFileStage() : null,
     });
 }
Beispiel #3
0
 /// <summary>
 ///	Requests the architecture to add architecture specific compilation stages to the pipeline. These
 /// may depend upon the current state of the pipeline.</summary>
 /// <param name="pipeline">The pipeline of the method compiler to add architecture specific compilation stages to.</param>
 /// <param name="compilerSettings">The compiler options.</param>
 public abstract void ExtendMethodCompilerPipeline(Pipeline <BaseMethodCompilerStage> pipeline, CompilerSettings compilerSettings);
Beispiel #4
0
 public MosaCompiler(Settings settings, CompilerHooks compilerHook)
 {
     CompilerSettings = new CompilerSettings(settings.Clone());
     CompilerHooks    = compilerHook;
 }