summaryrefslogtreecommitdiffstats
path: root/lib/vm/instruction.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-06 09:38:51 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-06 09:38:51 +0000
commitdee5c48c9f59d0326933cf9594793e8c76b50275 (patch)
tree52fc94cf876d3d084d2b4516a56abbe73f9701c4 /lib/vm/instruction.rb
parent78091b55f62bd105c9ddaf1d730b4eb8624a1055 (diff)
downloadruby-dee5c48c9f59d0326933cf9594793e8c76b50275.tar.gz
ruby-dee5c48c9f59d0326933cf9594793e8c76b50275.tar.xz
ruby-dee5c48c9f59d0326933cf9594793e8c76b50275.zip
* lib/vm/instruction.rb (make_header_analysys): add to separate
header addition process. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/vm/instruction.rb')
-rw-r--r--lib/vm/instruction.rb13
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