From 324b6d306d7da4fd3fc109e4e9781c782b64369f Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 9 Nov 2017 23:08:01 +0000 Subject: iseq.c: operand lvar * iseq.c (rb_insn_operand_intern): show local variable operand name in unified instructions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- template/optinsn.inc.tmpl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'template') diff --git a/template/optinsn.inc.tmpl b/template/optinsn.inc.tmpl index 186ec46982..b1fba6dea3 100644 --- a/template/optinsn.inc.tmpl +++ b/template/optinsn.inc.tmpl @@ -52,3 +52,27 @@ insn_operands_unification(INSN *insnobj) return insnobj; } +int +rb_insn_unified_local_var_level(VALUE insn) +{ +#ifdef OPT_OPERANDS_UNIFICATION + /* optimize rule */ + switch (insn) { +% opt_insns_map.each do |originsn, optinsns| +% optinsns.each {|opti| + case BIN(<%=opti.name%>): +% opti.defopes.each {|opinfo| +% next if opinfo[1] == '*' + return <%=opinfo[1]%>; +% break +% } +% } +% end + + default: + /* do nothing */; + break; + } +#endif + return -1; +} -- cgit v1.2.3