[macruby-changes] [1975] MacRuby/branches/experimental
source_changes at macosforge.org
source_changes at macosforge.org
Thu Jul 2 18:26:21 PDT 2009
Revision: 1975
http://trac.macosforge.org/projects/ruby/changeset/1975
Author: lsansonetti at apple.com
Date: 2009-07-02 18:26:21 -0700 (Thu, 02 Jul 2009)
Log Message:
-----------
introduce rb_vm_init_compiler() to initialize the shared Compiler object
Modified Paths:
--------------
MacRuby/branches/experimental/main.cpp
MacRuby/branches/experimental/vm.cpp
Modified: MacRuby/branches/experimental/main.cpp
===================================================================
--- MacRuby/branches/experimental/main.cpp 2009-07-02 23:05:32 UTC (rev 1974)
+++ MacRuby/branches/experimental/main.cpp 2009-07-03 01:26:21 UTC (rev 1975)
@@ -12,8 +12,11 @@
#include <locale.h>
#endif
-extern "C" void rb_vm_print_current_exception(void);
-extern "C" void rb_vm_aot_compile(NODE *);
+extern "C" {
+ void rb_vm_print_current_exception(void);
+ void rb_vm_aot_compile(NODE *);
+ void rb_vm_init_compiler(void);
+}
int
main(int argc, char **argv, char **envp)
@@ -26,6 +29,7 @@
ruby_sysinit(&argc, &argv);
ruby_init();
void *node = ruby_options(argc, argv);
+ rb_vm_init_compiler();
if (ruby_aot_compile) {
rb_vm_aot_compile((NODE *)node);
rb_exit(0);
Modified: MacRuby/branches/experimental/vm.cpp
===================================================================
--- MacRuby/branches/experimental/vm.cpp 2009-07-02 23:05:32 UTC (rev 1974)
+++ MacRuby/branches/experimental/vm.cpp 2009-07-03 01:26:21 UTC (rev 1975)
@@ -3944,14 +3944,13 @@
return 0;
}
-static inline void
-__init_shared_compiler(void)
+extern "C"
+void
+rb_vm_init_compiler(void)
{
- if (RoxorCompiler::shared == NULL) {
- RoxorCompiler::shared = ruby_aot_compile
- ? new RoxorAOTCompiler("")
- : new RoxorCompiler("");
- }
+ RoxorCompiler::shared = ruby_aot_compile
+ ? new RoxorAOTCompiler("")
+ : new RoxorCompiler("");
}
extern "C"
@@ -3965,7 +3964,6 @@
vm->push_current_binding(binding, false);
}
- __init_shared_compiler();
RoxorCompiler *compiler = RoxorCompiler::shared;
bool old_inside_eval = compiler->is_inside_eval();
@@ -4023,7 +4021,6 @@
assert(ruby_aot_compile);
// Compile the program as IR.
- __init_shared_compiler();
Function *f = RoxorCompiler::shared->compile_main_function(node);
f->setName("rb_main");
GET_CORE()->optimize(f);
@@ -4072,6 +4069,7 @@
" void ruby_sysinit(int *, char ***);\n"
" void ruby_init(void);\n"
" void ruby_set_argv(int, char **);\n"
+" void rb_vm_init_compiler(void);\n"
" void *rb_vm_top_self(void);\n"
" void rb_vm_print_current_exception(void);\n"
" void rb_exit(int);\n"
@@ -4086,6 +4084,7 @@
" }\n"
" ruby_init();\n"
" ruby_set_argv(argc, argv);\n"
+" rb_vm_init_compiler();\n"
" try {\n"
" rb_main(rb_vm_top_self(), 0);\n"
" }\n"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090702/c6a9fd72/attachment.html>
More information about the macruby-changes
mailing list