diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-01-05 17:26:23 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-01-05 17:26:23 +0000 |
commit | 842b4d7d9a6aabadd4c72c4e8e0e982eaca352c9 (patch) | |
tree | 6004c3f3a114172de334ecb8b7004e4620c347f7 /eval.c | |
parent | 1669ac380e0d2ed27006335139947b5f6130878e (diff) | |
download | ruby-842b4d7d9a6aabadd4c72c4e8e0e982eaca352c9.tar.gz |
* configure.in: don't force getcontext on IA64.
* eval.c (ruby_setjmp): add an argument for just before getcontext.
(THREAD_SAVE_CONTEXT): call rb_thread_save_context just
before getcontext.
[ruby-dev:28205]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -158,17 +158,18 @@ int function_call_may_return_twice_false = 0; #define FUNCTION_CALL_MAY_RETURN_TWICE 0 #endif #define ruby_longjmp(env, val) rb_jump_context(env, val) -#define ruby_setjmp(j) ((j)->status = 0, \ +#define ruby_setjmp(just_before_setjmp, j) ((j)->status = 0, \ + (just_before_setjmp), \ FUNCTION_CALL_MAY_RETURN_TWICE, \ getcontext(&(j)->context), \ (j)->status) #else typedef jmp_buf rb_jmpbuf_t; #if !defined(setjmp) && defined(HAVE__SETJMP) -#define ruby_setjmp(env) _setjmp(env) +#define ruby_setjmp(just_before_setjmp, env) ((just_before_setjmp), _setjmp(env)) #define ruby_longjmp(env,val) _longjmp(env,val) #else -#define ruby_setjmp(env) setjmp(env) +#define ruby_setjmp(just_before_setjmp, env) ((just_before_setjmp), setjmp(env)) #define ruby_longjmp(env,val) longjmp(env,val) #endif #endif @@ -918,7 +919,7 @@ static struct tag *prot_tag; #define PROT_YIELD INT2FIX(3) /* 7 */ #define PROT_TOP INT2FIX(4) /* 9 */ -#define EXEC_TAG() (FLUSH_REGISTER_WINDOWS, ruby_setjmp(prot_tag->buf)) +#define EXEC_TAG() (FLUSH_REGISTER_WINDOWS, ruby_setjmp(0, prot_tag->buf)) #define JUMP_TAG(st) do { \ ruby_frame = prot_tag->frame; \ @@ -10123,6 +10124,7 @@ rb_thread_save_context(rb_thread_t th) th->bstr_max = len; } th->bstr_len = len; + rb_ia64_flushrs(); MEMCPY(th->bstr_ptr, th->bstr_pos, VALUE, th->bstr_len); #endif #ifdef SAVE_WIN32_EXCEPTION_LIST @@ -10196,8 +10198,7 @@ rb_thread_switch(int n) } #define THREAD_SAVE_CONTEXT(th) \ - (rb_thread_save_context(th),\ - rb_thread_switch((FLUSH_REGISTER_WINDOWS, ruby_setjmp((th)->context)))) + (rb_thread_switch((FLUSH_REGISTER_WINDOWS, ruby_setjmp(rb_thread_save_context(th), (th)->context)))) NORETURN(static void rb_thread_restore_context(rb_thread_t,int)); NORETURN(NOINLINE(static void rb_thread_restore_context_0(rb_thread_t,int,void*))); |