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

C# Signatures.SigType类代码示例

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

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



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

示例1: Matches

        /// <summary>
        /// Matches the specified other.
        /// </summary>
        /// <param name="other">The other signature type.</param>
        /// <returns>True, if the signature type matches.</returns>
        public override bool Matches(SigType other)
        {
            RefSigType refOther = other as RefSigType;

            // FIXME: Do we need to consider custom mods here?
            return (refOther != null && refOther.elementType.Matches(this.ElementType) == true);
        }
开发者ID:jeffreye,项目名称:MOSA-Project,代码行数:12,代码来源:RefSigType.cs


示例2: GenericInstSigType

 /// <summary>
 /// Initializes a new instance of the <see cref="GenericInstSigType"/> class.
 /// </summary>
 /// <param name="baseType">Type of the base.</param>
 /// <param name="genericArguments">The generic args.</param>
 public GenericInstSigType(TypeSigType baseType, SigType[] genericArguments)
     : base(CilElementType.GenericInst)
 {
     this.baseType = baseType;
     this.genericArguments = genericArguments;
     this.containsGenericParameters = CheckContainsOpenGenericParameters();
 }
开发者ID:GeroL,项目名称:MOSA-Project,代码行数:12,代码来源:GenericInstSigType.cs


示例3: GetMoveInstruction

        private IInstruction GetMoveInstruction(SigType sigType)
        {
            IInstruction moveInstruction;
            if (this.RequiresSseOperation(sigType) == false)
            {
                if (MustSignExtendOnLoad(sigType.Type) == true)
                {
                    moveInstruction = Instruction.MovsxInstruction;
                }
                else if (MustZeroExtendOnLoad(sigType.Type) == true)
                {
                    moveInstruction = Instruction.MovzxInstruction;
                }
                else
                {
                    moveInstruction = Instruction.MovInstruction;
                }
            }
            else if (sigType.Type == CilElementType.R8)
            {
                moveInstruction = Instruction.MovsdInstruction;
            }
            else
            {
                moveInstruction = Instruction.MovssInstruction;
            }

            return moveInstruction;
        }
开发者ID:GeroL,项目名称:MOSA-Project,代码行数:29,代码来源:MemToMemConversionStage.cs


示例4: GetNull

        /// <summary>
        /// Retrieves a constant operand to represent the null-value.
        /// </summary>
        /// <returns>A new instance of <see cref="ConstantOperand"/>, that represents the null value.</returns>
        public static ConstantOperand GetNull()
        {
            if (_sObject == null)
                _sObject = BuiltInSigType.Object;

            return new ConstantOperand(_sObject, null);
        }
开发者ID:GeroL,项目名称:MOSA-Project,代码行数:11,代码来源:ConstantOperand.cs


示例5: Equals

        /// <summary>
        /// Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <param name="other">An object to compare with this object.</param>
        /// <returns>
        /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
        /// </returns>
        public override bool Equals(SigType other)
        {
            RefSigType rst = other as RefSigType;
            if (null == rst)
                return false;

            return (base.Equals(other) && this.elementType.Matches(rst.elementType) == true);
        }
开发者ID:jeffreye,项目名称:MOSA-Project,代码行数:15,代码来源:RefSigType.cs


示例6: AllocateVirtualRegister

        /// <summary>
        /// Allocates the virtual register.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <returns></returns>
        public Operand AllocateVirtualRegister(SigType type)
        {
            Operand virtualRegister = Operand.CreateVirtualRegister(type, virtualRegisters.Count + 1);

            virtualRegisters.Add(virtualRegister);

            return virtualRegister;
        }
开发者ID:pdelprat,项目名称:MOSA-Project,代码行数:13,代码来源:VirtualRegisterLayout.cs


示例7: RegisterOperand

        /// <summary>
        /// Initializes a new <see cref="RegisterOperand"/>.
        /// </summary>
        /// <param name="type">The signature type of the value the register holds.</param>
        /// <param name="register">The machine specific register used.</param>
        public RegisterOperand(SigType type, Register register)
            : base(type)
        {
            if (register == null)
                throw new ArgumentNullException(@"register");

            this.register = register;
        }
开发者ID:grover,项目名称:MOSA-Project,代码行数:13,代码来源:RegisterOperand.cs


示例8: Equals

        /// <summary>
        /// Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <param name="other">An object to compare with this object.</param>
        /// <returns>
        /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
        /// </returns>
        public override bool Equals(SigType other)
        {
            ClassSigType cst = other as ClassSigType;
            if (null == cst)
                return false;

            return (base.Equals(other) == true && this.Token == cst.Token);
        }
开发者ID:GeroL,项目名称:MOSA-Project,代码行数:15,代码来源:ClassSigType.cs


示例9: MemberOperand

        /// <summary>
        /// Initializes a new instance of the <see cref="MemberOperand"/> class.
        /// </summary>
        /// <param name="member">The member to reference.</param>
        /// <param name="type">The type of data held in the operand.</param>
        /// <param name="offset">The offset from the base register or absolute address to retrieve.</param>
        public MemberOperand(RuntimeMember member, SigType type, IntPtr offset)
            : base(null, type, offset)
        {
            if (member == null)
                throw new ArgumentNullException(@"member");

            this.member = member;
        }
开发者ID:grover,项目名称:MOSA-Project,代码行数:14,代码来源:MemberOperand.cs


示例10: RefSigType

        /// <summary>
        /// Initializes a new instance of the <see cref="RefSigType"/> class.
        /// </summary>
        /// <param name="type">The referenced type.</param>
        public RefSigType(SigType type)
            : base(CilElementType.ByRef)
        {
            if (null == type)
                throw new ArgumentNullException(@"type");

            ElementType = type;
        }
开发者ID:Zahovay,项目名称:MOSA-Project,代码行数:12,代码来源:RefSigType.cs


示例11: Equals

        /// <summary>
        /// Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <param name="other">An object to compare with this object.</param>
        /// <returns>
        /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
        /// </returns>
        public override bool Equals(SigType other)
        {
            SZArraySigType szast = other as SZArraySigType;
            if (szast == null)
                return false;

            return (base.Equals(other) == true && _elementType.Equals(szast._elementType) && CustomMod.Equals(_customMods, szast._customMods));
        }
开发者ID:jeffreye,项目名称:MOSA-Project,代码行数:15,代码来源:SZArraySigType.cs


示例12: LocalVariableSignature

        /// <summary>
        /// Initializes a new instance of the <see cref="LocalVariableSignature"/> class.
        /// </summary>
        /// <param name="provider">The provider.</param>
        /// <param name="token">The token.</param>
        /// <param name="genericArguments">The generic arguments.</param>
        public LocalVariableSignature(LocalVariableSignature signature, SigType[] genericArguments)
            : base(signature.Token)
        {
            locals = new VariableSignature[signature.locals.Length];

            for (int i = 0; i < signature.locals.Length; i++)
                locals[i] = new VariableSignature(signature.locals[i], genericArguments);
        }
开发者ID:jeffreye,项目名称:MOSA-Project,代码行数:14,代码来源:LocalVariableSignature.cs


示例13: PtrSigType

        /// <summary>
        /// Initializes a new instance of the <see cref="PtrSigType"/> class.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="customMods">The custom mods.</param>
        public PtrSigType(SigType type, CustomMod[] customMods)
            : base(CilElementType.Ptr)
        {
            if (type == null)
                throw new ArgumentNullException(@"type");

            this.customMods = customMods;
            this.elementType = type;
        }
开发者ID:Zahovay,项目名称:MOSA-Project,代码行数:14,代码来源:PtrSigType.cs


示例14: LdobjInstruction

        /// <summary>
        /// Initializes a new instance of the <see cref="LdobjInstruction"/> class.
        /// </summary>
        /// <param name="opcode">The opcode.</param>
        public LdobjInstruction(OpCode opcode)
            : base(opcode, 1)
        {
            switch (opcode)
            {
                case OpCode.Ldind_i1:
                    typeRef = BuiltInSigType.SByte;
                    break;

                case OpCode.Ldind_i2:
                    typeRef = BuiltInSigType.Int16;
                    break;

                case OpCode.Ldind_i4:
                    typeRef = BuiltInSigType.Int32;
                    break;

                case OpCode.Ldind_i8:
                    typeRef = BuiltInSigType.Int64;
                    break;

                case OpCode.Ldind_u1:
                    typeRef = BuiltInSigType.Byte;
                    break;

                case OpCode.Ldind_u2:
                    typeRef = BuiltInSigType.UInt16;
                    break;

                case OpCode.Ldind_u4:
                    typeRef = BuiltInSigType.UInt32;
                    break;

                case OpCode.Ldind_i:
                    typeRef = BuiltInSigType.IntPtr;
                    break;

                case OpCode.Ldind_r4:
                    typeRef = BuiltInSigType.Single;
                    break;

                case OpCode.Ldind_r8:
                    typeRef = BuiltInSigType.Double;
                    break;

                case OpCode.Ldind_ref: // FIXME: Really object?
                    typeRef = BuiltInSigType.Object;
                    break;

                case OpCode.Ldobj: // FIXME
                    typeRef = null; // BuiltInSigType.Object;
                    break;

                default:
                    throw new NotImplementedException();
            }
        }
开发者ID:jeffreye,项目名称:MOSA-Project,代码行数:61,代码来源:LdobjInstruction.cs


示例15: PtrSigType

        /// <summary>
        /// Initializes a new instance of the <see cref="PtrSigType"/> class.
        /// </summary>
        /// <param name="type">The type.</param>
        public PtrSigType(SigType type)
            : base(CilElementType.Ptr)
        {
            if (null == type)
                throw new ArgumentNullException(@"type");

            this.customMods = null;
            this.elementType = type;
        }
开发者ID:GeroL,项目名称:MOSA-Project,代码行数:13,代码来源:PtrSigType.cs


示例16: AllocateVirtualRegister

        /// <summary>
        /// Allocates the virtual register.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <returns></returns>
        public VirtualRegisterOperand AllocateVirtualRegister(SigType type)
        {
            int index = virtualRegisters.Count + 1;

            VirtualRegisterOperand virtualRegister = new VirtualRegisterOperand(type, index);

            virtualRegisters.Add(virtualRegister);

            return virtualRegister;
        }
开发者ID:grover,项目名称:MOSA-Project,代码行数:15,代码来源:VirtualRegisterLayout.cs


示例17: InsertLoadBeforeInstruction

        private Operand InsertLoadBeforeInstruction(Context context, string symbolName, SigType type)
        {
            Context before = context.InsertBefore();
            Operand result = methodCompiler.CreateVirtualRegister(type);
            Operand op = Operand.CreateSymbol(type, symbolName);

            before.SetInstruction(CILInstruction.Get(OpCode.Ldc_i4), result, op);

            return result;
        }
开发者ID:jeffreye,项目名称:MOSA-Project,代码行数:10,代码来源:StaticAllocationResolutionStage.cs


示例18: InsertLoadBeforeInstruction

        private Operand InsertLoadBeforeInstruction(Context context, string symbolName, SigType type)
        {
            Context before = context.InsertBefore();
            Operand result = this.methodCompiler.CreateTemporary(type);
            Operand op = new SymbolOperand(type, symbolName);

            before.SetInstruction(Instruction.Get(OpCode.Ldc_i4), result, op);

            return result;
        }
开发者ID:GeroL,项目名称:MOSA-Project,代码行数:10,代码来源:StaticAllocationResolutionStage.cs


示例19: CreateResultOperand

 public static Operand CreateResultOperand(IInstructionDecoder decoder, StackTypeCode operandType, SigType operandSigType)
 {
     if (operandType == StackTypeCode.O || operandType == StackTypeCode.Ptr || operandType == StackTypeCode.F)
     {
         return decoder.Compiler.CreateVirtualRegister(operandSigType);
     }
     else
     {
         return decoder.Compiler.CreateVirtualRegister(Operand.SigTypeFromStackType(operandType));
     }
 }
开发者ID:pdelprat,项目名称:MOSA-Project,代码行数:11,代码来源:LoadInstruction.cs


示例20: Resolve

		public static SigType[] Resolve(SigType[] sigTypes, SigType[] genericArguments)
		{
			SigType[] newSigTypes = new SigType[sigTypes.Length];

			for (int i = 0; i < sigTypes.Length; i++)
			{
				newSigTypes[i] = Resolve(sigTypes[i], genericArguments);
			}

			return newSigTypes;
		}
开发者ID:Zahovay,项目名称:MOSA-Project,代码行数:11,代码来源:GenericSigTypeResolver.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# MosaTypeSystem.TypeSystem类代码示例发布时间:2022-05-26
下一篇:
C# Metadata.Token类代码示例发布时间: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