diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-14 08:35:20 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-14 08:35:20 +0000 |
commit | 3cd5af52e9b321be3d3e4071359c637f0eb3bf34 (patch) | |
tree | ae8482d285a227c583924a07c64e86f0e23d3f86 /yarvcore.c | |
parent | 0dc3a071d3dc02dc40965abae4c5bd6512cb251a (diff) | |
download | ruby-3cd5af52e9b321be3d3e4071359c637f0eb3bf34.tar.gz |
* eval_load.c (Init_load): delay allocating an array for rb_load_path
to avoid GC problem in very early stage.
(RUBY_GC_STRESS causes GC in such stage.)
* variable.c (rb_gc_mark_global_tbl): rb_global_tbl may be 0 in
very early stage.
* thread.c (thread_cleanup_func) [IA64]: clear register stack position.
(thread_start_func_2) [IA64]: record the beginning of register
stack using extra argument.
(rb_gc_save_machine_context) [IA64]: record the end of register
stack.
* gc.c [IA64] (SET_STACK_END): record the end of register stack.
(garbage_collect) [IA64]: use recorded register stack area for
GC marking.
(yarv_machine_stack_mark) [IA64]: GC mark from the register stack
area.
* yarvcore.c [IA64] (rb_gc_register_stack_start): defined.
(Init_VM): store th->self on stack to fix GC problem.
(Init_yarv) [IA64]: initialize the beginning of register stack.
* yarvcore.h (struct rb_thread_struct) [IA64]: new members for
register stack area.
* thread_pthread.ci (thread_start_func_1) [IA64]: call
thread_start_func_2 with the end of register stack.
* cont.c (struct rb_context_struct) [IA64]: new members for register
stack area.
(cont_mark) [IA64]: GC mark from register stack area.
(cont_free) [IA64]: free saved register stack.
(cont_save_machine_stack) [IA64]: record the position and contents
of the register stack.
(cont_capture): store cont->self on stack to fix GC problem.
(cont_restore_1) [IA64]: restore the register stack.
[IA64] (register_stack_extend): new function.
(cont_restore_0) [IA64]: call register_stack_extend instead of
cont_restore_1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'yarvcore.c')
-rw-r--r-- | yarvcore.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/yarvcore.c b/yarvcore.c index f9525e104b..9974b08580 100644 --- a/yarvcore.c +++ b/yarvcore.c @@ -395,6 +395,9 @@ rb_thread_alloc(VALUE klass) VALUE insns_name_array(void); extern VALUE *rb_gc_stack_start; +#ifdef __ia64 +extern VALUE *rb_gc_register_stack_start; +#endif static VALUE sdr(void) @@ -542,12 +545,13 @@ Init_VM(void) { rb_vm_t *vm = ruby_current_vm; rb_thread_t *th = GET_THREAD(); + volatile VALUE th_self; /* create vm object */ vm->self = Data_Wrap_Struct(rb_cVM, vm_mark, vm_free, vm); /* create main thread */ - th->self = Data_Wrap_Struct(rb_cThread, thread_mark, thread_free, th); + th_self = th->self = Data_Wrap_Struct(rb_cThread, thread_mark, thread_free, th); vm->main_thread = th; vm->running_thread = th; @@ -557,7 +561,7 @@ Init_VM(void) rb_thread_set_current(th); vm->living_threads = st_init_numtable(); - st_insert(vm->living_threads, th->self, (st_data_t) th->thread_id); + st_insert(vm->living_threads, th_self, (st_data_t) th->thread_id); } yarv_init_redefined_flag(); } @@ -575,6 +579,9 @@ Init_yarv(void) th_init2(th); th->vm = vm; th->machine_stack_start = rb_gc_stack_start; +#ifdef __ia64 + th->machine_register_stack_start = rb_gc_register_stack_start; +#endif rb_thread_set_current_raw(th); } |