summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-23 07:22:27 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-23 07:22:27 (GMT)
commit130ef3b458e61b37a05690b1aee59d748543bfa6 (patch)
tree64a4d2372cfd7b84da125eee46962965b07697c6 /compile.c
parent8752a1ff4e87c226a4dfd966bc10c083a81f8605 (diff)
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
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index ef92a83..d34376c 100644
--- a/compile.c
+++ b/compile.c
@@ -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);
+ }
+ }
}
}