ruby-changes:49765
From: nobu <ko1@a...>
Date: Wed, 17 Jan 2018 15:24:02 +0900 (JST)
Subject: [ruby-changes:49765] nobu:r61883 (trunk): iseq.c: flatten TS_NUM operand conditions
nobu 2018-01-17 15:23:57 +0900 (Wed, 17 Jan 2018) New Revision: 61883 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61883 Log: iseq.c: flatten TS_NUM operand conditions Modified files: trunk/iseq.c Index: iseq.c =================================================================== --- iseq.c (revision 61882) +++ iseq.c (revision 61883) @@ -1534,21 +1534,24 @@ rb_insn_operand_intern(const rb_iseq_t * https://github.com/ruby/ruby/blob/trunk/iseq.c#L1534 break; case TS_NUM: /* ULONG */ - { - const char *type_str; - if (insn == BIN(branchiftype) && (type_str = rb_type_str((enum ruby_value_type)op)) != NULL) { - ret = rb_str_new_cstr(type_str); + if (insn == BIN(defined) && op_no == 0) { + enum defined_type deftype = (enum defined_type)op; + if (deftype == DEFINED_FUNC) { + ret = rb_fstring_cstr("func"); break; } - else if (insn == BIN(defined) && op_no == 0 && - ((enum defined_type)op == DEFINED_FUNC ? (ret = rb_fstring_cstr("func"), 1) : - (enum defined_type)op == DEFINED_REF ? (ret = rb_fstring_cstr("ref"), 1) : - (ret = rb_iseq_defined_string((enum defined_type)op)) != 0)) { - /* ok */ + if (deftype == DEFINED_REF) { + ret = rb_fstring_cstr("ref"); break; } - else { - ret = rb_sprintf("%"PRIuVALUE, op); + ret = rb_iseq_defined_string((enum defined_type)op); + if (ret) break; + } + else if (insn == BIN(branchiftype) && op_no == 0) { + const char *type_str = rb_type_str((enum ruby_value_type)op); + if (type_str) { + ret = rb_str_new_cstr(type_str); break; } } + ret = rb_sprintf("%"PRIuVALUE, op); break; case TS_LINDEX:{ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/