compile.c: drop unused string

* compile.c (iseq_peephole_optimize): drop unused dynamic string
  literal, without concatenation.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-08-23 07:22:27 +00:00
parent 8752a1ff4e
commit 130ef3b458

View File

@ -2942,6 +2942,15 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
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);
}
}
}
}