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

ruby-changes:4345

From: ko1@a...
Date: Tue, 25 Mar 2008 15:09:57 +0900 (JST)
Subject: [ruby-changes:4345] nobu - Ruby:r15835 (trunk): * compile.c (compile_massign_opt): no need to use alloca.

nobu	2008-03-25 15:09:38 +0900 (Tue, 25 Mar 2008)

  New Revision: 15835

  Modified files:
    trunk/ChangeLog
    trunk/compile.c
    trunk/version.h

  Log:
    * compile.c (compile_massign_opt): no need to use alloca.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/version.h?r1=15835&r2=15834&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/compile.c?r1=15835&r2=15834&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15835&r2=15834&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 15834)
+++ ChangeLog	(revision 15835)
@@ -1,3 +1,7 @@
+Tue Mar 25 15:09:36 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* compile.c (compile_massign_opt): no need to use alloca.
+
 Mon Mar 24 19:23:52 2008  Akinori MUSHA  <knu@i...>
 
 	* parse.y (debug_lines): Always prepare a new array for each
Index: compile.c
===================================================================
--- compile.c	(revision 15834)
+++ compile.c	(revision 15835)
@@ -2095,9 +2095,9 @@
 compile_massign_opt(rb_iseq_t *iseq, LINK_ANCHOR *ret,
 		    NODE *rhsn, NODE *orig_lhsn)
 {
-    int memsize = 64;
+    VALUE mem[64];
+    const int memsize = sizeof(mem) / sizeof(mem[0]);
     int memindex = 0;
-    VALUE *mem = ALLOCA_N(VALUE, memsize);
     int llen = 0, rlen = 0;
     int i;
     NODE *lhsn = orig_lhsn;
@@ -2431,7 +2431,7 @@
       case NODE_NTH_REF:
 	ADD_INSN(ret, nd_line(node), putnil);
 	ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_REF),
-		  INT2FIX(node->nd_nth << 1 | type == NODE_BACK_REF),
+		  INT2FIX((node->nd_nth << 1) | (type == NODE_BACK_REF)),
 		  needstr);
 	return 1;
 
@@ -3809,12 +3809,12 @@
 			for (j=0; j<post_len; j++) {
 			    int idx = liseq->local_size - (post_start + j);
 			    ADD_INSN1(args, nd_line(node), getlocal, INT2FIX(idx));
+			}
+			argc = INT2FIX(post_len + post_start);
 		    }
-			argc = INT2FIX(post_len + post_start);
 		}
 	    }
 	}
-	}
 
 	/* dummy reciever */
 	ADD_INSN1(ret, nd_line(node), putobject,
@@ -4209,34 +4209,34 @@
 	break;
       }
       case NODE_ALIAS:{
-	  COMPILE(ret, "alias arg1", node->u1.node);
-	  COMPILE(ret, "alias arg2", node->u2.node);
+	COMPILE(ret, "alias arg1", node->u1.node);
+	COMPILE(ret, "alias arg2", node->u2.node);
 
-	  ADD_INSN1(ret, nd_line(node), alias, Qfalse);
+	ADD_INSN1(ret, nd_line(node), alias, Qfalse);
 
-	  if (!poped) {
-	      ADD_INSN(ret, nd_line(node), putnil);
-	  }
-	  break;
+	if (!poped) {
+	    ADD_INSN(ret, nd_line(node), putnil);
+	}
+	break;
       }
       case NODE_VALIAS:{
-	  ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(node->u1.id));
-	  ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(node->u2.id));
-	  ADD_INSN1(ret, nd_line(node), alias, Qtrue);
+	ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(node->u1.id));
+	ADD_INSN1(ret, nd_line(node), putobject, ID2SYM(node->u2.id));
+	ADD_INSN1(ret, nd_line(node), alias, Qtrue);
 
-	  if (!poped) {
-	      ADD_INSN(ret, nd_line(node), putnil);
-	  }
-	  break;
+	if (!poped) {
+	    ADD_INSN(ret, nd_line(node), putnil);
+	}
+	break;
       }
       case NODE_UNDEF:{
-	  COMPILE(ret, "undef arg", node->u2.node);
-	  ADD_INSN(ret, nd_line(node), undef);
+	COMPILE(ret, "undef arg", node->u2.node);
+	ADD_INSN(ret, nd_line(node), undef);
 
-	  if (!poped) {
-	      ADD_INSN(ret, nd_line(node), putnil);
-	  }
-	  break;
+	if (!poped) {
+	    ADD_INSN(ret, nd_line(node), putnil);
+	}
+	break;
       }
       case NODE_CLASS:{
 	VALUE iseqval =
Index: version.h
===================================================================
--- version.h	(revision 15834)
+++ version.h	(revision 15835)
@@ -1,7 +1,7 @@
 #define RUBY_VERSION "1.9.0"
-#define RUBY_RELEASE_DATE "2008-03-24"
+#define RUBY_RELEASE_DATE "2008-03-25"
 #define RUBY_VERSION_CODE 190
-#define RUBY_RELEASE_CODE 20080324
+#define RUBY_RELEASE_CODE 20080325
 #define RUBY_PATCHLEVEL 0
 
 #define RUBY_VERSION_MAJOR 1
@@ -9,7 +9,7 @@
 #define RUBY_VERSION_TEENY 0
 #define RUBY_RELEASE_YEAR 2008
 #define RUBY_RELEASE_MONTH 3
-#define RUBY_RELEASE_DAY 24
+#define RUBY_RELEASE_DAY 25
 
 #ifdef RUBY_EXTERN
 RUBY_EXTERN const char ruby_version[];

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

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