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

ruby-changes:31622

From: nobu <ko1@a...>
Date: Sun, 17 Nov 2013 23:34:35 +0900 (JST)
Subject: [ruby-changes:31622] nobu:r43701 (trunk): compile.c: tailcall on super

nobu	2013-11-17 23:34:30 +0900 (Sun, 17 Nov 2013)

  New Revision: 43701

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

  Log:
    compile.c: tailcall on super
    
    * compile.c (iseq_peephole_optimize): enable tail call optimization on
      super too.

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 43700)
+++ compile.c	(revision 43701)
@@ -1889,8 +1889,9 @@ iseq_peephole_optimize(rb_iseq_t *iseq, https://github.com/ruby/ruby/blob/trunk/compile.c#L1889
 	 *  leave # unreachable
 	 */
 	INSN *piobj = (INSN *)get_prev_insn((INSN *)list);
+	enum ruby_vminsn_type previ = piobj->insn_id;
 
-	if (piobj->insn_id == BIN(send) || piobj->insn_id == BIN(opt_send_simple)) {
+	if (previ == BIN(send) || previ == BIN(opt_send_simple) || previ == BIN(invokesuper)) {
 	    rb_call_info_t *ci = (rb_call_info_t *)piobj->operands[0];
 	    if (ci->blockiseq == 0) {
 		ci->flag |= VM_CALL_TAILCALL;

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

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