diff --git a/cont.c b/cont.c index 2c0a92e9f4..51d77c6d98 100644 --- a/cont.c +++ b/cont.c @@ -711,8 +711,6 @@ fiber_pool_stack_release(struct fiber_pool_stack * stack) #endif } -void rb_fiber_start(rb_fiber_t*); - static inline void ec_switch(rb_thread_t *th, rb_fiber_t *fiber) { diff --git a/eval.c b/eval.c index bf57d0fb16..885e1ae782 100644 --- a/eval.c +++ b/eval.c @@ -1112,17 +1112,14 @@ rb_protect(VALUE (* proc) (VALUE), VALUE data, int *pstate) volatile enum ruby_tag_type state; rb_execution_context_t * volatile ec = GET_EC(); rb_control_frame_t *volatile cfp = ec->cfp; - rb_jmpbuf_t org_jmpbuf; EC_PUSH_TAG(ec); - MEMCPY(&org_jmpbuf, &rb_ec_thread_ptr(ec)->root_jmpbuf, rb_jmpbuf_t, 1); if ((state = EC_EXEC_TAG()) == TAG_NONE) { SAVE_ROOT_JMPBUF(rb_ec_thread_ptr(ec), result = (*proc) (data)); } else { rb_vm_rewind_cfp(ec, cfp); } - MEMCPY(&rb_ec_thread_ptr(ec)->root_jmpbuf, &org_jmpbuf, rb_jmpbuf_t, 1); EC_POP_TAG(); if (pstate != NULL) *pstate = state; diff --git a/eval_intern.h b/eval_intern.h index d3a0d58195..58400b5f25 100644 --- a/eval_intern.h +++ b/eval_intern.h @@ -91,40 +91,12 @@ extern int select_large_fdset(int, fd_set *, fd_set *, fd_set *, struct timeval #include -#ifdef _MSC_VER -#define SAVE_ROOT_JMPBUF_BEFORE_STMT \ - __try { -#define SAVE_ROOT_JMPBUF_AFTER_STMT \ - } \ - __except (GetExceptionCode() == EXCEPTION_STACK_OVERFLOW ? \ - (rb_ec_raised_set(GET_EC(), RAISED_STACKOVERFLOW), \ - raise(SIGSEGV), \ - EXCEPTION_EXECUTE_HANDLER) : \ - EXCEPTION_CONTINUE_SEARCH) { \ - /* never reaches here */ \ - } -#elif defined(__MINGW32__) -LONG WINAPI rb_w32_stack_overflow_handler(struct _EXCEPTION_POINTERS *); -#define SAVE_ROOT_JMPBUF_BEFORE_STMT \ - do { \ - PVOID _handler = AddVectoredExceptionHandler(1, rb_w32_stack_overflow_handler); - -#define SAVE_ROOT_JMPBUF_AFTER_STMT \ - RemoveVectoredExceptionHandler(_handler); \ - } while (0); -#else -#define SAVE_ROOT_JMPBUF_BEFORE_STMT -#define SAVE_ROOT_JMPBUF_AFTER_STMT -#endif #define SAVE_ROOT_JMPBUF(th, stmt) do \ - if (ruby_setjmp((th)->root_jmpbuf) == 0) { \ - SAVE_ROOT_JMPBUF_BEFORE_STMT \ + if (true) { \ stmt; \ - SAVE_ROOT_JMPBUF_AFTER_STMT \ } \ - else { \ - rb_fiber_start(th->ec->fiber_ptr); \ + else if (th) { /* suppress unused-variable warning */ \ } while (0) #define EC_PUSH_TAG(ec) do { \ diff --git a/vm_core.h b/vm_core.h index 8ec03d7ec2..5db3080b43 100644 --- a/vm_core.h +++ b/vm_core.h @@ -1023,7 +1023,6 @@ typedef struct rb_thread_struct { /* fiber */ rb_fiber_t *root_fiber; - rb_jmpbuf_t root_jmpbuf; VALUE scheduler; unsigned blocking;