ruby-changes:37628
From: nobu <ko1@a...>
Date: Tue, 24 Feb 2015 11:05:43 +0900 (JST)
Subject: [ruby-changes:37628] nobu:r49709 (trunk): eval.c: use the given thread
nobu 2015-02-24 11:05:28 +0900 (Tue, 24 Feb 2015) New Revision: 49709 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49709 Log: eval.c: use the given thread * eval.c (setup_exception): use the given thread instead of implicit current thread. * load.c (rb_load_internal0): ditto. Modified files: trunk/eval.c trunk/eval_jump.c trunk/load.c Index: load.c =================================================================== --- load.c (revision 49708) +++ load.c (revision 49709) @@ -600,7 +600,7 @@ rb_load_internal0(rb_thread_t *th, VALUE https://github.com/ruby/ruby/blob/trunk/load.c#L600 } mild_compile_error = th->mild_compile_error; - PUSH_TAG(); + TH_PUSH_TAG(th); state = EXEC_TAG(); if (state == 0) { NODE *node; @@ -613,7 +613,7 @@ rb_load_internal0(rb_thread_t *th, VALUE https://github.com/ruby/ruby/blob/trunk/load.c#L613 th->mild_compile_error--; rb_iseq_eval(iseq); } - POP_TAG(); + TH_POP_TAG(); #if !defined __GNUC__ th = th0; @@ -965,7 +965,7 @@ rb_require_internal(VALUE fname, int saf https://github.com/ruby/ruby/blob/trunk/load.c#L965 rb_sourceline()); } - PUSH_TAG(); + TH_PUSH_TAG(th); saved.safe = rb_safe_level(); if ((state = EXEC_TAG()) == 0) { VALUE path; @@ -1015,7 +1015,7 @@ rb_require_internal(VALUE fname, int saf https://github.com/ruby/ruby/blob/trunk/load.c#L1015 } } } - POP_TAG(); + TH_POP_TAG(); load_unlock(ftptr, !state); rb_set_safe_level_force(saved.safe); Index: eval_jump.c =================================================================== --- eval_jump.c (revision 49708) +++ eval_jump.c (revision 49709) @@ -116,7 +116,7 @@ rb_exec_end_proc(void) https://github.com/ruby/ruby/blob/trunk/eval_jump.c#L116 rb_thread_t *th = GET_THREAD(); volatile VALUE errinfo = th->errinfo; - PUSH_TAG(); + TH_PUSH_TAG(th); if ((status = EXEC_TAG()) == 0) { again: exec_end_procs_chain(&ephemeral_end_procs); @@ -130,7 +130,7 @@ rb_exec_end_proc(void) https://github.com/ruby/ruby/blob/trunk/eval_jump.c#L130 TH_REPUSH_TAG(); goto again; } - POP_TAG(); + TH_POP_TAG(); rb_set_safe_level_force(safe); th->errinfo = errinfo; Index: eval.c =================================================================== --- eval.c (revision 49708) +++ eval.c (revision 49709) @@ -167,27 +167,27 @@ ruby_cleanup(volatile int ex) https://github.com/ruby/ruby/blob/trunk/eval.c#L167 rb_threadptr_interrupt(th); rb_threadptr_check_signal(th); - PUSH_TAG(); + TH_PUSH_TAG(th); if ((state = EXEC_TAG()) == 0) { SAVE_ROOT_JMPBUF(th, { RUBY_VM_CHECK_INTS(th); }); } - POP_TAG(); + TH_POP_TAG(); errs[1] = th->errinfo; th->safe_level = 0; ruby_init_stack(&errs[STACK_UPPER(errs, 0, 1)]); - PUSH_TAG(); + TH_PUSH_TAG(th); if ((state = EXEC_TAG()) == 0) { SAVE_ROOT_JMPBUF(th, ruby_finalize_0()); } - POP_TAG(); + TH_POP_TAG(); /* protect from Thread#raise */ th->status = THREAD_KILLED; errs[0] = th->errinfo; - PUSH_TAG(); + TH_PUSH_TAG(th); if ((state = EXEC_TAG()) == 0) { SAVE_ROOT_JMPBUF(th, rb_thread_terminate_all()); } @@ -235,7 +235,7 @@ ruby_cleanup(volatile int ex) https://github.com/ruby/ruby/blob/trunk/eval.c#L235 /* unlock again if finalizer took mutexes. */ rb_threadptr_unlock_all_locking_mutexes(GET_THREAD()); - POP_TAG(); + TH_POP_TAG(); rb_thread_stop_timer_thread(1); ruby_vm_destruct(GET_VM()); if (state) ruby_default_signal(state); @@ -252,14 +252,14 @@ ruby_exec_internal(void *n) https://github.com/ruby/ruby/blob/trunk/eval.c#L252 if (!n) return 0; - PUSH_TAG(); + TH_PUSH_TAG(th); if ((state = EXEC_TAG()) == 0) { SAVE_ROOT_JMPBUF(th, { th->base_block = 0; rb_iseq_eval_main(iseq); }); } - POP_TAG(); + TH_POP_TAG(); return state; } @@ -539,7 +539,7 @@ setup_exception(rb_thread_t *th, int tag https://github.com/ruby/ruby/blob/trunk/eval.c#L539 int status; mesg = e; - PUSH_TAG(); + TH_PUSH_TAG(th); if ((status = EXEC_TAG()) == 0) { th->errinfo = Qnil; e = rb_obj_as_string(mesg); @@ -557,7 +557,7 @@ setup_exception(rb_thread_t *th, int tag https://github.com/ruby/ruby/blob/trunk/eval.c#L557 rb_obj_class(mesg), e); } } - POP_TAG(); + TH_POP_TAG(); if (status == TAG_FATAL && th->errinfo == exception_error) { th->errinfo = mesg; } @@ -907,11 +907,11 @@ rb_ensure(VALUE (*b_proc)(ANYARGS), VALU https://github.com/ruby/ruby/blob/trunk/eval.c#L907 ensure_list.entry.data2 = data2; ensure_list.next = th->ensure_list; th->ensure_list = &ensure_list; - PUSH_TAG(); + TH_PUSH_TAG(th); if ((state = EXEC_TAG()) == 0) { result = (*b_proc) (data1); } - POP_TAG(); + TH_POP_TAG(); errinfo = th->errinfo; th->ensure_list=ensure_list.next; (*ensure_list.entry.e_proc)(ensure_list.entry.data2); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/