ruby-changes:44135
From: nobu <ko1@a...>
Date: Fri, 23 Sep 2016 12:15:38 +0900 (JST)
Subject: [ruby-changes:44135] nobu:r56208 (trunk): compile.c: tailcall in conditinal block
nobu 2016-09-23 12:15:31 +0900 (Fri, 23 Sep 2016) New Revision: 56208 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56208 Log: compile.c: tailcall in conditinal block * compile.c (iseq_peephole_optimize): enable tail call optimization inside a conditional block. Modified files: trunk/ChangeLog trunk/compile.c Index: ChangeLog =================================================================== --- ChangeLog (revision 56207) +++ ChangeLog (revision 56208) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Sep 23 12:15:29 2016 Nobuyoshi Nakada <nobu@r...> + + * compile.c (iseq_peephole_optimize): enable tail call + optimization inside a conditional block. + Thu Sep 22 13:00:04 2016 Kazuhiro NISHIYAMA <zn@m...> * gc.c (gc_start_internal): [DOC] methods without arguments Index: compile.c =================================================================== --- compile.c (revision 56207) +++ compile.c (revision 56208) @@ -2281,6 +2281,13 @@ iseq_peephole_optimize(rb_iseq_t *iseq, https://github.com/ruby/ruby/blob/trunk/compile.c#L2281 /*case BIN(trace):*/ next = next->next; break; + case BIN(jump): + /* if cond + * return tailcall + * end + */ + next = get_destination_insn((INSN *)next); + break; case BIN(leave): piobj = iobj; default: -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/