* compile.c (iseq_specialized_instruction): specialize only
  concatenated newarray and send, no labels and no adjusts.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-03-17 13:19:02 +00:00
Родитель 8472c15440
Коммит e1ee61bfbd
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -2283,12 +2283,13 @@ insn_set_specialized_instruction(rb_iseq_t *iseq, INSN *iobj, int insn_id)
static int
iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
{
if (iobj->insn_id == BIN(newarray)) {
if (iobj->insn_id == BIN(newarray) && iobj->link.next &&
iobj->link.next->type == ISEQ_ELEMENT_INSN) {
/*
* [a, b, ...].max/min -> a, b, c, opt_newarray_max/min
*/
INSN *niobj = (INSN *)get_next_insn(iobj);
if (niobj && niobj->insn_id == BIN(send)) {
INSN *niobj = (INSN *)iobj->link.next;
if (niobj->insn_id == BIN(send)) {
struct rb_call_info *ci = (struct rb_call_info *)OPERAND_AT(niobj, 0);
if ((ci->flag & VM_CALL_ARGS_SIMPLE) && ci->orig_argc == 0) {
switch (ci->mid) {