diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/vm/instruction.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/vm/instruction.rb b/lib/vm/instruction.rb index ed59af0fa..af8f0ac64 100644 --- a/lib/vm/instruction.rb +++ b/lib/vm/instruction.rb @@ -786,6 +786,14 @@ module RubyVM ret.join("\n") + "\n" end + def make_header_analysys insn + ret = " USAGE_ANALYSIS_INSN(BIN(#{insn.name}));\n" + insn.opes.each_with_index{|op, i| + ret += " USAGE_ANALYSIS_OPERAND(BIN(#{insn.name}), #{i}, #{op[1]});\n" + } + ret + end + def make_header insn ret = "\nINSN_ENTRY(#{insn.name}){\n" ret += " /* prepare stack status */\n" if verbose? @@ -814,10 +822,7 @@ module RubyVM ret += " #define LABEL_IS_SC(lab) LABEL_##lab##_###{insn.sc.size == 0 ? 't' : 'f'}\n" - ret += " USAGE_ANALYSIS_INSN(BIN(#{insn.name}));\n" - insn.opes.each_with_index{|op, i| - ret += " USAGE_ANALYSIS_OPERAND(BIN(#{insn.name}), #{i}, #{op[1]});\n" - } + ret += make_header_analysys insn ret += "{\n" end |