当前位置: 首页>>代码示例>>C#>>正文


C# Signatures.SigType类代码示例

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


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


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