summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authortmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-11 06:38:42 +0000
committertmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-11 06:38:42 +0000
commitbd892d05ed0565526c26b3e126a469e19865107b (patch)
tree3bd356e9e39ffd8c1b41dcf72e812677715b2de7 /compile.c
parent3e6cae687c34b2855b20631c0914f7dbe41e49fe (diff)
compile.c: add opt_aset instruction for faster Hash#[]= and Array#[]=
* compile.c (iseq_specialized_instruction): emit opt_aset instruction to optimize Hash#[]= and Array#[]= when called with Fixnum argument. [Bug #9227] [ruby-core:58956] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44136 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 af11baf..25e3652 100644
--- a/compile.c
+++ b/compile.c
@@ -1955,6 +1955,11 @@ iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
case idAREF: SP_INSN(aref); return COMPILE_OK;
}
break;
+ case 2:
+ switch (ci->mid) {
+ case idASET: SP_INSN(aset); return COMPILE_OK;
+ }
+ break;
}
}
if (ci->flag & VM_CALL_ARGS_SKIP_SETUP) {