diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-23 03:15:31 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-23 03:15:31 +0000 |
commit | 7382eb7e389149f995f42d3af8dae8344bf49052 (patch) | |
tree | ba7a513ee0587d790223d0b121ad5a96c79fa30f /compile.c | |
parent | 9ec75a259d882daa1c769dcb0c1b76647b00f772 (diff) | |
download | ruby-7382eb7e389149f995f42d3af8dae8344bf49052.tar.gz |
compile.c: tailcall in conditinal block
* compile.c (iseq_peephole_optimize): enable tail call
optimization inside a conditional block.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -2281,6 +2281,13 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal /*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: |