Skip to content

Commit aa358ac

Browse files
committed
compile.c: tailcall on super
* compile.c (iseq_peephole_optimize): enable tail call optimization on super too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent abdada2 commit aa358ac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compile.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1889,8 +1889,9 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
18891889
* leave # unreachable
18901890
*/
18911891
INSN *piobj = (INSN *)get_prev_insn((INSN *)list);
1892+
enum ruby_vminsn_type previ = piobj->insn_id;
18921893

1893-
if (piobj->insn_id == BIN(send) || piobj->insn_id == BIN(opt_send_simple)) {
1894+
if (previ == BIN(send) || previ == BIN(opt_send_simple) || previ == BIN(invokesuper)) {
18941895
rb_call_info_t *ci = (rb_call_info_t *)piobj->operands[0];
18951896
if (ci->blockiseq == 0) {
18961897
ci->flag |= VM_CALL_TAILCALL;

0 commit comments

Comments
 (0)