summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-27 07:11:07 (GMT)
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-27 07:11:07 (GMT)
commite5b436cd76961741a3ba59e3c825f0b6e17864cb (patch)
treeafd7cb369652dea6505a217286eea5a3d50d01fc /tool
parent5d2d4c936d0cdce546cb21846cd639f6719bd6ae (diff)
* tool/instruction.rb: fix to follow current implementation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rwxr-xr-xtool/instruction.rb27
1 files changed, 17 insertions, 10 deletions
diff --git a/tool/instruction.rb b/tool/instruction.rb
index 4f7d08c..4511795 100755
--- a/tool/instruction.rb
+++ b/tool/instruction.rb
@@ -453,9 +453,9 @@ class RubyVM
pops.concat e_pops
rets.concat e_rets
defopes.concat e_defs
- sp_inc += "#{insn.sp_inc}"
+ sp_inc << "#{insn.sp_inc}"
- body += "{ /* unif: #{i} */\n" +
+ body << "{ /* unif: #{i} */\n" +
passed_vars.map{|rpvars|
pv = rpvars[0]
rv = rpvars[1]
@@ -463,15 +463,22 @@ class RubyVM
}.join("\n") +
"\n" +
redef_vars.map{|v, type|
- "#define #{v} #{v}_#{i}"
- }.join("\n") + "\n" +
- insn.body +
- passed_vars.map{|rpvars|
- "#undef #{rpvars[0][1]}"
+ "#{type} #{v} = #{v}_#{i};"
+ }.join("\n") + "\n"
+ if line = insn.body.instance_variable_get(:@line_no)
+ file = insn.body.instance_variable_get(:@file)
+ body << "#line #{line+1} \"#{file}\"\n"
+ body << insn.body
+ body << "\n#line __CURRENT_LINE__ \"__CURRENT_FILE__\"\n"
+ else
+ body << insn.body
+ end
+ body << redef_vars.keys.map{|v|
+ "#{v}_#{i} = #{v};"
}.join("\n") +
"\n" +
- redef_vars.keys.map{|v|
- "#undef #{v}"
+ passed_vars.map{|rpvars|
+ "#undef #{rpvars[0][1]}"
}.join("\n") +
"\n}\n"
}
@@ -893,7 +900,7 @@ class RubyVM
commit insn.body
commit '#line __CURRENT_LINE__ "__CURRENT_FILE__"'
else
- insn.body
+ commit insn.body
end
make_footer(insn)
end