summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-16 08:41:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-16 08:41:41 +0000
commit1ff30ea2b1675fa6bfa50bb5bac1f8cdea8524e1 (patch)
tree1c73ca5c7b94eea7afad132b6c6699f0d07818a4
parent6339ac02acdc2f96b1ac3d9a7562fcfafec478cc (diff)
compile.c: tailcall on aref and aset
* compile.c (iseq_peephole_optimize): optimize tail calls on aref and aset specialized instructions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--compile.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0722072..0c5d05b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
-Mon Nov 16 17:40:39 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Mon Nov 16 17:41:33 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (iseq_peephole_optimize): optimize tail calls on aref
+ and aset specialized instructions.
* compile.c (iseq_peephole_optimize): optimize replaced leave
instruction copied to jump instruction too.
diff --git a/compile.c b/compile.c
index ce0b932..2d47082 100644
--- a/compile.c
+++ b/compile.c
@@ -2061,7 +2061,10 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
INSN *piobj = (INSN *)get_prev_insn(iobj);
enum ruby_vminsn_type previ = piobj->insn_id;
- if (previ == BIN(send) || previ == BIN(opt_send_without_block) || previ == BIN(invokesuper)) {
+ if (previ == BIN(send) || previ == BIN(opt_send_without_block) ||
+ previ == BIN(invokesuper) ||
+ previ == BIN(opt_aref) || previ == BIN(opt_aref_with) ||
+ previ == BIN(opt_aset) || previ == BIN(opt_aset_with)) {
struct rb_call_info *ci = (struct rb_call_info *)piobj->operands[0];
rb_iseq_t *blockiseq = (rb_iseq_t *)piobj->operands[1];
if (blockiseq == 0) {