mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Modify insn list only when compiling
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
91533d9ab1
commit
28eb147484
1 changed files with 13 additions and 1 deletions
14
compile.c
14
compile.c
|
@ -487,6 +487,7 @@ static TRACE *new_trace_body(rb_iseq_t *iseq, rb_event_flag_t event, long data);
|
||||||
|
|
||||||
static int iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *anchor, const NODE *n, int);
|
static int iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *anchor, const NODE *n, int);
|
||||||
static int iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *const anchor);
|
static int iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *const anchor);
|
||||||
|
static int iseq_setup_insn(rb_iseq_t *iseq, LINK_ANCHOR *const anchor);
|
||||||
static int iseq_optimize(rb_iseq_t *iseq, LINK_ANCHOR *const anchor);
|
static int iseq_optimize(rb_iseq_t *iseq, LINK_ANCHOR *const anchor);
|
||||||
static int iseq_insns_unification(rb_iseq_t *iseq, LINK_ANCHOR *const anchor);
|
static int iseq_insns_unification(rb_iseq_t *iseq, LINK_ANCHOR *const anchor);
|
||||||
|
|
||||||
|
@ -618,6 +619,7 @@ rb_iseq_compile_ifunc(rb_iseq_t *iseq, const struct vm_ifunc *ifunc)
|
||||||
|
|
||||||
ADD_INSN(ret, ISEQ_COMPILE_DATA(iseq)->last_line, leave);
|
ADD_INSN(ret, ISEQ_COMPILE_DATA(iseq)->last_line, leave);
|
||||||
|
|
||||||
|
CHECK(iseq_setup_insn(iseq, ret));
|
||||||
return iseq_setup(iseq, ret);
|
return iseq_setup(iseq, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -732,6 +734,7 @@ rb_iseq_compile_node(rb_iseq_t *iseq, const NODE *node)
|
||||||
validate_labels(iseq, labels_table);
|
validate_labels(iseq, labels_table);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
CHECK(iseq_setup_insn(iseq, ret));
|
||||||
return iseq_setup(iseq, ret);
|
return iseq_setup(iseq, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1296,7 +1299,7 @@ update_catch_except_flags(struct rb_iseq_constant_body *body)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
|
iseq_setup_insn(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
|
||||||
{
|
{
|
||||||
if (RTEST(ISEQ_COMPILE_DATA(iseq)->err_info))
|
if (RTEST(ISEQ_COMPILE_DATA(iseq)->err_info))
|
||||||
return COMPILE_NG;
|
return COMPILE_NG;
|
||||||
|
@ -1326,6 +1329,15 @@ iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
|
||||||
dump_disasm_list(FIRST_ELEMENT(anchor));
|
dump_disasm_list(FIRST_ELEMENT(anchor));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return COMPILE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
|
||||||
|
{
|
||||||
|
if (RTEST(ISEQ_COMPILE_DATA(iseq)->err_info))
|
||||||
|
return COMPILE_NG;
|
||||||
|
|
||||||
debugs("[compile step 4.1 (iseq_set_sequence)]\n");
|
debugs("[compile step 4.1 (iseq_set_sequence)]\n");
|
||||||
if (!iseq_set_sequence(iseq, anchor)) return COMPILE_NG;
|
if (!iseq_set_sequence(iseq, anchor)) return COMPILE_NG;
|
||||||
if (compile_debug > 5)
|
if (compile_debug > 5)
|
||||||
|
|
Loading…
Reference in a new issue