From 4f0c9a5cc49cf36f15af85f644982fbb847f0dca Mon Sep 17 00:00:00 2001 From: ko1 Date: Sun, 10 Sep 2017 15:49:45 +0000 Subject: move th->machine to ec->machine. * vm_core.h: move rb_thread_t::machine to rb_execution_context_t::machine. * vm_core.h, gc.c (rb_gc_mark_machine_stack): accept ec instead of th. it enables to call this func from rb_execution_context_mark() in vm.c. * cont.c (fiber_setcontext): catch up this fix. fiber_restore_thread() restores machine stack information too. * gc.c: catch up structure layout changes. * thread.c: ditto. * thread_pthread.c: ditto. * thread_win32.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'thread.c') diff --git a/thread.c b/thread.c index 766b3d4100..d706ee469b 100644 --- a/thread.c +++ b/thread.c @@ -138,8 +138,8 @@ static inline void blocking_region_end(rb_thread_t *th, struct rb_blocking_regio do { \ FLUSH_REGISTER_WINDOWS; \ RB_GC_SAVE_MACHINE_REGISTER_STACK(th); \ - setjmp((th)->machine.regs); \ - SET_MACHINE_STACK_END(&(th)->machine.stack_end); \ + setjmp((th)->ec.machine.regs); \ + SET_MACHINE_STACK_END(&(th)->ec.machine.stack_end); \ } while (0) #define GVL_UNLOCK_BEGIN() do { \ @@ -525,9 +525,9 @@ thread_cleanup_func_before_exec(void *th_ptr) { rb_thread_t *th = th_ptr; th->status = THREAD_KILLED; - th->machine.stack_start = th->machine.stack_end = 0; + th->ec.machine.stack_start = th->ec.machine.stack_end = NULL; #ifdef __ia64 - th->machine.register_stack_start = th->machine.register_stack_end = 0; + th->ec.machine.register_stack_start = th->ec.machine.register_stack_end = NULL; #endif } @@ -613,9 +613,9 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s ruby_thread_set_native(th); - th->machine.stack_start = stack_start; + th->ec.machine.stack_start = stack_start; #ifdef __ia64 - th->machine.register_stack_start = register_stack_start; + th->ec.machine.register_stack_start = register_stack_start; #endif thread_debug("thread start: %p\n", (void *)th); -- cgit v1.2.3