diff options
author | tarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-02 10:28:27 +0000 |
---|---|---|
committer | tarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-02 10:28:27 +0000 |
commit | c1e6052bfec1e621c3d2eda598b7f69270e176b8 (patch) | |
tree | 4b5b84d466ce8b248f0fd10bd6ae406cf8856463 /thread.c | |
parent | f6f388a5bdbd3d3a68bf18f3352ba2be12688639 (diff) | |
download | ruby-c1e6052bfec1e621c3d2eda598b7f69270e176b8.tar.gz |
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 27 |
1 files changed, 13 insertions, 14 deletions
@@ -99,11 +99,19 @@ static inline int blocking_region_begin(rb_thread_t *th, struct rb_blocking_regi 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 @@ rb_gc_set_stack_end(VALUE **stack_end_p) } #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); -} /* * |