aboutsummaryrefslogtreecommitdiffstats
path: root/insns.def
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-21 13:36:03 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-21 13:36:03 +0000
commitf52ec74516e955d1325ad39dd5481ccaf043f244 (patch)
treeacf3f92e7cf2f2c34e6b8eedde7c935ad1c7e75d /insns.def
parent980c798a9713a1d8d1318fa15dd9014cc66ebf66 (diff)
downloadruby-f52ec74516e955d1325ad39dd5481ccaf043f244.tar.gz
* internal.h (rb_fix_divmod_fix): like r54213, use FIX2NUM only if
x == FIXNUM_MIN && y == -1. This must be a rare case and it is expected compiler to handle well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'insns.def')
-rw-r--r--insns.def10
1 files changed, 4 insertions, 6 deletions
diff --git a/insns.def b/insns.def
index b1e8265ce8..53f9bc0c16 100644
--- a/insns.def
+++ b/insns.def
@@ -1523,9 +1523,8 @@ opt_div
{
if (FIXNUM_2_P(recv, obj) &&
BASIC_OP_UNREDEFINED_P(BOP_DIV, FIXNUM_REDEFINED_OP_FLAG)) {
- long y = FIX2LONG(obj);
- if (y == 0) goto INSN_LABEL(normal_dispatch);
- val = LONG2NUM(rb_div(FIX2LONG(recv), y));
+ if (FIX2LONG(obj) == 0) goto INSN_LABEL(normal_dispatch);
+ val = rb_fix_div_fix(recv, obj);
}
else if (FLONUM_2_P(recv, obj) &&
BASIC_OP_UNREDEFINED_P(BOP_DIV, FLOAT_REDEFINED_OP_FLAG)) {
@@ -1561,9 +1560,8 @@ opt_mod
{
if (FIXNUM_2_P(recv, obj) &&
BASIC_OP_UNREDEFINED_P(BOP_MOD, FIXNUM_REDEFINED_OP_FLAG )) {
- long y = FIX2LONG(obj);
- if (y == 0) goto INSN_LABEL(normal_dispatch);
- val = LONG2FIX(rb_mod(FIX2LONG(recv), y));
+ if (FIX2LONG(obj) == 0) goto INSN_LABEL(normal_dispatch);
+ val = rb_fix_mod_fix(recv, obj);
}
else if (FLONUM_2_P(recv, obj) &&
BASIC_OP_UNREDEFINED_P(BOP_MOD, FLOAT_REDEFINED_OP_FLAG)) {