aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--compile.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index da81dc4606..f860fa1881 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Sep 23 12:15:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (iseq_peephole_optimize): enable tail call
+ optimization inside a conditional block.
+
Thu Sep 22 13:00:04 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* gc.c (gc_start_internal): [DOC] methods without arguments
diff --git a/compile.c b/compile.c
index dac26c6ce0..72181d3b9f 100644
--- a/compile.c
+++ b/compile.c
@@ -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: