Beispiel #1
0
 /// <summary>
 /// Creates a method compiler
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="method">The method to compile.</param>
 /// <returns>
 /// An instance of a MethodCompilerBase for the given type/method pair.
 /// </returns>
 public override IMethodCompiler CreateMethodCompiler(ICompilationSchedulerStage compilationScheduler, RuntimeType type, RuntimeMethod method)
 {
     IMethodCompiler mc = new AotMethodCompiler(
         this,
         compilationScheduler,
         type,
         method
     );
     this.Architecture.ExtendMethodCompilerPipeline(mc.Pipeline);
     return mc;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AotMethodCompiler"/> class.
 /// </summary>
 public AotMethodCompiler(AssemblyCompiler compiler, ICompilationSchedulerStage compilationScheduler, RuntimeType type, RuntimeMethod method)
     : base(compiler.Pipeline.FindFirst<IAssemblyLinker>(), compiler.Architecture, compilationScheduler, type, method, compiler.TypeSystem, compiler.TypeLayout)
 {
     this.assemblyCompiler = compiler;
     this.Pipeline.AddRange(
         new IMethodCompilerStage[]
         {
             new DecodingStage(),
             //InstructionLogger.Instance,
             new BasicBlockBuilderStage(),
             InstructionLogger.Instance,
             new OperandDeterminationStage(),
             InstructionLogger.Instance,
             StaticAllocationResolutionStageWrapper.Instance,
             //InstructionLogger.Instance,
             new CILTransformationStage(),
             InstructionLogger.Instance,
             //InstructionStatisticsStage.Instance,
             //new DominanceCalculationStage(),
             //InstructionLogger.Instance,
             //new EnterSSA(),
             //InstructionLogger.Instance,
             //new ConstantPropagationStage(),
             //InstructionLogger.Instance,
             //new ConstantFoldingStage(),
             //new StrengthReductionStage(),
             //InstructionLogger.Instance,
             //new LeaveSSA(),
             //InstructionLogger.Instance,
             new StackLayoutStage(),
             //InstructionLogger.Instance,
             new PlatformStubStage(),
             InstructionLogger.Instance,
             //new BlockReductionStage(),
             new LoopAwareBlockOrderStage(),
             InstructionLogger.Instance,
             //new SimpleTraceBlockOrderStage(),
             //new ReverseBlockOrderStage(),
             //new LocalCSE(),
             new CodeGenerationStage(),
         });
 }
 /// <summary>
 /// Initializes a new instance of <see cref="RuntimeMember"/>.
 /// </summary>
 /// <param name="module">The module.</param>
 /// <param name="token">Holds the token of this runtime metadata.</param>
 /// <param name="declaringType">The declaring type of the member.</param>
 protected RuntimeMember(ITypeModule module, Token token, RuntimeType declaringType) :
     base(module, token)
 {
     this.declaringType = declaringType;
     this.attributes    = new List <RuntimeAttribute>();
 }
Beispiel #4
0
 /// <summary>
 /// Adds the type.
 /// </summary>
 /// <param name="type">The type.</param>
 public void AddType(RuntimeType type)
 {
     types.Add(type);
 }
Beispiel #5
0
 /// <summary>
 /// Gets the open generic.
 /// </summary>
 /// <param name="baseGenericType">Type of the base generic.</param>
 /// <returns></returns>
 CilGenericType ITypeModule.GetOpenGeneric(RuntimeType baseGenericType)
 {
     return(null);
 }
Beispiel #6
0
 /// <summary>
 /// Gets the method.
 /// </summary>
 /// <param name="token">The token.</param>
 /// <param name="callingType">Type of the calling.</param>
 /// <returns></returns>
 RuntimeMethod ITypeModule.GetMethod(Token token, RuntimeType callingType)
 {
     return(null);
 }
Beispiel #7
0
 /// <summary>
 /// Gets the interface slot offset.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <returns></returns>
 int ITypeLayout.GetInterfaceSlotOffset(RuntimeType type)
 {
     ResolveType(type);
     return(interfaceSlots[type]);
 }