diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-29 06:23:38 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-29 06:23:38 +0000 |
commit | 8f42f6032a506da85512ae2198b812307edcf820 (patch) | |
tree | 5a55a4c5171c99be3ce7aafdd208b0e61b0da6e5 | |
parent | f37c5a08ad17b66e1abf96c9e11f1031340f4b5e (diff) | |
download | ruby-8f42f6032a506da85512ae2198b812307edcf820.tar.gz |
* insns.def (opt_succ): optimize like r55515. (but this argument is
consntant)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | insns.def | 10 |
2 files changed, 10 insertions, 5 deletions
@@ -1,3 +1,8 @@ +Wed Jun 29 15:18:28 2016 NARUSE, Yui <naruse@ruby-lang.org> + + * insns.def (opt_succ): optimize like r55515. (but this argument is + consntant) + Wed Jun 29 12:41:58 2016 Shugo Maeda <shugo@ruby-lang.org> * test/ruby/test_refinement.rb: skip @@ -2041,12 +2041,12 @@ opt_succ if (SPECIAL_CONST_P(recv)) { if (FIXNUM_P(recv) && BASIC_OP_UNREDEFINED_P(BOP_SUCC, INTEGER_REDEFINED_OP_FLAG)) { - const VALUE obj = INT2FIX(1); /* fixnum + INT2FIX(1) */ - val = (recv + (obj & (~1))); - if ((~(recv ^ obj) & (recv ^ val)) & ((unsigned long)LONG_MAX + 1)) { - val = rb_big_plus(rb_int2big(FIX2LONG(recv)), - rb_int2big(FIX2LONG(obj))); + if (recv != LONG2FIX(FIXNUM_MAX)) { + val = recv - 1 + INT2FIX(1); + } + else { + val = LONG2NUM(FIXNUM_MAX + 1); } } else { |