Inheritance: Instruction
Example #1
0
 public void EmitMul(Type type, bool @checked)
 {
     if (@checked)
     {
         Emit(MulOvfInstruction.Create(type));
     }
     else
     {
         Emit(MulInstruction.Create(type));
     }
 }
Example #2
0
        public static Instruction Create(Type type)
        {
            Debug.Assert(TypeUtils.IsArithmetic(type));
            switch (TypeUtils.GetNonNullableType(type).GetTypeCode())
            {
            case TypeCode.Int16: return(s_int16 ?? (s_int16 = new MulOvfInt16()));

            case TypeCode.Int32: return(s_int32 ?? (s_int32 = new MulOvfInt32()));

            case TypeCode.Int64: return(s_int64 ?? (s_int64 = new MulOvfInt64()));

            case TypeCode.UInt16: return(s_UInt16 ?? (s_UInt16 = new MulOvfUInt16()));

            case TypeCode.UInt32: return(s_UInt32 ?? (s_UInt32 = new MulOvfUInt32()));

            case TypeCode.UInt64: return(s_UInt64 ?? (s_UInt64 = new MulOvfUInt64()));

            default:
                return(MulInstruction.Create(type));
            }
        }
Example #3
0
 public void EmitMul(Type type, bool @checked)
 {
     Emit(@checked ? MulOvfInstruction.Create(type) : MulInstruction.Create(type));
 }