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

ruby-changes:40680

From: nobu <ko1@a...>
Date: Thu, 26 Nov 2015 21:36:57 +0900 (JST)
Subject: [ruby-changes:40680] nobu:r52759 (trunk): compile.c: tailcall opt for indexers

nobu	2015-11-26 21:36:43 +0900 (Thu, 26 Nov 2015)

  New Revision: 52759

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

  Log:
    compile.c: tailcall opt for indexers
    
    * compile.c (iseq_peephole_optimize): enable tail call
      optimization for specialized indexers.
    * compile.c (iseq_compile_each): blockiseq should be NULL, but not
      Qnil.

  Modified files:
    trunk/ChangeLog
    trunk/compile.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 52758)
+++ ChangeLog	(revision 52759)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Nov 26 21:36:40 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* compile.c (iseq_peephole_optimize): enable tail call
+	  optimization for specialized indexers.
+
+	* compile.c (iseq_compile_each): blockiseq should be NULL, but not
+	  Qnil.
+
 Thu Nov 26 17:22:53 2015  NARUSE, Yui  <naruse@r...>
 
 	* regcomp.c, regenc.c, regexec.c, regint.h, enc/unicode.c:
Index: compile.c
===================================================================
--- compile.c	(revision 52758)
+++ compile.c	(revision 52759)
@@ -2148,6 +2148,8 @@ iseq_peephole_optimize(rb_iseq_t *iseq, https://github.com/ruby/ruby/blob/trunk/compile.c#L2148
 
     if (do_tailcallopt &&
 	(iobj->insn_id == BIN(send) ||
+	 iobj->insn_id == BIN(opt_aref_with) ||
+	 iobj->insn_id == BIN(opt_aset_with) ||
 	 iobj->insn_id == BIN(invokesuper))) {
 	/*
 	 *  send ...
@@ -4770,8 +4772,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L4772
 	    COMPILE(ret, "recv", node->nd_recv);
 	    ADD_INSN3(ret, line, opt_aref_with,
 		      new_callinfo(iseq, idAREF, 1, 0, NULL, FALSE),
-		      Qnil, /* CALL_CACHE */
-		      str);
+		      NULL/* CALL_CACHE */, str);
 	    if (poped) {
 		ADD_INSN(ret, line, pop);
 	    }
@@ -5808,7 +5809,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L5809
 	    }
 	    ADD_INSN3(ret, line, opt_aset_with,
 		      new_callinfo(iseq, idASET, 2, 0, NULL, FALSE),
-		      Qnil/* CALL_CACHE */, str);
+		      NULL/* CALL_CACHE */, str);
 	    ADD_INSN(ret, line, pop);
 	    break;
 	}

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

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