mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
a3ddead991
commit
778f32a153
2 changed files with 12 additions and 3 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
Thu Nov 26 21:36:40 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* compile.c (iseq_peephole_optimize): enable tail call
|
||||||
|
optimization for specialized indexers.
|
||||||
|
|
||||||
|
* compile.c (iseq_compile_each): blockiseq should be NULL, but not
|
||||||
|
Qnil.
|
||||||
|
|
||||||
Thu Nov 26 17:22:53 2015 NARUSE, Yui <naruse@ruby-lang.org>
|
Thu Nov 26 17:22:53 2015 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* regcomp.c, regenc.c, regexec.c, regint.h, enc/unicode.c:
|
* regcomp.c, regenc.c, regexec.c, regint.h, enc/unicode.c:
|
||||||
|
|
|
@ -2148,6 +2148,8 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
|
||||||
|
|
||||||
if (do_tailcallopt &&
|
if (do_tailcallopt &&
|
||||||
(iobj->insn_id == BIN(send) ||
|
(iobj->insn_id == BIN(send) ||
|
||||||
|
iobj->insn_id == BIN(opt_aref_with) ||
|
||||||
|
iobj->insn_id == BIN(opt_aset_with) ||
|
||||||
iobj->insn_id == BIN(invokesuper))) {
|
iobj->insn_id == BIN(invokesuper))) {
|
||||||
/*
|
/*
|
||||||
* send ...
|
* 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);
|
COMPILE(ret, "recv", node->nd_recv);
|
||||||
ADD_INSN3(ret, line, opt_aref_with,
|
ADD_INSN3(ret, line, opt_aref_with,
|
||||||
new_callinfo(iseq, idAREF, 1, 0, NULL, FALSE),
|
new_callinfo(iseq, idAREF, 1, 0, NULL, FALSE),
|
||||||
Qnil, /* CALL_CACHE */
|
NULL/* CALL_CACHE */, str);
|
||||||
str);
|
|
||||||
if (poped) {
|
if (poped) {
|
||||||
ADD_INSN(ret, line, pop);
|
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,
|
ADD_INSN3(ret, line, opt_aset_with,
|
||||||
new_callinfo(iseq, idASET, 2, 0, NULL, FALSE),
|
new_callinfo(iseq, idASET, 2, 0, NULL, FALSE),
|
||||||
Qnil/* CALL_CACHE */, str);
|
NULL/* CALL_CACHE */, str);
|
||||||
ADD_INSN(ret, line, pop);
|
ADD_INSN(ret, line, pop);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue