public static void Compile(ITypeSystem typeSystem) { IArchitecture architecture = x86.Architecture.CreateArchitecture(x86.ArchitectureFeatureFlags.AutoDetect); // FIXME: get from architecture TypeLayout typeLayout = new TypeLayout(typeSystem, 4, 4); CompilerHelper compiler = new CompilerHelper(architecture, typeSystem, typeLayout); compiler.Compile(); //return compiler.linker; }
public MethodCompiler(CompilerHelper compiler, IArchitecture architecture, ICompilationSchedulerStage compilationScheduler, RuntimeType type, RuntimeMethod method) : base(compiler.Pipeline.FindFirst <IAssemblyLinker>(), architecture, compilationScheduler, type, method, compiler.TypeSystem, compiler.TypeLayout) { this.assemblyCompiler = compiler; // Populate the pipeline this.Pipeline.AddRange(new IMethodCompilerStage[] { new DecodingStage(), //new InstructionLogger(), new BasicBlockBuilderStage(), //new InstructionLogger(), new OperandDeterminationStage(), new InstructionLogger(), new StaticAllocationResolutionStage(), //new InstructionLogger(), //new ConstantFoldingStage(), new CILTransformationStage(), new InstructionLogger(), new CILLeakGuardStage() { MustThrowCompilationException = true }, //new InstructionLogger(), //InstructionStatisticsStage.Instance, //new DominanceCalculationStage(), //new EnterSSA(), //new ConstantPropagationStage(), //new ConstantFoldingStage(), //new LeaveSSA(), new StackLayoutStage(), new PlatformStubStage(), //new InstructionLogger(), //new BlockReductionStage(), new LoopAwareBlockOrderStage(), //new SimpleTraceBlockOrderStage(), //new ReverseBlockOrderStage(), // reverse all the basic blocks and see if it breaks anything //new BasicBlockOrderStage() //new CodeGenerationStage(), new InstructionLogger(), }); }
public MethodCompiler(CompilerHelper compiler, IArchitecture architecture, ICompilationSchedulerStage compilationScheduler, RuntimeType type, RuntimeMethod method) : base(compiler.Pipeline.FindFirst<IAssemblyLinker>(), architecture, compilationScheduler, type, method, compiler.TypeSystem, compiler.TypeLayout) { this.assemblyCompiler = compiler; // Populate the pipeline this.Pipeline.AddRange(new IMethodCompilerStage[] { new DecodingStage(), //new InstructionLogger(), new BasicBlockBuilderStage(), //new InstructionLogger(), new OperandDeterminationStage(), new InstructionLogger(), new StaticAllocationResolutionStage(), //new InstructionLogger(), //new ConstantFoldingStage(), new CILTransformationStage(), new InstructionLogger(), new CILLeakGuardStage() { MustThrowCompilationException = true }, //new InstructionLogger(), //InstructionStatisticsStage.Instance, //new DominanceCalculationStage(), //new EnterSSA(), //new ConstantPropagationStage(), //new ConstantFoldingStage(), //new LeaveSSA(), new StackLayoutStage(), new PlatformStubStage(), //new InstructionLogger(), //new BlockReductionStage(), new LoopAwareBlockOrderStage(), //new SimpleTraceBlockOrderStage(), //new ReverseBlockOrderStage(), // reverse all the basic blocks and see if it breaks anything //new BasicBlockOrderStage() //new CodeGenerationStage(), new InstructionLogger(), }); }