[前][次][番号順一覧][スレッド一覧]

ruby-changes:47084

From: ko1 <ko1@a...>
Date: Wed, 28 Jun 2017 23:27:55 +0900 (JST)
Subject: [ruby-changes:47084] ko1:r59199 (trunk): move fields to ec.

ko1	2017-06-28 23:27:49 +0900 (Wed, 28 Jun 2017)

  New Revision: 59199

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59199

  Log:
    move fields to ec.
    
    * vm_core.h (rb_thread.h): move errinfo and trace_arg to
      rb_execution_context_t.
    
    * cont.c (fiber_switch, rb_cont_call): do not restore "trace_arg" here.

  Modified files:
    trunk/cont.c
    trunk/eval.c
    trunk/eval_error.c
    trunk/eval_jump.c
    trunk/gc.c
    trunk/insns.def
    trunk/iseq.c
    trunk/load.c
    trunk/process.c
    trunk/thread.c
    trunk/vm.c
    trunk/vm_core.h
    trunk/vm_eval.c
    trunk/vm_exec.c
    trunk/vm_exec.h
    trunk/vm_insnhelper.c
    trunk/vm_trace.c
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 59198)
+++ vm_eval.c	(revision 59199)
@@ -1129,7 +1129,7 @@ rb_iterate0(VALUE (* it_proc) (VALUE), V https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1129
 	retval = (*it_proc) (data1);
     }
     else if (state == TAG_BREAK || state == TAG_RETRY) {
-	const struct vm_throw_data *const err = (struct vm_throw_data *)th->errinfo;
+	const struct vm_throw_data *const err = (struct vm_throw_data *)th->ec.errinfo;
 	const rb_control_frame_t *const escape_cfp = THROW_DATA_CATCH_FRAME(err);
 
 	if (cfp == escape_cfp) {
@@ -1137,7 +1137,7 @@ rb_iterate0(VALUE (* it_proc) (VALUE), V https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1137
 
 	    state = 0;
 	    th->ec.tag->state = TAG_NONE;
-	    th->errinfo = Qnil;
+	    th->ec.errinfo = Qnil;
 
 	    if (state == TAG_RETRY) goto iter_retry;
 	    retval = THROW_DATA_VAL(err);
@@ -1296,7 +1296,7 @@ eval_string_with_cref(VALUE self, VALUE https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1296
 	iseq = rb_iseq_compile_with_option(src, fname, realpath, INT2FIX(line), base_block, Qnil);
 
 	if (!iseq) {
-	    rb_exc_raise(adjust_backtrace_in_eval(th, th->errinfo));
+	    rb_exc_raise(adjust_backtrace_in_eval(th, th->ec.errinfo));
 	}
 
 	/* TODO: what the code checking? */
@@ -1335,7 +1335,7 @@ eval_string_with_cref(VALUE self, VALUE https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1335
 
     if (state) {
 	if (state == TAG_RAISE) {
-	    adjust_backtrace_in_eval(th, th->errinfo);
+	    adjust_backtrace_in_eval(th, th->ec.errinfo);
 	}
 	TH_JUMP_TAG(th, state);
     }
@@ -1870,7 +1870,7 @@ rb_throw_obj(VALUE tag, VALUE value) https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1870
 	rb_exc_raise(rb_class_new_instance(numberof(desc), desc, rb_eUncaughtThrow));
     }
 
-    th->errinfo = (VALUE)THROW_DATA_NEW(tag, NULL, TAG_THROW);
+    th->ec.errinfo = (VALUE)THROW_DATA_NEW(tag, NULL, TAG_THROW);
     TH_JUMP_TAG(th, TAG_THROW);
 }
 
@@ -1974,10 +1974,10 @@ vm_catch_protect(VALUE tag, rb_block_cal https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1974
 	/* call with argc=1, argv = [tag], block = Qnil to insure compatibility */
 	val = (*func)(tag, data, 1, (const VALUE *)&tag, Qnil);
     }
-    else if (state == TAG_THROW && THROW_DATA_VAL((struct vm_throw_data *)th->errinfo) == tag) {
+    else if (state == TAG_THROW && THROW_DATA_VAL((struct vm_throw_data *)th->ec.errinfo) == tag) {
 	rb_vm_rewind_cfp(th, saved_cfp);
 	val = th->ec.tag->retval;
-	th->errinfo = Qnil;
+	th->ec.errinfo = Qnil;
 	state = 0;
     }
     TH_POP_TAG();
Index: vm_trace.c
===================================================================
--- vm_trace.c	(revision 59198)
+++ vm_trace.c	(revision 59199)
@@ -304,31 +304,31 @@ rb_threadptr_exec_event_hooks_orig(rb_tr https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L304
     rb_thread_t *th = trace_arg->th;
 
     if (trace_arg->event & RUBY_INTERNAL_EVENT_MASK) {
-	if (th->trace_arg && (th->trace_arg->event & RUBY_INTERNAL_EVENT_MASK)) {
+	if (th->ec.trace_arg && (th->ec.trace_arg->event & RUBY_INTERNAL_EVENT_MASK)) {
 	    /* skip hooks because this thread doing INTERNAL_EVENT */
 	}
 	else {
-	    rb_trace_arg_t *prev_trace_arg = th->trace_arg;
+	    rb_trace_arg_t *prev_trace_arg = th->ec.trace_arg;
 	    th->vm->trace_running++;
-	    th->trace_arg = trace_arg;
+	    th->ec.trace_arg = trace_arg;
 	    exec_hooks_unprotected(th, &th->event_hooks, trace_arg);
 	    exec_hooks_unprotected(th, &th->vm->event_hooks, trace_arg);
-	    th->trace_arg = prev_trace_arg;
+	    th->ec.trace_arg = prev_trace_arg;
 	    th->vm->trace_running--;
 	}
     }
     else {
-	if (th->trace_arg == 0 && /* check reentrant */
+	if (th->ec.trace_arg == NULL && /* check reentrant */
 	    trace_arg->self != rb_mRubyVMFrozenCore /* skip special methods. TODO: remove it. */) {
-	    const VALUE errinfo = th->errinfo;
+	    const VALUE errinfo = th->ec.errinfo;
 	    const VALUE old_recursive = th->ec.local_storage_recursive_hash;
 	    int state = 0;
 
 	    th->ec.local_storage_recursive_hash = th->ec.local_storage_recursive_hash_for_trace;
-	    th->errinfo = Qnil;
+	    th->ec.errinfo = Qnil;
 
 	    th->vm->trace_running++;
-	    th->trace_arg = trace_arg;
+	    th->ec.trace_arg = trace_arg;
 	    {
 		/* thread local traces */
 		state = exec_hooks_protected(th, &th->event_hooks, trace_arg);
@@ -338,10 +338,10 @@ rb_threadptr_exec_event_hooks_orig(rb_tr https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L338
 		state = exec_hooks_protected(th, &th->vm->event_hooks, trace_arg);
 		if (state) goto terminate;
 
-		th->errinfo = errinfo;
+		th->ec.errinfo = errinfo;
 	    }
 	  terminate:
-	    th->trace_arg = 0;
+	    th->ec.trace_arg = NULL;
 	    th->vm->trace_running--;
 
 	    th->ec.local_storage_recursive_hash_for_trace = th->ec.local_storage_recursive_hash;
@@ -379,12 +379,12 @@ rb_suppress_tracing(VALUE (*func)(VALUE) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L379
     VALUE result = Qnil;
     rb_thread_t *volatile th = GET_THREAD();
     enum ruby_tag_type state;
-    const int tracing = th->trace_arg ? 1 : 0;
+    const int tracing = th->ec.trace_arg ? 1 : 0;
     rb_trace_arg_t dummy_trace_arg;
     dummy_trace_arg.event = 0;
 
     if (!tracing) th->vm->trace_running++;
-    if (!th->trace_arg) th->trace_arg = &dummy_trace_arg;
+    if (!th->ec.trace_arg) th->ec.trace_arg = &dummy_trace_arg;
 
     raised = rb_threadptr_reset_raised(th);
 
@@ -398,7 +398,7 @@ rb_suppress_tracing(VALUE (*func)(VALUE) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L398
 	rb_threadptr_set_raised(th);
     }
 
-    if (th->trace_arg == &dummy_trace_arg) th->trace_arg = 0;
+    if (th->ec.trace_arg == &dummy_trace_arg) th->ec.trace_arg = 0;
     if (!tracing) th->vm->trace_running--;
 
     if (state) {
@@ -703,7 +703,7 @@ tpptr(VALUE tpval) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L703
 static rb_trace_arg_t *
 get_trace_arg(void)
 {
-    rb_trace_arg_t *trace_arg = GET_THREAD()->trace_arg;
+    rb_trace_arg_t *trace_arg = GET_THREAD()->ec.trace_arg;
     if (trace_arg == 0) {
 	rb_raise(rb_eRuntimeError, "access from outside");
     }
@@ -1307,7 +1307,7 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L1307
 tracepoint_inspect(VALUE self)
 {
     rb_tp_t *tp = tpptr(self);
-    rb_trace_arg_t *trace_arg = GET_THREAD()->trace_arg;
+    rb_trace_arg_t *trace_arg = GET_THREAD()->ec.trace_arg;
 
     if (trace_arg) {
 	switch (trace_arg->event) {
@@ -1591,9 +1591,9 @@ rb_postponed_job_flush(rb_vm_t *vm) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L1591
     rb_thread_t *th = GET_THREAD();
     const unsigned long block_mask = POSTPONED_JOB_INTERRUPT_MASK|TRAP_INTERRUPT_MASK;
     unsigned long saved_mask = th->interrupt_mask & block_mask;
-    VALUE saved_errno = th->errinfo;
+    VALUE saved_errno = th->ec.errinfo;
 
-    th->errinfo = Qnil;
+    th->ec.errinfo = Qnil;
     /* mask POSTPONED_JOB dispatch */
     th->interrupt_mask |= block_mask;
     {
@@ -1611,5 +1611,5 @@ rb_postponed_job_flush(rb_vm_t *vm) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L1611
     }
     /* restore POSTPONED_JOB mask */
     th->interrupt_mask &= ~(saved_mask ^ block_mask);
-    th->errinfo = saved_errno;
+    th->ec.errinfo = saved_errno;
 }
Index: cont.c
===================================================================
--- cont.c	(revision 59198)
+++ cont.c	(revision 59199)
@@ -408,15 +408,12 @@ cont_save_thread(rb_context_t *cont, rb_ https://github.com/ruby/ruby/blob/trunk/cont.c#L408
 {
     rb_thread_t *sth = &cont->saved_thread;
 
+    VM_ASSERT(th->status == THREAD_RUNNABLE);
+
     /* save thread context */
     sth->ec = th->ec;
-
-    VM_ASSERT(th->status == THREAD_RUNNABLE);
-    sth->errinfo = th->errinfo;
     sth->first_proc = th->first_proc;
 
-    sth->trace_arg = th->trace_arg;
-
     /* saved_thread->machine.stack_(start|end) should be NULL */
     /* because it may happen GC afterward */
     sth->machine.stack_start = 0;
@@ -548,6 +545,8 @@ cont_restore_thread(rb_context_t *cont) https://github.com/ruby/ruby/blob/trunk/cont.c#L545
 	th->ec.root_lep = sth->ec.root_lep;
 	th->ec.root_svar = sth->ec.root_svar;
 	th->ec.ensure_list = sth->ec.ensure_list;
+	th->ec.errinfo = sth->ec.errinfo;
+	th->ec.trace_arg = sth->ec.trace_arg;
     }
     else {
 	/* fiber */
@@ -556,7 +555,6 @@ cont_restore_thread(rb_context_t *cont) https://github.com/ruby/ruby/blob/trunk/cont.c#L555
 	th->fiber = (rb_fiber_t*)cont;
     }
 
-    th->errinfo = sth->errinfo;
     th->first_proc = sth->first_proc;
 
     VM_ASSERT(sth->status == THREAD_RUNNABLE);
@@ -1067,8 +1065,6 @@ rb_cont_call(int argc, VALUE *argv, VALU https://github.com/ruby/ruby/blob/trunk/cont.c#L1065
     cont->argc = argc;
     cont->value = make_passing_arg(argc, argv);
 
-    /* restore `tracing' context. see [Feature #4347] */
-    th->trace_arg = cont->saved_thread.trace_arg;
     cont_restore_0(cont, &contval);
     return Qnil; /* unreachable */
 }
@@ -1261,7 +1257,7 @@ rb_fiber_start(void) https://github.com/ruby/ruby/blob/trunk/cont.c#L1257
 	GetProcPtr(cont->saved_thread.first_proc, proc);
 	argv = (argc = cont->argc) > 1 ? RARRAY_CONST_PTR(args) : &args;
 	cont->value = Qnil;
-	th->errinfo = Qnil;
+	th->ec.errinfo = Qnil;
 	th->ec.root_lep = rb_vm_proc_local_ep(cont->saved_thread.first_proc);
 	th->ec.root_svar = Qfalse;
 	fib->status = FIBER_RUNNING;
@@ -1273,10 +1269,10 @@ rb_fiber_start(void) https://github.com/ruby/ruby/blob/trunk/cont.c#L1269
 
     if (state) {
 	if (state == TAG_RAISE || state == TAG_FATAL) {
-	    rb_threadptr_pending_interrupt_enque(th, th->errinfo);
+	    rb_threadptr_pending_interrupt_enque(th, th->ec.errinfo);
 	}
 	else {
-	    VALUE err = rb_vm_make_jump_tag_but_local_jump(state, th->errinfo);
+	    VALUE err = rb_vm_make_jump_tag_but_local_jump(state, th->ec.errinfo);
 	    if (!NIL_P(err))
 		rb_threadptr_pending_interrupt_enque(th, err);
 	}
@@ -1445,10 +1441,6 @@ fiber_switch(rb_fiber_t *fib, int argc, https://github.com/ruby/ruby/blob/trunk/cont.c#L1441
     if (is_resume) {
 	fib->prev = fiber_current();
     }
-    else {
-	/* restore `tracing' context. see [Feature #4347] */
-	th->trace_arg = cont->saved_thread.trace_arg;
-    }
 
     cont->argc = argc;
     cont->value = make_passing_arg(argc, argv);
Index: eval_error.c
===================================================================
--- eval_error.c	(revision 59198)
+++ eval_error.c	(revision 59199)
@@ -69,7 +69,7 @@ set_backtrace(VALUE info, VALUE bt) https://github.com/ruby/ruby/blob/trunk/eval_error.c#L69
 static void
 error_print(rb_thread_t *th)
 {
-    rb_threadptr_error_print(th, th->errinfo);
+    rb_threadptr_error_print(th, th->ec.errinfo);
 }
 
 static void
@@ -202,7 +202,7 @@ rb_threadptr_error_print(rb_thread_t *vo https://github.com/ruby/ruby/blob/trunk/eval_error.c#L202
     }
   error:
     TH_POP_TAG();
-    th->errinfo = errinfo;
+    th->ec.errinfo = errinfo;
     rb_thread_raised_set(th, raised_flag);
 }
 
@@ -304,7 +304,7 @@ error_handle(int ex) https://github.com/ruby/ruby/blob/trunk/eval_error.c#L304
 	warn_print("unexpected throw\n");
 	break;
       case TAG_RAISE: {
-	VALUE errinfo = th->errinfo;
+	VALUE errinfo = th->ec.errinfo;
 	if (rb_obj_is_kind_of(errinfo, rb_eSystemExit)) {
 	    status = sysexit_status(errinfo);
 	}
Index: process.c
===================================================================
--- process.c	(revision 59198)
+++ process.c	(revision 59199)
@@ -3858,7 +3858,7 @@ rb_f_abort(int argc, const VALUE *argv) https://github.com/ruby/ruby/blob/trunk/process.c#L3858
     rb_check_arity(argc, 0, 1);
     if (argc == 0) {
 	rb_thread_t *th = GET_THREAD();
-	VALUE errinfo = th->errinfo;
+	VALUE errinfo = th->ec.errinfo;
 	if (!NIL_P(errinfo)) {
 	    rb_threadptr_error_print(th, errinfo);
 	}
Index: vm_exec.c
===================================================================
--- vm_exec.c	(revision 59198)
+++ vm_exec.c	(revision 59199)
@@ -162,8 +162,8 @@ vm_exec_core(rb_thread_t *th, VALUE init https://github.com/ruby/ruby/blob/trunk/vm_exec.c#L162
 	return ret;
     }
     else {
-	VALUE err = th->errinfo;
-	th->errinfo = Qnil;
+	VALUE err = th->ec.errinfo;
+	th->ec.errinfo = Qnil;
 	return err;
     }
 }
Index: vm_exec.h
===================================================================
--- vm_exec.h	(revision 59198)
+++ vm_exec.h	(revision 59199)
@@ -161,7 +161,7 @@ default:                        \ https://github.com/ruby/ruby/blob/trunk/vm_exec.h#L161
 
 #if OPT_CALL_THREADED_CODE
 #define THROW_EXCEPTION(exc) do { \
-    th->errinfo = (VALUE)(exc); \
+    th->ec.errinfo = (VALUE)(exc); \
     return 0; \
 } while (0)
 #else
Index: thread.c
===================================================================
--- thread.c	(revision 59198)
+++ thread.c	(revision 59199)
@@ -580,7 +580,7 @@ thread_do_start(rb_thread_t *th, VALUE a https://github.com/ruby/ruby/blob/trunk/thread.c#L580
     if (!th->first_func) {
 	rb_proc_t *proc;
 	GetProcPtr(th->first_proc, proc);
-	th->errinfo = Qnil;
+	th->ec.errinfo = Qnil;
 	th->ec.root_lep = rb_vm_proc_local_ep(th->first_proc);
 	th->ec.root_svar = Qfalse;
 	EXEC_EVENT_HOOK(th, RUBY_EVENT_THREAD_BEGIN, th->self, 0, 0, 0, Qundef);
@@ -629,7 +629,7 @@ thread_start_func_2(rb_thread_t *th, VAL https://github.com/ruby/ruby/blob/trunk/thread.c#L629
 	    SAVE_ROOT_JMPBUF(th, thread_do_start(th, args));
 	}
 	else {
-	    errinfo = th->errinfo;
+	    errinfo = th->ec.errinfo;
 	    if (state == TAG_FATAL) {
 		/* fatal error within this thread, need to stop whole script */
 	    }
@@ -923,8 +923,8 @@ thread_join(rb_thread_t *target_th, doub https://github.com/ruby/ruby/blob/trunk/thread.c#L923
     thread_debug("thread_join: success (thid: %"PRI_THREAD_ID")\n",
 		 thread_id_str(target_th));
 
-    if (target_th->errinfo != Qnil) {
-	VALUE err = target_th->errinfo;
+    if (target_th->ec.errinfo != Qnil) {
+	VALUE err = target_th->ec.errinfo;
 
 	if (FIXNUM_P(err)) {
 	    switch (err) {
@@ -935,7 +935,7 @@ thread_join(rb_thread_t *target_th, doub https://github.com/ruby/ruby/blob/trunk/thread.c#L935
 		rb_bug("thread_join: Fixnum (%d) should not reach here.", FIX2INT(err));
 	    }
 	}
-	else if (THROW_DATA_P(target_th->errinfo)) {
+	else if (THROW_DATA_P(target_th->ec.errinfo)) {
 	    rb_bug("thread_join: THROW_DATA should not reach here.");
 	}
 	else {
@@ -2008,7 +2008,7 @@ rb_threadptr_to_kill(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/thread.c#L2008
     rb_threadptr_pending_interrupt_clear(th);
     th->status = THREAD_RUNNABLE;
     th->to_kill = 1;
-    th->errinfo = INT2FIX(TAG_FATAL);
+    th->ec.errinfo = INT2FIX(TAG_FATAL);
     TH_JUMP_TAG(th, TAG_FATAL);
 }
 
@@ -2822,8 +2822,8 @@ rb_thread_status(VALUE thread) https://github.com/ruby/ruby/blob/trunk/thread.c#L2822
     rb_thread_t *target_th = rb_thread_ptr(thread);
 
     if (rb_threadptr_dead(target_th)) {
-	if (!NIL_P(target_th->errinfo) &&
-	    !FIXNUM_P(target_th->errinfo)) {
+	if (!NIL_P(target_th->ec.errinfo) &&
+	    !FIXNUM_P(target_th->ec.errinfo)) {
 	    return Qnil;
 	}
 	else {
Index: gc.c
===================================================================
--- gc.c	(revision 59198)
+++ gc.c	(revision 59199)
@@ -7695,7 +7695,7 @@ rb_memerror(void) https://github.com/ruby/ruby/blob/trunk/gc.c#L7695
 	rb_thread_raised_set(th, RAISED_NOMEMORY);
 	exc = ruby_vm_special_exception_copy(exc);
     }
-    th->errinfo = exc;
+    th->ec.errinfo = exc;
     TH_JUMP_TAG(th, TAG_RAISE);
 }
 
Index: eval_jump.c
===================================================================
--- eval_jump.c	(revision 59198)
+++ eval_jump.c	(revision 59199)
@@ -116,26 +116,26 @@ rb_exec_end_proc(void) https://github.com/ruby/ruby/blob/trunk/eval_jump.c#L116
     enum ruby_tag_type state;
     volatile int safe = rb_safe_level();
     rb_thread_t *th = GET_THREAD();
-    volatile VALUE errinfo = th->errinfo;
+    volatile VALUE errinfo = th->ec.errinfo;
 
     TH_PUSH_TAG(th);
     if ((state = EXEC_TAG()) == TAG_NONE) {
       again:
-	exec_end_procs_chain(&ephemeral_end_procs, &th->errinfo);
-	exec_end_procs_chain(&end_procs, &th->errinfo);
+	exec_end_procs_chain(&ephemeral_end_procs, &th->ec.errinfo);
+	exec_end_procs_chain(&end_procs, &th->ec.errinfo);
     }
     else {
 	VAR_INITIALIZED(th);
 	TH_TMPPOP_TAG();
 	error_handle(state);
-	if (!NIL_P(th->errinfo)) errinfo = th->errinfo;
+	if (!NIL_P(th->ec.errinfo)) errinfo = th->ec.errinfo;
 	TH_REPUSH_TAG();
 	goto again;
     }
     TH_POP_TAG();
 
     rb_set_safe_level_force(safe);
-    th->errinfo = errinfo;
+    th->ec.errinfo = errinfo;
 }
 
 void
Index: vm.c
===================================================================
--- vm.c	(revision 59198)
+++ vm.c	(revision 59199)
@@ -1476,7 +1476,7 @@ vm_iter_break(rb_thread_t *th, VALUE val https://github.com/ruby/ruby/blob/trunk/vm.c#L1476
     }
 #endif
 
-    th->errinfo = (VALUE)THROW_DATA_NEW(val, target_cfp, TAG_BREAK);
+    th->ec.errinfo = (VALUE)THROW_DATA_NEW(val, target_cfp, TAG_BREAK);
     TH_JUMP_TAG(th, TAG_BREAK);
 }
 
@@ -1803,7 +1803,7 @@ vm_exec(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/vm.c#L1803
 	VALUE type;
 	const rb_control_frame_t *escape_cfp;
 
-	err = (struct vm_throw_data *)th->errinfo;
+	err = (struct vm_throw_data *)th->ec.errinfo;
 
       exception_handler:
 	cont_pc = cont_sp = 0;
@@ -1849,7 +1849,7 @@ vm_exec(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/vm.c#L1849
 			    }
 			}
 			if (catch_iseq == NULL) {
-			    th->errinfo = Qnil;
+			    th->ec.errinfo = Qnil;
 			    result = THROW_DATA_VAL(err);
 			    THROW_DATA_CATCH_FRAME_SET(err, cfp + 1);
 			    hook_before_rewind(th, th->ec.cfp, TRUE, state, err);
@@ -1866,7 +1866,7 @@ vm_exec(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/vm.c#L1866
 #else
 		    *th->ec.cfp->sp++ = THROW_DATA_VAL(err);
 #endif
-		    th->errinfo = Qnil;
+		    th->ec.errinfo = Qnil;
 		    goto vm_loop_start;
 		}
 	    }
@@ -1905,7 +1905,7 @@ vm_exec(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/vm.c#L1905
 			escape_cfp = THROW_DATA_CATCH_FRAME(err);
 			if (cfp == escape_cfp) {
 			    cfp->pc = cfp->iseq->body->iseq_encoded + entry->cont;
-			    th->errinfo = Qnil;
+			    th->ec.errinfo = Qnil;
 			    goto vm_loop_start;
 			}
 		    }
@@ -1938,7 +1938,7 @@ vm_exec(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/vm.c#L1938
 			    *th->ec.cfp->sp++ = THROW_DATA_VAL(err);
 #endif
 			}
-			th->errinfo = Qnil;
+			th->ec.errinfo = Qnil;
 			VM_ASSERT(th->ec.tag->state == TAG_NONE);
 			goto vm_loop_start;
 		    }
@@ -1990,7 +1990,7 @@ vm_exec(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/vm.c#L1990
 
 	    state = 0;
 	    th->ec.tag->state = TAG_NONE;
-	    th->errinfo = Qnil;
+	    th->ec.errinfo = Qnil;
 	    goto vm_loop_start;
 	}
 	else {
@@ -1998,7 +1998,7 @@ vm_exec(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/vm.c#L1998
 
 	    if (VM_FRAME_FINISHED_P(th->ec.cfp)) {
 		rb_vm_pop_frame(th);
-		th->errinfo = (VALUE)err;
+		th->ec.errinfo = (VALUE)err;
 		TH_TMPPOP_TAG();
 		TH_JUMP_TAG(th, state);
 	    }
@@ -2404,7 +2404,7 @@ rb_thread_mark(void *ptr) https://github.com/ruby/ruby/blob/trunk/vm.c#L2404
 
     RUBY_MARK_UNLESS_NULL(th->thgroup);
     RUBY_MARK_UNLESS_NULL(th->value);
-    RUBY_MARK_UNLESS_NULL(th->errinfo);
+    RUBY_MARK_UNLESS_NULL(th->ec.errinfo);
     RUBY_MARK_UNLESS_NULL(th->pending_interrupt_queue);
     RUBY_MARK_UNLESS_NULL(th->pending_interrupt_mask_stack);
     RUBY_MARK_UNLESS_NULL(th->ec.root_svar);
@@ -2537,8 +2537,8 @@ th_init(rb_thread_t *th, VALUE self) https://github.com/ruby/ruby/blob/trunk/vm.c#L2537
 		  0 /* dummy pc */, th->ec.stack, 0, 0);
 
     th->status = THREAD_RUNNABLE;
-    th->errinfo = Qnil;
     th->last_status = Qnil;
+    th->ec.errinfo = Qnil;
     th->ec.root_svar = Qfalse;
     th->ec.local_storag (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]