[前][次][番号順一覧][スレッド一覧]

ruby-changes:43462

From: naruse <ko1@a...>
Date: Wed, 29 Jun 2016 15:23:43 +0900 (JST)
Subject: [ruby-changes:43462] naruse:r55536 (trunk): * insns.def (opt_succ): optimize like r55515. (but this argument is

naruse	2016-06-29 15:23:38 +0900 (Wed, 29 Jun 2016)

  New Revision: 55536

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55536

  Log:
    * insns.def (opt_succ): optimize like r55515. (but this argument is
      consntant)

  Modified files:
    trunk/ChangeLog
    trunk/insns.def
Index: insns.def
===================================================================
--- insns.def	(revision 55535)
+++ insns.def	(revision 55536)
@@ -2041,12 +2041,12 @@ opt_succ https://github.com/ruby/ruby/blob/trunk/insns.def#L2041
     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 {
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 55535)
+++ ChangeLog	(revision 55536)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jun 29 15:18:28 2016  NARUSE, Yui  <naruse@r...>
+
+	* insns.def (opt_succ): optimize like r55515. (but this argument is
+	  consntant)
+
 Wed Jun 29 12:41:58 2016  Shugo Maeda  <shugo@r...>
 
 	* test/ruby/test_refinement.rb: skip

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]