From 0b91bd56c2246f4a6dc313e0972a28074c68ecee Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 7 Feb 2007 13:38:29 +0000 Subject: * eval_intern.h, yarvcore.h: remove unused macro definition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ eval_intern.h | 62 ----------------------------------------------------------- yarvcore.h | 11 ----------- 3 files changed, 4 insertions(+), 73 deletions(-) diff --git a/ChangeLog b/ChangeLog index 36f1e6af73..9e8d8f0c3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Feb 7 22:33:58 2007 Koichi Sasada + + * eval_intern.h, yarvcore.h: remove unused macro definition. + Wed Feb 7 22:30:28 2007 Koichi Sasada * eval.c: fixed to use ANSI function style. diff --git a/eval_intern.h b/eval_intern.h index 355f922caf..e68764191f 100644 --- a/eval_intern.h +++ b/eval_intern.h @@ -90,67 +90,6 @@ char *strrchr _((const char *, const char)); #include "vmsruby_private.h" #endif -#ifdef USE_CONTEXT - -NORETURN(static void rb_jump_context(rb_jmpbuf_t, int)); -static inline void -rb_jump_context(rb_jmpbuf_t env, int val) -{ - env->status = val; - setcontext(&env->context); - abort(); /* ensure noreturn */ -} - -/* - * FUNCTION_CALL_MAY_RETURN_TWICE is a magic for getcontext, gcc, - * IA64 register stack and SPARC register window combination problem. - * - * Assume following code sequence. - * - * 1. set a register in the register stack/window such as r32/l0. - * 2. call getcontext. - * 3. use the register. - * 4. update the register for other use. - * 5. call setcontext indirectly (or directly). - * - * This code should be run as 1->2->3->4->5->3->4. - * But after second getcontext return (second 3), - * the register is broken (updated). - * It's because getcontext/setcontext doesn't preserve the content of the - * register stack/window. - * - * setjmp also doesn't preserve the content of the register stack/window. - * But it has not the problem because gcc knows setjmp may return twice. - * gcc detects setjmp and generates setjmp safe code. - * - * So setjmp call before getcontext call makes the code somewhat safe. - * It fix the problem on IA64. - * It is not required that setjmp is called at run time, since the problem is - * register usage. - * - * Since the magic setjmp is not enough for SPARC, - * inline asm is used to prohibit registers in register windows. - */ -#if defined (__GNUC__) && (defined(sparc) || defined(__sparc__)) -#define FUNCTION_CALL_MAY_RETURN_TWICE \ - ({ __asm__ volatile ("" : : : \ - "%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%o7", \ - "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", "%l7", \ - "%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%i7"); }) -#else -extern jmp_buf function_call_may_return_twice_jmp_buf; -extern int function_call_may_return_twice_false; -#define FUNCTION_CALL_MAY_RETURN_TWICE \ - (function_call_may_return_twice_false ? \ - setjmp(function_call_may_return_twice_jmp_buf) : \ - 0) -#endif -#define ruby_longjmp(env, val) rb_jump_context(env, val) -#define ruby_setjmp(j) ((j)->status = 0, \ - FUNCTION_CALL_MAY_RETURN_TWICE, \ - getcontext(&(j)->context), \ - (j)->status) -#else #if !defined(setjmp) && defined(HAVE__SETJMP) #define ruby_setjmp(env) _setjmp(env) #define ruby_longjmp(env,val) _longjmp(env,val) @@ -158,7 +97,6 @@ extern int function_call_may_return_twice_false; #define ruby_setjmp(env) setjmp(env) #define ruby_longjmp(env,val) longjmp(env,val) #endif -#endif #include #include diff --git a/yarvcore.h b/yarvcore.h index d47e6f03bb..3a65621e36 100644 --- a/yarvcore.h +++ b/yarvcore.h @@ -17,10 +17,6 @@ #include -#if 0 && defined(HAVE_GETCONTEXT) && defined(HAVE_SETCONTEXT) -#include -#define USE_CONTEXT -#endif #include "ruby.h" #include "st.h" #include "node.h" @@ -371,14 +367,7 @@ enum rb_thread_status { THREAD_KILLED, }; -#ifdef USE_CONTEXT -typedef struct { - ucontext_t context; - volatile int status; -} rb_jmpbuf_t[1]; -#else typedef jmp_buf rb_jmpbuf_t; -#endif struct rb_vm_tag { rb_jmpbuf_t buf; -- cgit v1.2.3