summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-17 14:34:30 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-17 14:34:30 +0000
commitaa358ac11cc7224eb2bf2c02e85a0956543726f2 (patch)
treeadf431d31dda9d71e91d0efe8b115e3a42a13358 /compile.c
parentabdada2d858557b9f12f8ac0f5b50c0def2ab79d (diff)
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
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index e8e14b6..2b58462 100644
--- a/compile.c
+++ b/compile.c
@@ -1889,8 +1889,9 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
* 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;