1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Remove root_jmpbuf in rb_thread_struct

It has not been used since 1b82c877df.
This commit is contained in:
Nobuyoshi Nakada 2021-08-09 13:21:05 +09:00
parent 42b6dc84d3
commit 28d03ee776
Notes: git 2021-08-10 19:09:04 +09:00
4 changed files with 2 additions and 36 deletions

2
cont.c
View file

@ -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)
{

3
eval.c
View file

@ -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;

View file

@ -91,40 +91,12 @@ extern int select_large_fdset(int, fd_set *, fd_set *, fd_set *, struct timeval
#include <sys/stat.h>
#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 { \

View file

@ -1023,7 +1023,6 @@ typedef struct rb_thread_struct {
/* fiber */
rb_fiber_t *root_fiber;
rb_jmpbuf_t root_jmpbuf;
VALUE scheduler;
unsigned blocking;