ruby-changes:42083
From: nobu <ko1@a...>
Date: Thu, 17 Mar 2016 22:19:07 +0900 (JST)
Subject: [ruby-changes:42083] nobu:r54157 (trunk): compile.c: strict condition
nobu 2016-03-17 22:19:02 +0900 (Thu, 17 Mar 2016) New Revision: 54157 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54157 Log: compile.c: strict condition * compile.c (iseq_specialized_instruction): specialize only concatenated newarray and send, no labels and no adjusts. Modified files: trunk/compile.c Index: compile.c =================================================================== --- compile.c (revision 54156) +++ compile.c (revision 54157) @@ -2283,12 +2283,13 @@ insn_set_specialized_instruction(rb_iseq https://github.com/ruby/ruby/blob/trunk/compile.c#L2283 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) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/