diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-26 12:36:43 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-26 12:36:43 +0000 |
commit | 65946301b2b487398f4df8d55018377fa3644bd9 (patch) | |
tree | d4dbe7c0bb8f49f9878895e840ce272f3228c4df /compile.c | |
parent | 8349fba6a8295e1c45148029d1170737068d622f (diff) | |
download | ruby-65946301b2b487398f4df8d55018377fa3644bd9.tar.gz |
compile.c: tailcall opt for indexers
* compile.c (iseq_peephole_optimize): enable tail call
optimization for specialized indexers.
* compile.c (iseq_compile_each): blockiseq should be NULL, but not
Qnil.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -2148,6 +2148,8 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal if (do_tailcallopt && (iobj->insn_id == BIN(send) || + iobj->insn_id == BIN(opt_aref_with) || + iobj->insn_id == BIN(opt_aset_with) || iobj->insn_id == BIN(invokesuper))) { /* * send ... @@ -4770,8 +4772,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) COMPILE(ret, "recv", node->nd_recv); ADD_INSN3(ret, line, opt_aref_with, new_callinfo(iseq, idAREF, 1, 0, NULL, FALSE), - Qnil, /* CALL_CACHE */ - str); + NULL/* CALL_CACHE */, str); if (poped) { ADD_INSN(ret, line, pop); } @@ -5808,7 +5809,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) } ADD_INSN3(ret, line, opt_aset_with, new_callinfo(iseq, idASET, 2, 0, NULL, FALSE), - Qnil/* CALL_CACHE */, str); + NULL/* CALL_CACHE */, str); ADD_INSN(ret, line, pop); break; } |