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

C# MosaTypeSystem.TypeSystem类代码示例

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

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



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

示例1: Compile

        /// <summary>
        /// Compiles the specified type system.
        /// </summary>
        /// <param name="typeSystem">The type system.</param>
        /// <param name="typeLayout">The type layout.</param>
        /// <param name="compilerTrace">The compiler trace.</param>
        /// <param name="compilerOptions">The compiler options.</param>
        /// <param name="architecture">The architecture.</param>
        /// <param name="simAdapter">The sim adapter.</param>
        /// <param name="linker">The linker.</param>
        /// <returns></returns>
        public static SimCompiler Compile(TypeSystem typeSystem, MosaTypeLayout typeLayout, CompilerTrace compilerTrace, CompilerOptions compilerOptions, BaseArchitecture architecture, ISimAdapter simAdapter, BaseLinker linker)
        {
            var compiler = new SimCompiler(architecture, typeSystem, typeLayout, linker, compilerOptions, compilerTrace, simAdapter);

            compiler.Compile();

            return compiler;
        }
开发者ID:Boddlnagg,项目名称:MOSA-Project,代码行数:19,代码来源:SimCompiler.cs


示例2: MosaTypeLayout

        /// <summary>
        /// Initializes a new instance of the <see cref="MosaTypeLayout" /> class.
        /// </summary>
        /// <param name="typeSystem">The type system.</param>
        /// <param name="nativePointerSize">Size of the native pointer.</param>
        /// <param name="nativePointerAlignment">The native pointer alignment.</param>
        public MosaTypeLayout(TypeSystem typeSystem, int nativePointerSize, int nativePointerAlignment)
        {
            Debug.Assert(nativePointerSize == 4 || nativePointerSize == 8);

            NativePointerAlignment = nativePointerAlignment;
            NativePointerSize = nativePointerSize;
            TypeSystem = typeSystem;

            ResolveLayouts();
        }
开发者ID:tgiphil,项目名称:MOSA-Project,代码行数:16,代码来源:MosaTypeLayout.cs


示例3: Compile

        /// <summary>
        /// Compiles the specified type system.
        /// </summary>
        /// <param name="typeSystem">The type system.</param>
        /// <param name="typeLayout">The type layout.</param>
        /// <param name="internalTrace">The internal trace.</param>
        /// <param name="enabledSSA">if set to <c>true</c> [enabled ssa].</param>
        /// <param name="architecture">The architecture.</param>
        /// <param name="simAdapter">The sim adapter.</param>
        /// <param name="linker">The linker.</param>
        /// <returns></returns>
        public static SimCompiler Compile(TypeSystem typeSystem, MosaTypeLayout typeLayout, IInternalTrace internalTrace, bool enabledSSA, BaseArchitecture architecture, ISimAdapter simAdapter, ILinker linker)
        {
            CompilerOptions compilerOptions = new CompilerOptions();
            compilerOptions.EnableSSA = enabledSSA;
            compilerOptions.EnableSSAOptimizations = enabledSSA;

            SimCompiler compiler = new SimCompiler(architecture, typeSystem, typeLayout, linker, compilerOptions, internalTrace, simAdapter);

            compiler.Compile();

            return compiler;
        }
开发者ID:tea,项目名称:MOSA-Project,代码行数:23,代码来源:SimCompiler.cs


示例4: CompilationScheduler

        public CompilationScheduler(TypeSystem typeSystem, bool compileAllMethods)
        {
            this.typeSystem = typeSystem;
            this.compileAllMethods = compileAllMethods;

            if (compileAllMethods)
            {
                // forces all types to get compiled
                foreach (MosaType type in typeSystem.AllTypes)
                {
                    CompileType(type);
                }
            }
        }
开发者ID:tea,项目名称:MOSA-Project,代码行数:14,代码来源:CompilationScheduler.cs


示例5: Compile

        /// <summary>
        /// Compiles the specified type system.
        /// </summary>
        /// <param name="typeSystem">The type system.</param>
        /// <param name="typeLayout">The type layout.</param>
        /// <param name="compilerTrace">The compiler trace.</param>
        /// <param name="platform">The platform.</param>
        /// <param name="enabledSSA">if set to <c>true</c> [enabled ssa].</param>
        /// <param name="enableOptimizations">if set to <c>true</c> [enable ssa optimizations].</param>
        /// <param name="emitBinary">if set to <c>true</c> [emit binary].</param>
        public static void Compile(TypeSystem typeSystem, MosaTypeLayout typeLayout, CompilerTrace compilerTrace, string platform, CompilerOptions compilerOptions, bool emitBinary)
        {
            BaseArchitecture architecture;

            switch (platform.ToLower())
            {
                case "x86": architecture = Mosa.Platform.x86.Architecture.CreateArchitecture(Mosa.Platform.x86.ArchitectureFeatureFlags.AutoDetect); break;
                case "armv6": architecture = Mosa.Platform.ARMv6.Architecture.CreateArchitecture(Mosa.Platform.ARMv6.ArchitectureFeatureFlags.AutoDetect); break;
                //case "avr32": architecture = Mosa.Platform.AVR32.Architecture.CreateArchitecture(Mosa.Platform.AVR32.ArchitectureFeatureFlags.AutoDetect); break;
                default:
                    architecture = Mosa.Platform.x86.Architecture.CreateArchitecture(Mosa.Platform.x86.ArchitectureFeatureFlags.AutoDetect); break;
            }

            var compiler = new ExplorerCompiler(architecture, typeSystem, typeLayout, compilerTrace, compilerOptions, emitBinary);

            compiler.Compile();
        }
开发者ID:Boddlnagg,项目名称:MOSA-Project,代码行数:27,代码来源:ExplorerCompiler.cs


示例6: ExplorerCompiler

        /// <summary>
        /// Prevents a default instance of the <see cref="ExplorerCompiler" /> class from being created.
        /// </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="compilerTrace">The internal trace.</param>
        /// <param name="compilerOptions">The compiler options.</param>
        public ExplorerCompiler(BaseArchitecture architecture, TypeSystem typeSystem, MosaTypeLayout typeLayout, CompilerTrace compilerTrace, CompilerOptions compilerOptions, bool emitBinary)
            : base(architecture, typeSystem, typeLayout, new CompilationScheduler(typeSystem, true), compilerTrace, new ExplorerLinker(), compilerOptions)
        {
            this.emitBinary = emitBinary;

            // Build the assembly compiler pipeline
            Pipeline.Add(new ICompilerStage[] {
                new PlugStage(),
                new MethodCompilerSchedulerStage(),
                new TypeInitializerSchedulerStage(),
                new MethodLookupTableStage(),
                new MethodExceptionLookupTableStage(),
                new MetadataStage(),
            });

            architecture.ExtendCompilerPipeline(Pipeline);
        }
开发者ID:Boddlnagg,项目名称:MOSA-Project,代码行数:25,代码来源:ExplorerCompiler.cs


示例7: SimCompiler

        /// <summary>
        /// Prevents a default instance of the <see cref="SimCompiler" /> class from being created.
        /// </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="linker">The linker.</param>
        /// <param name="compilerOptions">The compiler options.</param>
        /// <param name="internalTrace">The internal trace.</param>
        /// <param name="simAdapter">The sim adapter.</param>
        public SimCompiler(BaseArchitecture architecture, TypeSystem typeSystem, MosaTypeLayout typeLayout, ILinker linker, CompilerOptions compilerOptions, IInternalTrace internalTrace, ISimAdapter simAdapter)
            : base(architecture, typeSystem, typeLayout, new CompilationScheduler(typeSystem, true), internalTrace, linker, compilerOptions)
        {
            this.simAdapter = simAdapter;

            // Build the assembly compiler pipeline
            Pipeline.Add(new ICompilerStage[] {
                new PlugStage(),
                new MethodCompilerSchedulerStage(),
                new TypeInitializerSchedulerStage(),
                new SimPowerUpStage(),
                new TypeLayoutStage(),
                new MetadataStage(),
                new LinkerFinalizationStage(),
            });

            architecture.ExtendCompilerPipeline(Pipeline);
        }
开发者ID:tea,项目名称:MOSA-Project,代码行数:28,代码来源:SimCompiler.cs


示例8: 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


示例9: Compile

        /// <summary>
        /// Compiles the specified type system.
        /// </summary>
        /// <param name="typeSystem">The type system.</param>
        /// <param name="typeLayout">The type layout.</param>
        /// <param name="internalTrace">The internal trace.</param>
        /// <param name="platform">The platform.</param>
        /// <param name="enabledSSA">if set to <c>true</c> [enabled ssa].</param>
        /// <param name="emitBinary">if set to <c>true</c> [emit binary].</param>
        public static void Compile(TypeSystem typeSystem, MosaTypeLayout typeLayout, IInternalTrace internalTrace, string platform, bool enabledSSA, bool emitBinary)
        {
            BaseArchitecture architecture;

            switch (platform.ToLower())
            {
                case "x86": architecture = Mosa.Platform.x86.Architecture.CreateArchitecture(Mosa.Platform.x86.ArchitectureFeatureFlags.AutoDetect); break;
                case "armv6": architecture = Mosa.Platform.ARMv6.Architecture.CreateArchitecture(Mosa.Platform.ARMv6.ArchitectureFeatureFlags.AutoDetect); break;
                //case "avr32": architecture = Mosa.Platform.AVR32.Architecture.CreateArchitecture(Mosa.Platform.AVR32.ArchitectureFeatureFlags.AutoDetect); break;
                default:
                    architecture = Mosa.Platform.x86.Architecture.CreateArchitecture(Mosa.Platform.x86.ArchitectureFeatureFlags.AutoDetect); break;
            }

            CompilerOptions compilerOptions = new CompilerOptions();
            compilerOptions.EnableSSA = enabledSSA;
            compilerOptions.EnableSSAOptimizations = enabledSSA && enabledSSA;

            ExplorerCompiler compiler = new ExplorerCompiler(architecture, typeSystem, typeLayout, internalTrace, compilerOptions, emitBinary);

            compiler.Compile();
        }
开发者ID:tea,项目名称:MOSA-Project,代码行数:30,代码来源:ExplorerCompiler.cs


示例10: 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


示例11: GetNull

 /// <summary>
 /// Gets the null constant <see cref="Operand"/>.
 /// </summary>
 /// <returns></returns>
 public static Operand GetNull(TypeSystem typeSystem)
 {
     var operand = new Operand(typeSystem.BuiltIn.Object);
     operand.IsNull = true;
     operand.IsConstant = true;
     return operand;
 }
开发者ID:Zahovay,项目名称:MOSA-Project,代码行数:11,代码来源:Operand.cs


示例12: CreateSymbolFromMethod

 /// <summary>
 /// Creates a new symbol <see cref="Operand" /> for the given symbol name.
 /// </summary>
 /// <param name="typeSystem">The type system.</param>
 /// <param name="method">The method.</param>
 /// <returns></returns>
 public static Operand CreateSymbolFromMethod(TypeSystem typeSystem, MosaMethod method)
 {
     var operand = CreateUnmanagedSymbolPointer(typeSystem, method.FullName);
     operand.Method = method;
     return operand;
 }
开发者ID:Zahovay,项目名称:MOSA-Project,代码行数:12,代码来源:Operand.cs


示例13: CreateUnmanagedSymbolPointer

 /// <summary>
 /// Creates the symbol.
 /// </summary>
 /// <param name="typeSystem">The type system.</param>
 /// <param name="name">The name.</param>
 /// <returns></returns>
 public static Operand CreateUnmanagedSymbolPointer(TypeSystem typeSystem, string name)
 {
     var operand = new Operand(typeSystem.BuiltIn.Pointer);
     operand.IsSymbol = true;
     operand.Name = name;
     return operand;
 }
开发者ID:Zahovay,项目名称:MOSA-Project,代码行数:13,代码来源:Operand.cs


示例14: Initialize

        public void Initialize(MosaCompiler compiler)
        {
            if (compiler == null)
                throw new ArgumentNullException(@"compiler");

            Compiler = compiler;

            Architecture = Compiler.CompilerOptions.Architecture;
            TypeSystem = Compiler.TypeSystem;
            TypeLayout = Compiler.TypeLayout;
            CompilerTrace = Compiler.CompilerTrace;
            CompilerOptions = Compiler.CompilerOptions;
            CompilationScheduler = Compiler.CompilationScheduler;
            Linker = compiler.Linker;

            PreCompilePipeline = new CompilerPipeline();
            PostCompilePipeline = new CompilerPipeline();
            GlobalCounters = new Counters();
            PlugSystem = new PlugSystem();
            CompilerData = new CompilerData();

            // Create new dictionary
            IntrinsicTypes = new Dictionary<string, Type>();

            foreach (var type in Assembly.GetExecutingAssembly().GetTypes())
            {
                if (type.IsClass && typeof(IIntrinsicInternalMethod).IsAssignableFrom(type))
                {
                    // Now get all the ReplacementTarget attributes
                    var attributes = (ReplacementTargetAttribute[])type.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, type);
                    }
                }
            }

            PlatformInternalRuntimeType = GetPlatformInternalRuntimeType();
            InternalRuntimeType = GeInternalRuntimeType();

            // Extended Setup
            ExtendCompilerSetup();

            // Build the default pre-compiler pipeline
            Architecture.ExtendPreCompilerPipeline(PreCompilePipeline);

            // Build the default post-compiler pipeline
            Architecture.ExtendPostCompilerPipeline(PostCompilePipeline);
        }
开发者ID:Profi-Concept,项目名称:MOSA-Project,代码行数:50,代码来源:BaseCompiler.cs


示例15: CreateStringSymbol

        /// <summary>
        /// Creates the string symbol with data.
        /// </summary>
        /// <param name="typeSystem">The type system.</param>
        /// <param name="name">The name.</param>
        /// <param name="data">The string data.</param>
        /// <returns></returns>
        public static Operand CreateStringSymbol(TypeSystem typeSystem, string name, string data)
        {
            Debug.Assert(data != null);

            var operand = new Operand(typeSystem.BuiltIn.String);
            operand.IsSymbol = true;
            operand.Name = name;
            operand.StringData = data;
            return operand;
        }
开发者ID:Zahovay,项目名称:MOSA-Project,代码行数:17,代码来源:Operand.cs


示例16: Setup

        /// <summary>
        /// Setups the specified compiler.
        /// </summary>
        /// <param name="compiler">The compiler.</param>
        void IMethodCompilerStage.Initialize(BaseMethodCompiler compiler)
        {
            MethodCompiler = compiler;
            BasicBlocks = compiler.BasicBlocks;
            Architecture = compiler.Architecture;
            TypeSystem = compiler.TypeSystem;
            TypeLayout = compiler.TypeLayout;
            CallingConvention = Architecture.CallingConvention;
            NativePointerSize = Architecture.NativePointerSize;
            NativeAlignment = Architecture.NativeAlignment;
            NativeInstructionSize = Architecture.NativeInstructionSize;

            MethodData = MethodCompiler.MethodData;

            traceLogs = new List<TraceLog>();

            Setup();
        }
开发者ID:Profi-Concept,项目名称:MOSA-Project,代码行数:22,代码来源:BaseMethodCompilerStage.cs


示例17: Compile

        public void Compile()
        {
            HasCompileError = true;
            Log.Clear();
            Counters.Clear();

            var compiler = new MosaCompiler();

            try
            {
                CompileStartTime = DateTime.Now;

                CompiledFile = Path.Combine(Options.DestinationDirectory, Path.GetFileNameWithoutExtension(Options.SourceFile) + ".bin");

                compiler.CompilerFactory = delegate { return new AotCompiler(); };

                compiler.CompilerOptions.EnableSSA = Options.EnableSSA;
                compiler.CompilerOptions.EnableOptimizations = Options.EnableIROptimizations;
                compiler.CompilerOptions.EnableSparseConditionalConstantPropagation = Options.EnableSparseConditionalConstantPropagation;
                compiler.CompilerOptions.EnableInlinedMethods = Options.EnableInlinedMethods;
                compiler.CompilerOptions.InlinedIRMaximum = Options.InlinedIRMaximum;
                compiler.CompilerOptions.EnableVariablePromotion = Options.EnableVariablePromotion;
                compiler.CompilerOptions.OutputFile = CompiledFile;

                compiler.CompilerOptions.Architecture = SelectArchitecture(Options.PlatformType);
                compiler.CompilerOptions.LinkerFormatType = Options.LinkerFormatType;
                compiler.CompilerOptions.BootStageFactory = GetBootStageFactory(Options.BootFormat);

                compiler.CompilerOptions.SetCustomOption("multiboot.video", Options.VBEVideo ? "true" : "false");
                compiler.CompilerOptions.SetCustomOption("multiboot.width", Options.Width.ToString());
                compiler.CompilerOptions.SetCustomOption("multiboot.height", Options.Height.ToString());
                compiler.CompilerOptions.SetCustomOption("multiboot.depth", Options.Depth.ToString());

                compiler.CompilerOptions.BaseAddress = Options.BaseAddress;
                compiler.CompilerOptions.EmitSymbols = Options.EmitSymbols;
                compiler.CompilerOptions.EmitRelocations = Options.EmitRelocations;

                compiler.CompilerOptions.SetCustomOption("x86.irq-methods", Options.Emitx86IRQMethods ? "true" : "false");

                if (Options.GenerateMapFile)
                {
                    compiler.CompilerOptions.MapFile = Path.Combine(Options.DestinationDirectory, Path.GetFileNameWithoutExtension(Options.SourceFile) + ".map");
                }

                if (!Directory.Exists(Options.DestinationDirectory))
                {
                    Directory.CreateDirectory(Options.DestinationDirectory);
                }

                compiler.CompilerTrace.TraceListener = traceListener;

                if (string.IsNullOrEmpty(Options.SourceFile))
                {
                    AddOutput("Please select a source file");
                    return;
                }
                else if (!File.Exists(Options.SourceFile))
                {
                    AddOutput(string.Format("File {0} does not exists", Options.SourceFile));
                    return;
                }

                var inputFiles = new List<FileInfo>();
                inputFiles.Add(new FileInfo(Options.SourceFile));

                compiler.Load(inputFiles);

                var threads = Options.UseMultipleThreadCompiler ? Environment.ProcessorCount : 1;
                compiler.Execute(threads);

                Linker = compiler.Linker;
                TypeSystem = compiler.TypeSystem;

                if (Options.ImageFormat == ImageFormat.ISO)
                {
                    if (Options.BootLoader == BootLoader.Grub_0_97 || Options.BootLoader == BootLoader.Grub_2_00)
                    {
                        CreateISOImageWithGrub(CompiledFile);
                    }
                    else // assuming syslinux
                    {
                        CreateISOImageWithSyslinux(CompiledFile);
                    }
                }
                else
                {
                    CreateDiskImage(CompiledFile);

                    if (Options.ImageFormat == ImageFormat.VMDK)
                    {
                        CreateVMDK(ImageFile);
                    }
                }

                HasCompileError = false;

                if (Options.GenerateASMFile)
                {
                    LaunchNDISASM();
                }
//.........这里部分代码省略.........
开发者ID:Zahovay,项目名称:MOSA-Project,代码行数:101,代码来源:Builder.cs


示例18: ReserveStackSizeForCall

        /// <summary>
        /// Reserves the stack size for call.
        /// </summary>
        /// <param name="typeSystem">The type system.</param>
        /// <param name="context">The context.</param>
        /// <param name="stackSize">Size of the stack.</param>
        /// <param name="scratch">The scratch.</param>
        private void ReserveStackSizeForCall(TypeSystem typeSystem, Context context, int stackSize, Operand scratch)
        {
            if (stackSize == 0)
                return;

            Operand stackPointer = Operand.CreateCPURegister(typeSystem.BuiltIn.Pointer, architecture.StackPointerRegister);

            architecture.InsertSubInstruction(context, stackPointer, stackPointer, Operand.CreateConstant(typeSystem.BuiltIn.I4, stackSize));
            architecture.InsertMoveInstruction(context, scratch, stackPointer);
        }
开发者ID:yonglehou,项目名称:MOSA-Project,代码行数:17,代码来源:BaseCallingConvention32Bit.cs


示例19: Initialize

        /// <summary>
        /// Initializes a new instance of <see cref="BaseCodeEmitter" />.
        /// </summary>
        /// <param name="methodName">Name of the method.</param>
        /// <param name="linker">The linker.</param>
        /// <param name="codeStream">The stream the machine code is written to.</param>
        /// <param name="typeSystem">The type system.</param>
        public void Initialize(string methodName, BaseLinker linker, Stream codeStream, TypeSystem typeSystem)
        {
            Debug.Assert(codeStream != null);
            Debug.Assert(linker != null);

            this.MethodName = methodName;
            this.linker = linker;
            this.codeStream = codeStream;
            this.TypeSystem = typeSystem;
        }
开发者ID:Boddlnagg,项目名称:MOSA-Project,代码行数:17,代码来源:BaseCodeEmitter.cs


示例20: CreateConstant

 /// <summary>
 /// Creates a new constant <see cref="Operand" /> for the given integral value.
 /// </summary>
 /// <param name="typeSystem">The type system.</param>
 /// <param name="value">The value to create the constant operand for.</param>
 /// <returns>
 /// A new operand representing the value <paramref name="value" />.
 /// </returns>
 public static Operand CreateConstant(TypeSystem typeSystem, long value)
 {
     var operand = new Operand(typeSystem.BuiltIn.I8);
     operand.IsConstant = true;
     operand.ConstantSignedLongInteger = value;
     return operand;
 }
开发者ID:Zahovay,项目名称:MOSA-Project,代码行数:15,代码来源:Operand.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# TypeSystem.RuntimeMethod类代码示例发布时间:2022-05-26
下一篇:
C# Signatures.SigType类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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