Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …

…tasks.
  • Loading branch information...
commit 569fccd2e67bdf4220add2d93fb1978e76653804 1 parent 6506bea
@drbrain drbrain authored
View
48 Rakefile
@@ -12,12 +12,12 @@ $compiler = nil
# require 'rakelib/const_generator'
# require 'rakelib/types_generator'
-task :default => :build
+task :default => %w[build vm:test]
# BUILD TASKS
desc "Build everything that needs to be built"
-task :build => 'build:vm'
+task :build => 'build:all'
# task :stable_compiler do
# if ENV['USE_CURRENT'] or ENV['SYSTEM']
@@ -79,21 +79,15 @@ task :build => 'build:vm'
namespace :build do
-# task :all => %w[
-# build:shotgun
+ task :all => %w[
+ vm
+ ]
# build:platform
# build:rbc
# compiler
# lib/etc.rb
# lib/rbconfig.rb
# extensions
-# ]
-
- task :vm => "vm/vm"
-
- file "vm/vm" do
- sh "cd vm; rake"
- end
# task :simple => "build:rbc" do
# sh "cd vm; rake"
@@ -128,7 +122,7 @@ namespace :build do
# file "shotgun/rubinius.bin" => c_source do
# sh make('vm')
# end
-
+
# file "shotgun/rubinius.local.bin" => c_source do
# sh make('vm')
# end
@@ -229,13 +223,13 @@ end
# desc "Recompile all ruby system files"
# task :rebuild => %w[clean build:all]
-# desc "Alias for clean:all"
-# task :clean => "clean:all"
+desc 'Remove rubinius build files'
+task :clean => %w[vm:clean clean:crap]
-# desc "Alias for clean:distclean"
-# task :distclean => "clean:distclean"
+desc 'Remove rubinius build files and external library build files'
+task :distclean => %w[vm:distclean]
-# namespace :clean do
+namespace :clean do
# desc "Clean everything but third-party libs"
# task :all => %w[clean:rbc clean:extensions clean:shotgun clean:generated clean:crap]
@@ -262,26 +256,18 @@ end
# end
# end
-# desc "Cleans up VM building site"
-# task :shotgun do
-# sh make('clean')
-# end
-
# desc "Cleans up generated files"
# task :generated do
# rm_f Dir["shotgun/lib/grammar.c"], :verbose => $verbose
# end
-# desc "Cleans up VM and external libs"
-# task :external do
-# sh "cd shotgun; #{make('distclean')}"
-# end
+ desc "Cleans up editor files and other misc crap"
+ task :crap do
+ files = (Dir["*~"] + Dir["**/*~"]).uniq
-# desc "Cleans up editor files and other misc crap"
-# task :crap do
-# rm_f Dir["*~"] + Dir["**/*~"], :verbose => $verbose
-# end
-# end
+ rm_f files, :verbose => $verbose unless files.empty?
+ end
+end
# # SPEC TASKS
# desc "Run all 'known good' specs (task alias for spec:ci)"
View
239 rakelib/vm.rake
@@ -0,0 +1,239 @@
+task :vm => 'vm/vm'
+
+############################################################
+# Files, Flags, & Constants
+
+ENV.delete 'CDPATH' # confuses llvm_config
+LLVM_CONFIG = "vm/external_libs/llvm/Release/bin/llvm-config"
+tests = FileList["vm/test/test_*.hpp"]
+srcs = FileList["vm/*.{cpp,c}"]
+hdrs = FileList["vm/*.{hpp,h}"]
+objs = srcs.map { |f| f.sub(/c(pp)?$/, 'o') }
+dep_file = "vm/.depends.mf"
+vm_objs = %w[ vm/drivers/cli.o ]
+vm_srcs = %w[ vm/drivers/cli.cpp ]
+EX_INC = %w[ libtommath onig libffi/include
+ libltdl libev llvm/include
+ ].map { |f| "vm/external_libs/#{f}" }
+INSN_GEN = %w[ vm/gen/iseq_instruction_names.cpp
+ vm/gen/iseq_instruction_names.hpp
+ vm/test/test_instructions.hpp ]
+TYPE_GEN = %w[ vm/gen/simple_field.rb
+ vm/gen/typechecks.gen.cpp
+ vm/gen/primitives_declare.hpp
+ vm/gen/primitives_glue.gen.cpp ]
+
+LLVM_A = "vm/external_libs/llvm/Release/lib/libLLVMSystem.a"
+EXTERNALS = %W[ #{LLVM_A}
+ vm/external_libs/libtommath/libtommath.a
+ vm/external_libs/onig/.libs/libonig.a
+ vm/external_libs/libffi/.libs/libffi.a
+ vm/external_libs/libltdl/.libs/libltdl.a
+ vm/external_libs/libev/.libs/libev.a ]
+OPTIONS = {
+ LLVM_A => "--enable-targets=host-only --enable-optimized"
+ }
+
+INCLUDES = (EX_INC + %w[vm/test/cxxtest vm .]).map { |f| "-I#{f}" }
+FLAGS = %w(-Wall -ggdb -gdwarf-2)
+
+FLAGS << "-O2" if ENV['FAST']
+
+def compile(obj, src)
+ cc = "gcc" # File.basename(src) == "c" ? "gcc" : "g++"
+
+ unless defined? $llvm_c then
+ $llvm_c = `#{LLVM_CONFIG} --cflags`.split(/\s+/)
+ $llvm_c.delete_if { |e| e.index("-O") == 0 }
+ end
+
+ flags = (INCLUDES + FLAGS + $llvm_c).join(' ')
+
+ sh "#{cc} #{flags} -c -o #{obj} #{src} 2>&1"
+end
+
+############################################################
+# Other Tasks
+
+rule '.o' do |t|
+ obj = t.name
+ src = t.prerequisites.find { |f| f =~ /#{File.basename obj, '.o'}\.c(pp)?$/}
+
+ compile obj, src
+end
+
+def files targets, dependencies = nil, &block
+ targets.each do |target|
+ if dependencies then
+ file target => dependencies, &block
+ else
+ file target, &block
+ end
+ end
+end
+
+directory "vm/gen"
+file "vm/type_info.o" => "vm/gen/typechecks.gen.cpp"
+file "vm/primitives.hpp" => "vm/gen/primitives_declare.hpp"
+files Dir["vm/builtin_*.hpp"], INSN_GEN
+files objs, EXTERNALS
+files vm_objs, vm_srcs
+
+objs.zip(srcs).each do |obj, src|
+ file obj => src
+end
+
+objs += ["vm/instructions.o"]
+
+files EXTERNALS do |t|
+ path = File.join(*split_all(t.name)[0..2])
+ configure_path = File.join(path, 'configure')
+
+ if File.exist? configure_path then
+ sh "cd #{path}; ./configure #{OPTIONS[t.name]} && make"
+ else
+ sh "cd #{path}; make"
+ end
+end
+
+file 'vm/instructions.rb' => 'vm/instructions_gen.rb'
+
+files INSN_GEN, %w[vm/gen vm/instructions.rb] do
+ ruby 'vm/instructions.rb', :verbose => $verbose
+end
+
+files TYPE_GEN, %w[vm/gen vm/instructions.rb vm/field_extract.rb] do
+ field_extract
+end
+
+file 'vm/vm' => EXTERNALS + objs + vm_objs do |t|
+ link t
+end
+
+file 'vm/gen/primitives_glue.gen.cpp' => hdrs
+
+file 'vm/test/runner.cpp' => tests do
+ tests += [{ :verbose => true }]
+ sh("vm/test/cxxtest/cxxtestgen.pl", "--error-printer", "--have-eh",
+ "--abort-on-fail", "-o", "vm/test/runner.cpp", *tests)
+end
+
+file 'vm/test/runner.o' => 'vm/test/runner.cpp' # no rule .o => .cpp
+
+file 'vm/test/runner' => EXTERNALS + objs + %w[vm/test/runner.o] do |t|
+ link t
+end
+
+file "vm/instructions.o" => %w[vm/llvm/instructions.cpp vm/instructions.rb] do
+ ruby "vm/rubypp.rb vm/llvm/instructions.cpp vm/llvm/.instructions.cpp"
+ compile "vm/instructions.o", "vm/llvm/.instructions.cpp"
+ rm_f "vm/llvm/.instructions.cpp", :verbose => $verbose
+end
+
+file "vm/instructions.bc" => "vm/llvm/instructions.cpp" do
+ ruby "vm/rubypp.rb vm/llvm/instructions.cpp vm/llvm/.instructions.cpp"
+ sh "llvm-g++ -emit-llvm -Ivm -Ivm/external_libs/libffi/include -c -o vm/instructions.bc vm/llvm/.instructions.cpp", :verbose => true
+ rm_f "llvm/.instructions.cpp", :verbose => $verbose
+end
+
+############################################################$
+# Importers & Methods:
+
+require 'rake/loaders/makefile'
+
+file dep_file => srcs + hdrs + vm_srcs do |t|
+ flags = (INCLUDES + FLAGS).join(' ')
+ flags << " -D__STDC_LIMIT_MACROS"
+
+ dep = nil
+ Dir.chdir 'vm' do
+ dep = `makedepend -f- -- #{flags} -- #{t.prerequisites} 2>/dev/null`
+ end
+ dep.gsub!(%r% /usr/include\S+%, '') # speeds up rake a lot
+ dep.gsub!(%r%^\S+:[^ ]%, '')
+
+ File.open t.name, 'w' do |f|
+ f.puts dep
+ end
+end
+
+import dep_file
+
+def ex_libs # needs to be method to delay running of llvm_config
+ unless defined? $ex_libs then
+ $ex_libs = EXTERNALS + [ "-ldl" ]
+ $ex_libs << "-lrt" if RUBY_PLATFORM =~ /linux/
+
+ llvm_libfiles = `#{LLVM_CONFIG} --libfiles all`.split(/\s+/)
+ llvm_libfiles = llvm_libfiles.select { |f| File.file? f }
+
+ pwd = File.join Dir.pwd, '' # add /
+ llvm_libfiles = llvm_libfiles.map { |f| f.sub pwd, '' }
+ $ex_libs += llvm_libfiles
+ end
+ $ex_libs
+end
+
+def field_extract
+ order = %w[vm/builtin_object.hpp vm/objects.hpp]
+ order += File.read("vm/objects.hpp").scan(/vm\/builtin_[^"]+/)
+ order << { :verbose => $verbose}
+ ruby('vm/field_extract.rb', *order)
+end
+
+def link t
+ $link_opts ||= `#{LLVM_CONFIG} --ldflags`.split(/\s+/).join(' ')
+
+ ld = ENV['LD'] || 'g++'
+ o = t.prerequisites.find_all { |f| f =~ /o$/ }.join(' ')
+ l = ex_libs.join(' ')
+
+ sh "#{ld} #{$link_opts} -o #{t.name} #{o} #{l}"
+end
+
+namespace :vm do
+ desc 'Run all VM tests'
+ task :test => 'vm/test/runner' do
+ ENV['VERBOSE'] = '1' if $verbose
+ sh 'vm/test/runner', :verbose => $verbose
+ end
+
+ desc "Clean up vm build files"
+ task :clean do
+ # TODO evan? "*.gcda *.gcno *.gcov *.dSYM ../*.o coverage"
+ files = [
+ objs, dep_file,
+ 'vm/test/runner', 'vm/test/runner.cpp',
+ 'vm/gen',
+ 'vm/vm'
+ ]
+
+ files.each do |filename|
+ rm_f filename, :verbose => $verbose
+ end
+ end
+
+ desc "Clean up, including all external libs"
+ task :distclean => :clean do
+ EXTERNALS.each do |lib|
+ path = File.join(*lib.split(File::SEPARATOR)[0..2])
+ system "cd #{path}; make clean"
+ end
+ end
+
+ desc "Show which primitives are missing"
+ task :missing_primitives do
+ cpp_primitives = `grep 'Ruby.primitive' vm/*.hpp | awk '{ print $4 }'`
+
+ cpp_primitives = cpp_primitives.gsub(':', '').split("\n").sort.uniq
+
+ shotgun_primitives = File.read('vm/shotgun_primitives.txt')
+ shotgun_primitives = shotgun_primitives.split("\n").sort.uniq
+
+ missing = shotgun_primitives - cpp_primitives
+
+ puts missing.join("\n")
+ end
+
+end
+
View
216 vm/Rakefile
@@ -1,216 +0,0 @@
-require 'rake/clean'
-
-# NOTE: instructions.bc is checked in, not built. This should probably
-# be remedied at some point, but not right now.
-
-############################################################
-# Primary Tasks
-
-task :default => :test
-
-desc "Build test/runner and run all VM tests [DEFAULT TASK]"
-task :test => "test/runner" do
- sh "./test/runner"
-end
-
-desc "Build the VM"
-task :build => "vm"
-
-desc "Clean up, including all external libs"
-task :distclean => :clean do
- EXTERNALS.each do |lib|
- path = lib.split("/")[0,2].join("/")
- system "cd #{path}; make clean"
- end
-end
-
-desc "Show which primitives are missing"
-task :missing_primitives do
- cpp_primitives = `grep 'Ruby.primitive' *.hpp | awk '{ print $4 }'`
-
- cpp_primitives = cpp_primitives.gsub(':', '').split("\n").sort.uniq
-
- shotgun_primitives = File.read('shotgun_primitives.txt').split("\n").sort.uniq
-
- missing = shotgun_primitives - cpp_primitives
-
- puts missing.join("\n")
-end
-
-############################################################
-# Files, Flags, & Constants
-
-LLVM_CONFIG = "./external_libs/llvm/Release/bin/llvm-config"
-tests = FileList["test/test_*.hpp"]
-srcs = FileList["*.{cpp,c}"]
-hdrs = FileList["*.{hpp,h}"]
-objs = srcs.map { |f| f.sub(/c(pp)?$/, 'o') }
-dep_file = ".depends.mf"
-vm_objs = %w( drivers/cli.o )
-vm_srcs = %w( drivers/cli.cpp )
-EX_INC = %w( libtommath onig libffi/include
- libltdl libev llvm/include ).map { |f| "external_libs/#{f}" }
-INSN_GEN = %w( gen/iseq_instruction_names.cpp
- gen/iseq_instruction_names.hpp
- test/test_instructions.hpp )
-TYPE_GEN = %w( gen/simple_field.rb
- gen/typechecks.gen.cpp
- gen/primitives_declare.hpp
- gen/primitives_glue.gen.cpp )
-
-LLVM_A = "external_libs/llvm/Release/lib/libLLVMSystem.a"
-EXTERNALS = %W( #{LLVM_A}
- external_libs/libtommath/libtommath.a
- external_libs/onig/.libs/libonig.a
- external_libs/libffi/.libs/libffi.a
- external_libs/libltdl/.libs/libltdl.a
- external_libs/libev/.libs/libev.a )
-OPTIONS = {
- LLVM_A => "--enable-targets=host-only --enable-optimized"
- }
-
-INCLUDES = (EX_INC + ["test/cxxtest", "."]).map { |f| "-I#{f}" }
-FLAGS = %w(-Wall -ggdb -gdwarf-2)
-
-FLAGS << "-O2" if ENV['FAST']
-
-############################################################
-# Other Tasks
-
-# TODO evan? "*.gcda *.gcno *.gcov *.dSYM ../*.o coverage"
-CLEAN << objs << dep_file << "test/runner" << "gen" << "vm"
-
-def compile(obj, src)
- cc = "gcc" # File.basename(src) == "c" ? "gcc" : "g++"
-
- unless defined? $llvm_c then
- $llvm_c = `#{LLVM_CONFIG} --cflags`.split(/\s+/)
- $llvm_c.delete_if { |e| e.index("-O") == 0 }
- end
-
- flags = (INCLUDES + FLAGS + $llvm_c).join(' ')
-
- sh "#{cc} #{flags} -c -o #{obj} #{src} 2>&1"
-end
-
-rule '.o' do |t|
- obj = t.name
- src = t.prerequisites.find { |f| f =~ /#{File.basename obj, '.o'}\.c(pp)?$/}
-
- compile obj, src
-end
-
-def files targets, dependencies = nil, &block
- targets.each do |target|
- if dependencies then
- file target => dependencies, &block
- else
- file target, &block
- end
- end
-end
-
-directory "gen"
-file "type_info.o" => "gen/typechecks.gen.cpp"
-file "primitives.hpp" => "gen/primitives_declare.hpp"
-files Dir["builtin_*.hpp"], INSN_GEN
-files objs, EXTERNALS
-files vm_objs, vm_srcs
-
-objs.zip(srcs).each do |obj, src|
- file obj => src
-end
-
-objs += ["instructions.o"]
-
-files EXTERNALS do |t|
- path = File.join(*split_all(t.name)[0..1])
- configure_path = File.join(path, 'configure')
- if File.exist? configure_path then
- sh "cd #{path}; ./configure #{OPTIONS[t.name]} && make"
- else
- sh "cd #{path}; make"
- end
-end
-
-files INSN_GEN, %w(gen instructions.rb) do
- sh "ruby instructions.rb"
-end
-
-files TYPE_GEN, %w(gen instructions.rb field_extract.rb) do
- field_extract
-end
-
-file :vm => EXTERNALS + objs + vm_objs do |t|
- link t
-end
-
-file 'gen/primitives_glue.gen.cpp' => hdrs
-
-file 'test/runner.cpp' => tests do
- sh('test/cxxtest/cxxtestgen.pl', '--error-printer', '--have-eh',
- '--abort-on-fail', '-o', 'test/runner.cpp', *tests)
-end
-
-file 'test/runner.o' => 'test/runner.cpp' # no rule .o => .cpp
-
-file "test/runner" => EXTERNALS + objs + %w(test/runner.o) do |t|
- link t
-end
-
-file "instructions.o" => ["llvm/instructions.cpp", "instructions.rb"] do
- ruby "rubypp.rb llvm/instructions.cpp llvm/.instructions.cpp"
- compile "instructions.o", "llvm/.instructions.cpp"
- File.unlink "llvm/.instructions.cpp" rescue nil
-end
-
-file "instructions.bc" => "llvm/instructions.cpp" do
- ruby "rubypp.rb llvm/instructions.cpp llvm/.instructions.cpp"
- sh "llvm-g++ -emit-llvm -I. -Iexternal_libs/libffi/include -c -o instructions.bc llvm/.instructions.cpp"
- File.unlink "llvm/.instructions.cpp" rescue nil
-end
-
-############################################################$
-# Importers & Methods:
-
-require 'rake/loaders/makefile'
-
-file dep_file => srcs + hdrs + vm_srcs do |t|
- flags = (INCLUDES + FLAGS).join(' ')
- flags << " -D__STDC_LIMIT_MACROS"
-
- dep = `makedepend -f- -- #{flags} -- #{t.prerequisites} 2>/dev/null`
- dep.gsub!(%r% /usr/include\S+%, '') # speeds up rake a lot
- dep.gsub!(%r%^\S+:[^ ]%, '')
-
- File.open t.name, 'w' do |f|
- f.puts dep
- end
-end
-
-import dep_file
-
-def ex_libs # needs to be method to delay running of llvm_config
- unless defined? $ex_libs then
- $ex_libs = EXTERNALS + [ "-ldl" ]
- $ex_libs << "-lrt" if RUBY_PLATFORM =~ /linux/
- $ex_libs += `#{LLVM_CONFIG} --libfiles all`.split(/\s+/)
- end
- $ex_libs
-end
-
-def field_extract
- order = %w(builtin_object.hpp objects.hpp)
- order += File.read("objects.hpp").scan(/builtin_[^"]+/)
- sh "ruby field_extract.rb #{order.join(' ')}"
-end
-
-def link t
- $link_opts ||= `#{LLVM_CONFIG} --ldflags`.split(/\s+/).join(' ')
-
- ld = ENV['LD'] || 'g++'
- o = t.prerequisites.find_all { |f| f =~ /o$/ }.join(' ')
- l = ex_libs.join(' ')
-
- sh "#{ld} #{$link_opts} -o #{t.name} #{o} #{l}"
-end
View
8 vm/field_extract.rb
@@ -394,7 +394,7 @@ def parse_stream(f)
parser.parse_stream ARGF
-File.open("gen/simple_field.rb", "w") do |f|
+File.open("vm/gen/simple_field.rb", "w") do |f|
f.puts "# DO NOT EDIT!! Autogenerate by field_extract.rb"
parser.class_order.each do |name|
obj = parser.classes[name]
@@ -439,7 +439,7 @@ def parse_stream(f)
end
end
-File.open("gen/typechecks.gen.cpp", "w") do |f|
+File.open("vm/gen/typechecks.gen.cpp", "w") do |f|
f.puts "void TypeInfo::init(STATE) {"
parser.classes.each do |n, cpp|
next if n == "Object"
@@ -467,7 +467,7 @@ def parse_stream(f)
end
-File.open("gen/primitives_declare.hpp", "w") do |f|
+File.open("vm/gen/primitives_declare.hpp", "w") do |f|
parser.classes.each do |n, cpp|
cpp.primitives.each do |pn, prim|
f.puts "static bool #{pn}(STATE, VMExecutable* exec, Task* task, Message& msg);"
@@ -475,7 +475,7 @@ def parse_stream(f)
end
end
-File.open("gen/primitives_glue.gen.cpp", "w") do |f|
+File.open("vm/gen/primitives_glue.gen.cpp", "w") do |f|
names = []
parser.classes.each do |n, cpp|
cpp.primitives.each do |pn, prim|
View
10 vm/instructions.rb
@@ -3529,21 +3529,21 @@ def check_serial(index, serial)
if $0 == __FILE__
si = Instructions.new
- Dir.mkdir "gen" unless File.directory?("gen")
+ Dir.mkdir "vm/gen" unless File.directory?("vm/gen")
- File.open("gen/iseq_instruction_names.cpp","w") do |f|
+ File.open("vm/gen/iseq_instruction_names.cpp","w") do |f|
f.puts si.generate_names
end
- File.open("gen/iseq_instruction_names.hpp","w") do |f|
+ File.open("vm/gen/iseq_instruction_names.hpp","w") do |f|
f.puts si.generate_names_header
end
- File.open("gen/iseq_instruction_size.gen", "w") do |f|
+ File.open("vm/gen/iseq_instruction_size.gen", "w") do |f|
f.puts si.generate_size
end
- File.open("test/test_instructions.hpp", "w") do |f|
+ File.open("vm/test/test_instructions.hpp", "w") do |f|
si.generate_tests(f)
end
View
50 vm/instructions_gen.rb
@@ -89,7 +89,7 @@ def decode_methods
def generate_functions(methods, io)
methods.each do |impl|
io.puts "#{impl.signature} {"
- io.puts "#line #{impl.line} \"instructions.rb\""
+ io.puts "#line #{impl.line} \"vm/instructions.rb\""
io.puts impl.body
io.puts "}"
end
@@ -152,6 +152,7 @@ class TestInstructions : public CxxTest::TestSuite {
void tearDown() {
delete state;
}
+
CODE
InstructionSet::OpCodes.each do |ins|
@@ -161,28 +162,35 @@ class TestInstructions : public CxxTest::TestSuite {
sexp = pt.parse_tree_for_method(Instructions, meth).flatten
line = sexp[sexp.index(:newline) + 1] + 1
- fd.puts "void #{meth}() {"
- fd.puts "Task* task = Task::create(state);"
- fd.puts "CompiledMethod* cm = CompiledMethod::create(state);"
- fd.puts "cm->iseq = InstructionSequence::create(state, 10);"
- fd.puts "cm->stack_size = Object::i2n(10);"
- fd.puts "cm->local_count = Object::i2n(0);"
- fd.puts "cm->literals = Tuple::create(state, 10);"
- fd.puts "cm->formalize(state);"
- fd.puts "MethodContext* ctx = task->generate_context(Qnil, cm);"
- fd.puts "task->make_active(ctx);"
- # The += 0 disable unused variable warnings.
- fd.puts "Tuple* stack = task->stack; stack += 0;"
- fd.puts "opcode stream[100];"
- fd.puts "stream[0] = InstructionSequence::insn_#{ins.opcode};"
- fd.puts "#define run(val) task->execute_stream(stream)"
- fd.puts "#line #{line} \"instructions.rb\""
- fd.puts code
- fd.puts "#undef run"
- fd.puts "}"
+ fd.puts <<-EOF
+void #{meth}() {
+ Task* task = Task::create(state);
+ CompiledMethod* cm = CompiledMethod::create(state);
+ cm->iseq = InstructionSequence::create(state, 10);
+ cm->stack_size = Object::i2n(10);
+ cm->local_count = Object::i2n(0);
+ cm->literals = Tuple::create(state, 10);
+ cm->formalize(state);
+
+ MethodContext* ctx = task->generate_context(Qnil, cm);
+ task->make_active(ctx);
+ // The += 0 disable unused variable warnings.
+
+ Tuple* stack = task->stack; stack += 0;
+
+ opcode stream[100];
+ stream[0] = InstructionSequence::insn_#{ins.opcode};
+
+#define run(val) task->execute_stream(stream)
+#line #{line} \"vm/instructions.rb\"
+#{code}
+#undef run
+}
+
+ EOF
end
end
- fd.puts " };"
+ fd.puts "};"
end
# Generate a switch statement which, given +op+, sets +width+ to
View
2  vm/llvm/instructions.cpp
@@ -27,7 +27,7 @@ extern "C" {
#ruby <<CODE
require 'stringio'
-require 'instructions.rb'
+require 'vm/instructions.rb'
si = Instructions.new
impl = si.decode_methods
io = StringIO.new
View
2  vm/test/test_ar.hpp
@@ -31,7 +31,7 @@ class TestAr : public CxxTest::TestSuite {
}
void test_process() {
- CollectAr ar("test/test.a");
+ CollectAr ar("vm/test/test.a");
TS_ASSERT(ar.open());
TS_ASSERT_EQUALS(ar.names.size(), 0U);
View
2  vm/test/test_compiled_file.hpp
@@ -41,7 +41,7 @@ class TestCompiledFile : public CxxTest::TestSuite {
}
void test_load_file() {
- std::fstream stream("test/fixture.rbc_");
+ std::fstream stream("vm/test/fixture.rbc_");
TS_ASSERT(!!stream);
CompiledFile* cf = CompiledFile::load(stream);
View
2  vm/vm.cpp
@@ -15,7 +15,7 @@ namespace rubinius {
events = new event::Loop(EVFLAG_FORKCHECK);
global_cache = new GlobalCache;
- VMLLVMMethod::init("instructions.bc");
+ VMLLVMMethod::init("vm/instructions.bc");
boot_threads();
}
Please sign in to comment.
Something went wrong with that request. Please try again.