summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-23 09:52:23 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-23 09:52:23 (GMT)
commitc6ad7a6272ad3f43f9efffda61040ab9f46add47 (patch)
tree3d31648ba316cc62752b11a6402c1b727d5ef106 /compile.c
parent87ca4f3065c76a0994ea13071b9f6641df8c03db (diff)
compile.c: insn before pop
* compile.c (iseq_peephole_optimize): more eliminatable instructions before `pop` without side effects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63246 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 e202435..2a089e8 100644
--- a/compile.c
+++ b/compile.c
@@ -2909,6 +2909,11 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
enum ruby_vminsn_type previ = ((INSN *)prev)->insn_id;
if (previ == BIN(putobject) || previ == BIN(putnil) ||
previ == BIN(putself) || previ == BIN(putstring) ||
+ previ == BIN(dup) ||
+ previ == BIN(getlocal) ||
+ previ == BIN(getblockparam) ||
+ previ == BIN(getblockparamproxy) ||
+ /* getinstancevariable may issue a warning */
previ == BIN(duparray)) {
/* just push operand or static value and pop soon, no
* side effects */