compile.c: strict condition
* 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:
parent
8472c15440
commit
e1ee61bfbd
@ -2283,12 +2283,13 @@ insn_set_specialized_instruction(rb_iseq_t *iseq, INSN *iobj, int insn_id)
|
|||||||
static int
|
static int
|
||||||
iseq_specialized_instruction(rb_iseq_t *iseq, INSN *iobj)
|
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
|
* [a, b, ...].max/min -> a, b, c, opt_newarray_max/min
|
||||||
*/
|
*/
|
||||||
INSN *niobj = (INSN *)get_next_insn(iobj);
|
INSN *niobj = (INSN *)iobj->link.next;
|
||||||
if (niobj && niobj->insn_id == BIN(send)) {
|
if (niobj->insn_id == BIN(send)) {
|
||||||
struct rb_call_info *ci = (struct rb_call_info *)OPERAND_AT(niobj, 0);
|
struct rb_call_info *ci = (struct rb_call_info *)OPERAND_AT(niobj, 0);
|
||||||
if ((ci->flag & VM_CALL_ARGS_SIMPLE) && ci->orig_argc == 0) {
|
if ((ci->flag & VM_CALL_ARGS_SIMPLE) && ci->orig_argc == 0) {
|
||||||
switch (ci->mid) {
|
switch (ci->mid) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user