зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
abdada2d85
Коммит
aa358ac11c
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче