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

ruby-changes:40514

From: nobu <ko1@a...>
Date: Mon, 16 Nov 2015 17:41:50 +0900 (JST)
Subject: [ruby-changes:40514] nobu:r52595 (trunk): compile.c: tailcall on aref and aset

nobu	2015-11-16 17:41:41 +0900 (Mon, 16 Nov 2015)

  New Revision: 52595

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

  Log:
    compile.c: tailcall on aref and aset
    
    * compile.c (iseq_peephole_optimize): optimize tail calls on aref
      and aset specialized instructions.

  Modified files:
    trunk/ChangeLog
    trunk/compile.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 52594)
+++ ChangeLog	(revision 52595)
@@ -1,4 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
-Mon Nov 16 17:40:39 2015  Nobuyoshi Nakada  <nobu@r...>
+Mon Nov 16 17:41:33 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* compile.c (iseq_peephole_optimize): optimize tail calls on aref
+	  and aset specialized instructions.
 
 	* compile.c (iseq_peephole_optimize): optimize replaced leave
 	  instruction copied to jump instruction too.
Index: compile.c
===================================================================
--- compile.c	(revision 52594)
+++ compile.c	(revision 52595)
@@ -2061,7 +2061,10 @@ iseq_peephole_optimize(rb_iseq_t *iseq, https://github.com/ruby/ruby/blob/trunk/compile.c#L2061
 	INSN *piobj = (INSN *)get_prev_insn(iobj);
 	enum ruby_vminsn_type previ = piobj->insn_id;
 
-	if (previ == BIN(send) || previ == BIN(opt_send_without_block) || previ == BIN(invokesuper)) {
+	if (previ == BIN(send) || previ == BIN(opt_send_without_block) ||
+	    previ == BIN(invokesuper) ||
+	    previ == BIN(opt_aref) || previ == BIN(opt_aref_with) ||
+	    previ == BIN(opt_aset) || previ == BIN(opt_aset_with)) {
 	    struct rb_call_info *ci = (struct rb_call_info *)piobj->operands[0];
 	    rb_iseq_t *blockiseq = (rb_iseq_t *)piobj->operands[1];
 	    if (blockiseq == 0) {

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

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