зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
8361dab9cb
Коммит
8fe1d91f62
|
@ -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
|
||||
|
|
10
insns.def
10
insns.def
|
@ -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 {
|
||||
|
|
Загрузка…
Ссылка в новой задаче