diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-02-05 12:21:01 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-02-05 12:21:01 +0000 |
commit | 025cfde57d14b12504595130cb1b222372881143 (patch) | |
tree | 1b4233c4f6e2f26bce12f1815378457fbc2537ee /yarvcore.c | |
parent | 72f2d2a00d8ae3861a15ca92bf9322951a22b6cf (diff) | |
download | ruby-025cfde57d14b12504595130cb1b222372881143.tar.gz |
* eval_thread.c, common.mk: remove eval_thread.c.
* yarvcore.c: rename cYarvThread to rb_cThread.
* gc.c: remove YARV_* prefix.
* gc.h: add an include guard and prototype of rb_gc_set_stack_end().
* inits.c: fix to ANSI prototype style and reorder Init_*().
* io.c (pipe_finalize): TODO: comment out last_status.
* process.c, yarvcore.h: fix to use yarv_vm_t#last_status instead of
rb_last_status and make last_status_get() to access $?.
* yarvcore.c (vm_mark): mark yarv_vm_t#last_status.
* ruby.h: add declarations of rb_cISeq and rb_cVM.
* thread.c: move eval_thread.c codes to thread.c and remove yarv_*
function prefix.
* thread.c (thread_start_func_2): use yarv_thread_t#first_func if
it is not null.
* vm.c: fix copyright year.
* yarvcore.c (Init_vm): rename to Init_VM().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'yarvcore.c')
-rw-r--r-- | yarvcore.c | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/yarvcore.c b/yarvcore.c index 230d5382c6..32b136737c 100644 --- a/yarvcore.c +++ b/yarvcore.c @@ -17,8 +17,8 @@ #include "yarv.h" #include "gc.h" -VALUE cYarvThread; VALUE rb_cVM; +VALUE rb_cThread; VALUE symIFUNC; VALUE symCFUNC; @@ -257,6 +257,7 @@ vm_mark(void *ptr) } MARK_UNLESS_NULL(vm->thgroup_default); MARK_UNLESS_NULL(vm->mark_object_ary); + MARK_UNLESS_NULL(vm->last_status); } MARK_REPORT_LEAVE("vm"); } @@ -279,7 +280,6 @@ vm_init2(yarv_vm_t *vm) MEMZERO(vm, yarv_vm_t, 1); } - /**********/ /* Thread */ /**********/ @@ -402,7 +402,7 @@ th_init2(yarv_thread_t *th) th->cfp->iseq = 0; th->cfp->proc = 0; th->cfp->block_iseq = 0; - + th->status = THREAD_RUNNABLE; th->errinfo = Qnil; @@ -467,7 +467,6 @@ yarv_th_eval(yarv_thread_t *th, VALUE iseqval) /********************************************************************/ VALUE insns_name_array(void); -VALUE Init_yarvthread(void); extern VALUE *rb_gc_stack_start; VALUE @@ -531,17 +530,18 @@ char *yarv_options = "" #endif ; -void Init_ISeq(void); - void -Init_vm(void) +Init_VM(void) { - Init_ISeq(); - /* ::VM */ rb_cVM = rb_define_class("VM", rb_cObject); rb_undef_alloc_func(rb_cVM); + /* ::Thread */ + rb_cThread = rb_define_class("Thread", rb_cObject); + rb_undef_alloc_func(rb_cThread); + rb_define_method(rb_cThread, "initialize", thread_init, 0); + /* ::VM::USAGE_ANALISYS_* */ rb_define_const(rb_cVM, "USAGE_ANALISYS_INSN", rb_hash_new()); rb_define_const(rb_cVM, "USAGE_ANALISYS_REGS", rb_hash_new()); @@ -554,13 +554,7 @@ Init_vm(void) /* ::VM::eval() */ rb_define_singleton_method(rb_cVM, "eval", yarvcore_eval, 3); - /* ::VM::Thread */ - cYarvThread = rb_define_class_under(rb_cVM, "Thread", rb_cObject); - rb_define_global_const("Thread", cYarvThread); - rb_undef_alloc_func(cYarvThread); - rb_define_method(cYarvThread, "initialize", thread_init, 0); - - /* debug functions */ + /* debug functions ::VM::SDR(), ::VM::NSDR() */ rb_define_singleton_method(rb_cVM, "SDR", sdr, 0); rb_define_singleton_method(rb_cVM, "NSDR", sdr, 0); @@ -610,10 +604,7 @@ Init_vm(void) idFuncall = rb_intern("funcall"); id__send_bang = rb_intern("__send!"); -#if TEST_AOT_COMPILE - Init_compiled(); -#endif - /* VM bootstrap: phase 1 */ + /* VM bootstrap: phase 2 */ { /* create vm object */ VALUE vmval = vm_alloc(rb_cVM); @@ -632,7 +623,7 @@ Init_vm(void) rb_ary_push(yarvVMArray, vm->self); /* create main thread */ - thval = yarv_thread_alloc(cYarvThread); + thval = yarv_thread_alloc(rb_cThread); GetThreadPtr(thval, th); vm->main_thread = th; @@ -645,9 +636,6 @@ Init_vm(void) th->machine_stack_start = rb_gc_stack_start; vm->living_threads = st_init_numtable(); st_insert(vm->living_threads, th->self, (st_data_t) th->thread_id); - - Init_yarvthread(); - th->thgroup = th->vm->thgroup_default; } yarv_init_redefined_flag(); } @@ -667,3 +655,4 @@ Init_yarv(void) th->machine_stack_start = rb_gc_stack_start; yarv_set_current_running_thread_raw(th); } + |