public override void Emit (EmitContext ec)
{
int [] words = decimal.GetBits (Value);
int power = (words [3] >> 16) & 0xff;
if (power == 0) {
if (Value <= int.MaxValue && Value >= int.MinValue) {
if (TypeManager.void_decimal_ctor_int_arg == null) {
TypeManager.void_decimal_ctor_int_arg = TypeManager.GetPredefinedConstructor (
TypeManager.decimal_type, loc, TypeManager.int32_type);
if (TypeManager.void_decimal_ctor_int_arg == null)
return;
}
ec.EmitInt ((int) Value);
ec.Emit (OpCodes.Newobj, TypeManager.void_decimal_ctor_int_arg);
return;
}
if (Value <= long.MaxValue && Value >= long.MinValue) {
if (TypeManager.void_decimal_ctor_long_arg == null) {
TypeManager.void_decimal_ctor_long_arg = TypeManager.GetPredefinedConstructor (
TypeManager.decimal_type, loc, TypeManager.int64_type);
if (TypeManager.void_decimal_ctor_long_arg == null)
return;
}
ec.EmitLong ((long) Value);
ec.Emit (OpCodes.Newobj, TypeManager.void_decimal_ctor_long_arg);
return;
}
}
ec.EmitInt (words [0]);
ec.EmitInt (words [1]);
ec.EmitInt (words [2]);
// sign
ec.EmitInt (words [3] >> 31);
// power
ec.EmitInt (power);
if (TypeManager.void_decimal_ctor_five_args == null) {
TypeManager.void_decimal_ctor_five_args = TypeManager.GetPredefinedConstructor (
TypeManager.decimal_type, loc, TypeManager.int32_type, TypeManager.int32_type,
TypeManager.int32_type, TypeManager.bool_type, TypeManager.byte_type);
if (TypeManager.void_decimal_ctor_five_args == null)
return;
}
ec.Emit (OpCodes.Newobj, TypeManager.void_decimal_ctor_five_args);
}