ruby-changes:46960
From: nobu <ko1@a...>
Date: Tue, 13 Jun 2017 12:20:18 +0900 (JST)
Subject: [ruby-changes:46960] nobu:r59075 (trunk): * compile.c (dump_disasm_list_with_cursor): replace with
nobu 2017-06-13 12:20:12 +0900 (Tue, 13 Jun 2017) New Revision: 59075 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59075 Log: * compile.c (dump_disasm_list_with_cursor): replace with dump_disasm_list_with_cursor_dest. Modified files: trunk/compile.c Index: compile.c =================================================================== --- compile.c (revision 59074) +++ compile.c (revision 59075) @@ -428,8 +428,7 @@ freeze_hide_obj(VALUE obj) https://github.com/ruby/ruby/blob/trunk/compile.c#L428 #define gl_node_level ISEQ_COMPILE_DATA(iseq)->node_level #endif -static void dump_disasm_list_with_cursor_dest(const LINK_ELEMENT *link, const LINK_ELEMENT *curr, const LABEL *dest); -static void dump_disasm_list_with_cursor(const LINK_ELEMENT *elem, const LINK_ELEMENT *curr); +static void dump_disasm_list_with_cursor(const LINK_ELEMENT *link, const LINK_ELEMENT *curr, const LABEL *dest); static void dump_disasm_list(const LINK_ELEMENT *elem); static int insn_data_length(INSN *iobj); @@ -1563,10 +1562,13 @@ get_ivar_ic_value(rb_iseq_t *iseq,ID id) https://github.com/ruby/ruby/blob/trunk/compile.c#L1562 return val; } +#define BADINSN_DUMP(anchor, list, dest) \ + dump_disasm_list_with_cursor(&anchor->anchor, list, dest) + #define BADINSN_ERROR \ (generated_iseq ? xfree(generated_iseq) : 0, \ line_info_table ? xfree(line_info_table) : 0, \ - dump_disasm_list_with_cursor(&anchor->anchor, list), \ + BADINSN_DUMP(anchor, list, NULL), \ COMPILE_ERROR) /** @@ -2664,7 +2666,7 @@ insn_set_sc_state(rb_iseq_t *iseq, const https://github.com/ruby/ruby/blob/trunk/compile.c#L2666 if (lobj->sc_state != 0) { if (lobj->sc_state != nstate) { - dump_disasm_list_with_cursor_dest(anchor, &iobj->link, lobj); + BADINSN_DUMP(anchor, iobj, lobj); COMPILE_ERROR(iseq, iobj->line_no, "insn_set_sc_state error: %d at "LABEL_FORMAT ", %d expected\n", @@ -6520,17 +6522,11 @@ insn_data_to_s_detail(INSN *iobj) https://github.com/ruby/ruby/blob/trunk/compile.c#L6522 static void dump_disasm_list(const LINK_ELEMENT *link) { - dump_disasm_list_with_cursor(link, NULL); -} - -static void -dump_disasm_list_with_cursor(const LINK_ELEMENT *link, const LINK_ELEMENT *curr) -{ - dump_disasm_list_with_cursor_dest(link, curr, NULL); + dump_disasm_list_with_cursor(link, NULL, NULL); } static void -dump_disasm_list_with_cursor_dest(const LINK_ELEMENT *link, const LINK_ELEMENT *curr, const LABEL *dest) +dump_disasm_list_with_cursor(const LINK_ELEMENT *link, const LINK_ELEMENT *curr, const LABEL *dest) { int pos = 0; INSN *iobj; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/