summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-23 07:45:39 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-23 07:45:39 (GMT)
commitbf6e2eb7e7ca144dc8a71d87d36edb0d852519a2 (patch)
treeb10e9b0b0622663ce29ec77f06a2531d08d82b7d /compile.c
parent130ef3b458e61b37a05690b1aee59d748543bfa6 (diff)
compile.c: drop unused array
* compile.c (iseq_peephole_optimize): drop unused dynamic array literal, without concatenation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index d34376c..0e7153f 100644
--- a/compile.c
+++ b/compile.c
@@ -2942,6 +2942,11 @@ 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(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);