ruby-changes:26087
From: tarui <ko1@a...>
Date: Sun, 2 Dec 2012 19:28:38 +0900 (JST)
Subject: [ruby-changes:26087] tarui:r38144 (trunk): * thread.c (RB_GC_SAVE_MACHINE_CONTEXT, rb_gc_save_machine_context):
tarui 2012-12-02 19:28:27 +0900 (Sun, 02 Dec 2012) New Revision: 38144 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38144 Log: * thread.c (RB_GC_SAVE_MACHINE_CONTEXT, rb_gc_save_machine_context): extract rb_gc_save_machine_context to RB_GC_SAVE_MACHINE_CONTEXT. NOTE: machine_regs and machine_stack_end must be set in current scope. Modified files: trunk/ChangeLog trunk/thread.c trunk/vm_core.h Index: ChangeLog =================================================================== --- ChangeLog (revision 38143) +++ ChangeLog (revision 38144) @@ -1,3 +1,9 @@ +Sun Dec 2 19:26:47 2012 Masaya Tarui <tarui@r...> + + * thread.c (RB_GC_SAVE_MACHINE_CONTEXT, rb_gc_save_machine_context): + extract rb_gc_save_machine_context to RB_GC_SAVE_MACHINE_CONTEXT. + NOTE: machine_regs and machine_stack_end must be set in current scope. + Sun Dec 2 18:46:24 2012 Koichi Sasada <ko1@a...> * array.c, enum.c, insns.def, io.c, numeric.c, parse.y, process.c, Index: vm_core.h =================================================================== --- vm_core.h (revision 38143) +++ vm_core.h (revision 38144) @@ -815,7 +815,6 @@ void rb_vm_stack_to_heap(rb_thread_t *th); void ruby_thread_init_stack(rb_thread_t *th); -NOINLINE(void rb_gc_save_machine_context(rb_thread_t *)); void rb_gc_mark_machine_stack(rb_thread_t *th); int rb_autoloading_value(VALUE mod, ID id, VALUE* value); Index: thread.c =================================================================== --- thread.c (revision 38143) +++ thread.c (revision 38144) @@ -99,11 +99,19 @@ rb_unblock_function_t *ubf, void *arg, int fail_if_interrupted); static inline void blocking_region_end(rb_thread_t *th, struct rb_blocking_region_buffer *region); -#define RB_GC_SAVE_MACHINE_CONTEXT(th) \ - do { \ - rb_gc_save_machine_context(th); \ - SET_MACHINE_STACK_END(&(th)->machine_stack_end); \ - } while (0) +#ifdef __ia64 +#define RB_GC_SAVE_MACHINE_REGISTER_STACK(th) \ + do{(th)->machine_register_stack_end = rb_ia64_bsp()}while(0) +#else +#define RB_GC_SAVE_MACHINE_REGISTER_STACK(th) +#endif +#define RB_GC_SAVE_MACHINE_CONTEXT(th) \ + do { \ + FLUSH_REGISTER_WINDOWS; \ + RB_GC_SAVE_MACHINE_REGISTER_STACK(th); \ + setjmp((th)->machine_regs); \ + SET_MACHINE_STACK_END(&(th)->machine_stack_end); \ + } while (0) #define GVL_UNLOCK_BEGIN() do { \ rb_thread_t *_th_stored = GET_THREAD(); \ @@ -3611,15 +3619,6 @@ } #endif -void -rb_gc_save_machine_context(rb_thread_t *th) -{ - FLUSH_REGISTER_WINDOWS; -#ifdef __ia64 - th->machine_register_stack_end = rb_ia64_bsp(); -#endif - setjmp(th->machine_regs); -} /* * -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/