summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-01 00:08:36 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-01 00:08:36 +0000
commit5d3aa0ac5845e3b8bc5cc2fa6feceba1004dca55 (patch)
treedf0608d73cabe3d71e67472d7a4a6f41dbfcc357
parentcf18fc32728e7f1415cb9625e77435dac61cc9aa (diff)
Revert "Collapse putobject, putobject, newarray"
This reverts commit cbdf5a1842cda89347a2c840d23c35f041aead68. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--compile.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/compile.c b/compile.c
index f511c75..32606e9 100644
--- a/compile.c
+++ b/compile.c
@@ -2823,53 +2823,6 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
}
}
- /*
- * putobject "foo"
- * putobject "bar"
- * newarray 2
- *
- * ==>
- *
- * duparray ["foo", "bar"]
- */
- if (IS_INSN_ID(iobj, newarray)) {
- int len;
-
- len = NUM2INT(OPERAND_AT(iobj, 0));
-
- if (len > 0) {
- INSN *link;
- INSN *cur;
- int i;
-
- link = iobj;
- i = len;
- while(i > 0) {
- link = (INSN *)get_prev_insn(link);
- if (!IS_INSN_ID(link, putobject))
- break;
-
- i--;
- }
-
- /* All previous instructions were `putobject` */
- if (i == 0) {
- VALUE list = rb_ary_new_capa(len);
- iseq_add_mark_object_compile_time(iseq, list);
-
- while(i < len) {
- cur = link;
- rb_ary_push(list, OPERAND_AT(cur, 0));
- link = (INSN *)get_next_insn(link);
- ELEM_REMOVE(&cur->link);
- i++;
- }
- iobj->insn_id = BIN(duparray);
- OPERAND_AT(iobj, 0) = list;
- }
- }
- }
-
if (IS_INSN_ID(iobj, leave)) {
remove_unreachable_chunk(iseq, iobj->link.next);
}