ruby-changes:52309
From: nobu <ko1@a...>
Date: Thu, 23 Aug 2018 16:45:45 +0900 (JST)
Subject: [ruby-changes:52309] nobu:r64517 (trunk): compile.c: drop unused array
nobu 2018-08-23 16:45:39 +0900 (Thu, 23 Aug 2018) New Revision: 64517 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64517 Log: compile.c: drop unused array * compile.c (iseq_peephole_optimize): drop unused dynamic array literal, without concatenation. Modified files: trunk/compile.c Index: compile.c =================================================================== --- compile.c (revision 64516) +++ compile.c (revision 64517) @@ -2942,6 +2942,11 @@ iseq_peephole_optimize(rb_iseq_t *iseq, https://github.com/ruby/ruby/blob/trunk/compile.c#L2942 else if (previ == BIN(newarray) && iseq_pop_newarray(iseq, (INSN*)prev)) { ELEM_REMOVE(&iobj->link); } + else if (previ == BIN(concatarray)) { + INSN *piobj = (INSN *)prev; + INSERT_BEFORE_INSN1(piobj, piobj->insn_info.line_no, splatarray, Qfalse); + INSN_OF(piobj) = BIN(pop); + } else if (previ == BIN(concatstrings)) { if (OPERAND_AT(prev, 0) == INT2FIX(1)) { ELEM_REMOVE(prev); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/