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

ruby-changes:47043

From: ko1 <ko1@a...>
Date: Fri, 23 Jun 2017 17:48:46 +0900 (JST)
Subject: [ruby-changes:47043] ko1:r59158 (trunk): rename th->state to th->tag_state.

ko1	2017-06-23 17:48:41 +0900 (Fri, 23 Jun 2017)

  New Revision: 59158

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

  Log:
    rename th->state to th->tag_state.
    
    * vm_core.h (rb_thread_t): rename rb_thread_t::state to tag_state
      to make it clear.

  Modified files:
    trunk/cont.c
    trunk/eval_intern.h
    trunk/vm.c
    trunk/vm_core.h
    trunk/vm_eval.c
    trunk/vm_insnhelper.c
    trunk/vm_trace.c
Index: cont.c
===================================================================
--- cont.c	(revision 59157)
+++ cont.c	(revision 59158)
@@ -413,7 +413,7 @@ cont_save_thread(rb_context_t *cont, rb_ https://github.com/ruby/ruby/blob/trunk/cont.c#L413
     sth->local_storage = th->local_storage;
     sth->safe_level = th->safe_level;
     sth->raised_flag = th->raised_flag;
-    sth->state = th->state;
+    sth->tag_state = th->tag_state;
     sth->status = th->status;
     sth->tag = th->tag;
     sth->protect_tag = th->protect_tag;
@@ -561,7 +561,7 @@ cont_restore_thread(rb_context_t *cont) https://github.com/ruby/ruby/blob/trunk/cont.c#L561
     th->ec.cfp = sth->ec.cfp;
     th->safe_level = sth->safe_level;
     th->raised_flag = sth->raised_flag;
-    th->state = sth->state;
+    th->tag_state = sth->tag_state;
     th->status = sth->status;
     th->tag = sth->tag;
     th->protect_tag = sth->protect_tag;
Index: eval_intern.h
===================================================================
--- eval_intern.h	(revision 59157)
+++ eval_intern.h	(revision 59158)
@@ -156,12 +156,12 @@ LONG WINAPI rb_w32_stack_overflow_handle https://github.com/ruby/ruby/blob/trunk/eval_intern.h#L156
 # define VAR_NOCLOBBERED(var) var
 #endif
 
-/* clear th->state, and return the value */
+/* clear th->tag_state, and return the value */
 static inline int
 rb_threadptr_tag_state(rb_thread_t *th)
 {
-    enum ruby_tag_type state = th->state;
-    th->state = 0;
+    enum ruby_tag_type state = th->tag_state;
+    th->tag_state = TAG_NONE;
     return state;
 }
 
@@ -169,7 +169,7 @@ NORETURN(static inline void rb_threadptr https://github.com/ruby/ruby/blob/trunk/eval_intern.h#L169
 static inline void
 rb_threadptr_tag_jump(rb_thread_t *th, enum ruby_tag_type st)
 {
-    th->state = st;
+    th->tag_state = st;
     ruby_longjmp(th->tag->buf, 1);
 }
 
Index: vm.c
===================================================================
--- vm.c	(revision 59157)
+++ vm.c	(revision 59158)
@@ -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->state = TAG_BREAK;
+    th->tag_state = TAG_BREAK;
     th->errinfo = (VALUE)THROW_DATA_NEW(val, target_cfp, TAG_BREAK);
     TH_JUMP_TAG(th, TAG_BREAK);
 }
@@ -1787,9 +1787,9 @@ vm_exec(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/vm.c#L1787
     if ((state = EXEC_TAG()) == TAG_NONE) {
       vm_loop_start:
 	result = vm_exec_core(th, initial);
-	if ((state = th->state) != TAG_NONE) {
+	if ((state = th->tag_state) != TAG_NONE) {
 	    err = (struct vm_throw_data *)result;
-	    th->state = TAG_NONE;
+	    th->tag_state = TAG_NONE;
 	    goto exception_handler;
 	}
     }
@@ -1939,7 +1939,7 @@ vm_exec(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/vm.c#L1939
 #endif
 			}
 			th->errinfo = Qnil;
-			th->state = TAG_NONE;
+			th->tag_state = TAG_NONE;
 			goto vm_loop_start;
 		    }
 		}
@@ -1989,7 +1989,7 @@ vm_exec(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/vm.c#L1989
 			  catch_iseq->body->stack_max);
 
 	    state = 0;
-	    th->state = TAG_NONE;
+	    th->tag_state = TAG_NONE;
 	    th->errinfo = Qnil;
 	    goto vm_loop_start;
 	}
Index: vm_trace.c
===================================================================
--- vm_trace.c	(revision 59157)
+++ vm_trace.c	(revision 59158)
@@ -329,12 +329,12 @@ rb_threadptr_exec_event_hooks_orig(rb_tr https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L329
 	if (th->trace_arg == 0 && /* check reentrant */
 	    trace_arg->self != rb_mRubyVMFrozenCore /* skip special methods. TODO: remove it. */) {
 	    const VALUE errinfo = th->errinfo;
-	    const enum ruby_tag_type outer_state = th->state;
+	    const enum ruby_tag_type outer_state = th->tag_state;
 	    const VALUE old_recursive = th->local_storage_recursive_hash;
 	    int state = 0;
 
 	    th->local_storage_recursive_hash = th->local_storage_recursive_hash_for_trace;
-	    th->state = TAG_NONE;
+	    th->tag_state = TAG_NONE;
 	    th->errinfo = Qnil;
 
 	    th->vm->trace_running++;
@@ -366,7 +366,7 @@ rb_threadptr_exec_event_hooks_orig(rb_tr https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L366
 		}
 		TH_JUMP_TAG(th, state);
 	    }
-	    th->state = outer_state;
+	    th->tag_state = outer_state;
 	}
     }
 }
@@ -399,8 +399,8 @@ rb_suppress_tracing(VALUE (*func)(VALUE) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L399
     if (!th->trace_arg) th->trace_arg = &dummy_trace_arg;
 
     raised = rb_threadptr_reset_raised(th);
-    outer_state = th->state;
-    th->state = TAG_NONE;
+    outer_state = th->tag_state;
+    th->tag_state = TAG_NONE;
 
     TH_PUSH_TAG(th);
     if ((state = TH_EXEC_TAG()) == TAG_NONE) {
@@ -419,7 +419,7 @@ rb_suppress_tracing(VALUE (*func)(VALUE) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L419
 	TH_JUMP_TAG(th, state);
     }
 
-    th->state = outer_state;
+    th->tag_state = outer_state;
     return result;
 }
 
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 59157)
+++ vm_insnhelper.c	(revision 59158)
@@ -1029,17 +1029,16 @@ vm_throw_continue(rb_thread_t *th, VALUE https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1029
     /* continue throw */
 
     if (FIXNUM_P(err)) {
-	th->state = FIX2INT(err);
+	th->tag_state = FIX2INT(err);
     }
     else if (SYMBOL_P(err)) {
-	th->state = TAG_THROW;
+	th->tag_state = TAG_THROW;
     }
     else if (THROW_DATA_P(err)) {
-	th->state = THROW_DATA_STATE((struct vm_throw_data *)err);
+	th->tag_state = THROW_DATA_STATE((struct vm_throw_data *)err);
     }
     else {
-	th->state = TAG_RAISE;
-	/*th->state = FIX2INT(rb_ivar_get(err, idThrowState));*/
+	th->tag_state = TAG_RAISE;
     }
     return err;
 }
@@ -1178,7 +1177,7 @@ vm_throw_start(rb_thread_t *const th, rb https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1177
 	rb_bug("isns(throw): unsupport throw type");
     }
 
-    th->state = state;
+    th->tag_state = state;
     return (VALUE)THROW_DATA_NEW(throwobj, escape_cfp, state);
 }
 
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 59157)
+++ vm_core.h	(revision 59158)
@@ -744,7 +744,7 @@ typedef struct rb_thread_struct { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L744
     VALUE last_status; /* $? */
 
     /* passing state */
-    enum ruby_tag_type state;
+    enum ruby_tag_type tag_state;
 
     /* for rb_iterate */
     VALUE passed_block_handler;
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 59157)
+++ vm_eval.c	(revision 59158)
@@ -1136,7 +1136,7 @@ rb_iterate0(VALUE (* it_proc) (VALUE), V https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1136
 	    rb_vm_rewind_cfp(th, cfp);
 
 	    state = 0;
-	    th->state = TAG_NONE;
+	    th->tag_state = TAG_NONE;
 	    th->errinfo = Qnil;
 
 	    if (state == TAG_RETRY) goto iter_retry;

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

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