ruby-changes:52308
From: nobu <ko1@a...>
Date: Thu, 23 Aug 2018 16:22:38 +0900 (JST)
Subject: [ruby-changes:52308] nobu:r64516 (trunk): compile.c: drop unused string
nobu 2018-08-23 16:22:27 +0900 (Thu, 23 Aug 2018) New Revision: 64516 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64516 Log: compile.c: drop unused string * compile.c (iseq_peephole_optimize): drop unused dynamic string literal, without concatenation. Modified files: trunk/compile.c Index: compile.c =================================================================== --- compile.c (revision 64515) +++ compile.c (revision 64516) @@ -2942,6 +2942,15 @@ 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(concatstrings)) { + if (OPERAND_AT(prev, 0) == INT2FIX(1)) { + ELEM_REMOVE(prev); + } + else { + ELEM_REMOVE(&iobj->link); + INSN_OF(prev) = BIN(adjuststack); + } + } } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/