diff options
| author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-24 07:06:03 +0000 |
|---|---|---|
| committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-24 07:06:03 +0000 |
| commit | fc674b11d256af86cf16d37f82e87fc72edf9ae1 (patch) | |
| tree | e8a035cacbf9cbcaaf8fa77fcbbfa18ce0240286 /tool/compile.rb | |
| parent | 481d5ea7bbeb203e1ffac109dfc85fa93e65b3d8 (diff) | |
| download | ruby-fc674b11d256af86cf16d37f82e87fc72edf9ae1.tar.gz ruby-fc674b11d256af86cf16d37f82e87fc72edf9ae1.tar.xz ruby-fc674b11d256af86cf16d37f82e87fc72edf9ae1.zip | |
* tool/compile.rb, getrev.rb, runruby.rb: remove unused tools.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/compile.rb')
| -rw-r--r-- | tool/compile.rb | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/tool/compile.rb b/tool/compile.rb deleted file mode 100644 index 66960f985..000000000 --- a/tool/compile.rb +++ /dev/null @@ -1,67 +0,0 @@ -require 'optparse' -require 'pp' - -OutputCompileOption = { - # enable - :peephole_optimization =>true, - :inline_const_cache =>true, - - # disable - :specialized_instruction =>false, - :operands_unification =>false, - :instructions_unification =>false, - :stack_caching =>false, -} - -def compile_to_rb infile, outfile - iseq = VM::InstructionSequence.compile_file(infile, OutputCompileOption) - - open(outfile, 'w'){|f| - f.puts "VM::InstructionSequence.load(" + - "Marshal.load(<<EOS____.unpack('m*')[0])).eval" - f.puts [Marshal.dump(iseq.to_a)].pack('m*') - f.puts "EOS____" - } -end - -def compile_to_rbc infile, outfile, type - iseq = VM::InstructionSequence.compile_file(infile, OutputCompileOption) - - case type - when 'm' - open(outfile, 'wb'){|f| - f.print "RBCM" - f.puts Marshal.dump(iseq.to_a, f) - } - else - raise "Unsupported compile type: #{type}" - end -end - -## main - -outfile = 'a.rb' -type = 'm' -opt = OptionParser.new{|opt| - opt.on('-o file'){|o| - outfile = o - } - opt.on('-t type', '--type type'){|o| - type = o - } - opt.version = '0.0.1' -} - -opt.parse!(ARGV) - -ARGV.each{|file| - case outfile - when /\.rb\Z/ - compile_to_rb file, outfile - when /\.rbc\Z/ - compile_to_rbc file, outfile, type - else - raise - end -} - |
