Skip to content

Commit

Permalink
loader.rb is now seperated from bootstrap and core.
Browse files Browse the repository at this point in the history
  • Loading branch information
evanphx committed Jul 17, 2007
1 parent 567d4f7 commit 6001be6
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 6 deletions.
13 changes: 11 additions & 2 deletions Rakefile
Expand Up @@ -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
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/bin/compile.rb
Expand Up @@ -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
Expand Down
Binary file modified runtime/core.rba
Binary file not shown.
Binary file added runtime/loader.rbc
Binary file not shown.
1 change: 1 addition & 0 deletions shotgun/lib/machine.c
Expand Up @@ -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);
}
Expand Down
24 changes: 21 additions & 3 deletions shotgun/main.c
Expand Up @@ -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);
Expand Down

0 comments on commit 6001be6

Please sign in to comment.