Skip to content
Browse files

loader.rb is now seperated from bootstrap and core.

  • Loading branch information...
1 parent 567d4f7 commit 6001be6e0b2713da71b60e5587b2b069d566f221 @evanphx evanphx committed Jul 17, 2007
View
13 Rakefile
@@ -203,11 +203,20 @@ namespace :build do
desc "Compiles the Rubinius core archive"
task :core do
files = Dir["kernel/core/*.rb"].sort
- files.delete("kernel/core/__loader.rb")
- files << "kernel/core/__loader.rb"
update_archive files, 'runtime/core.rba'
end
+ task :loader do
+ i = "kernel/loader.rb"
+ o = "runtime/loader.rbc"
+
+ if @compiler
+ system "shotgun/rubinius -I#{@compiler} compile #{i} #{o}"
+ else
+ system "shotgun/rubinius compile #{i} #{o}"
+ end
+ end
+
desc "Compiles the Rubinius library archive"
task :library do
files = Dir["library/**/*.rb"].sort
View
0 kernel/core/__loader.rb → kernel/loader.rb
File renamed without changes.
View
2 lib/bin/compile.rb
@@ -100,7 +100,7 @@ def compile
else
if File.exists?(file)
puts "Compiling #{file}..."
- compile(file)
+ compile(file, ARGV.shift)
else
puts "Unable to compile '#{file}'"
end
View
BIN runtime/core.rba
Binary file not shown.
View
BIN runtime/loader.rbc
Binary file not shown.
View
1 shotgun/lib/machine.c
@@ -452,6 +452,7 @@ int machine_run_file(machine m, const char *path) {
return FALSE;
}
+ cpu_stack_push(m->s, m->c, meth, FALSE);
cpu_run_script(m->s, m->c, meth);
return machine_run(m);
}
View
24 shotgun/main.c
@@ -92,16 +92,34 @@ int main(int argc, char **argv) {
}
flag = machine_load_archive(m, archive);
-
- if(m->s->gc_stats) {
- printf("[GC M %6dK total]\n", m->s->om->ms->allocated_bytes);
+
+ if(!flag) {
+ printf("Unable to run %s\n", archive);
+ return 1;
}
+ /* Load the loader.rbc */
+
+ archive = search_for("LOADER", "loader.rbc");
+ if(!archive) {
+ printf("Unable to find loader (loader.rbc) to load!\n");
+ return 1;
+ }
+
+ flag = machine_run_file(m, archive);
+
if(!flag) {
printf("Unable to run %s\n", archive);
return 1;
}
+ /* Done! */
+
+ if(m->s->gc_stats) {
+ printf("[GC M %6dK total]\n", m->s->om->ms->allocated_bytes);
+ }
+
+
// machine_emit_memory(m);
// object_memory_print_stats(m->s->om);

0 comments on commit 6001be6

Please sign in to comment.
Something went wrong with that request. Please try again.