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

ruby-changes:48564

From: ko1 <ko1@a...>
Date: Tue, 7 Nov 2017 14:01:56 +0900 (JST)
Subject: [ruby-changes:48564] ko1:r60679 (trunk): move `rb_thread_t::method_missing_reason` to ec.

ko1	2017-11-07 14:01:51 +0900 (Tue, 07 Nov 2017)

  New Revision: 60679

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

  Log:
    move `rb_thread_t::method_missing_reason` to ec.
    
    * vm_core.h (rb_thread_t): move method_missing_reason to
      rb_execution_context_t.

  Modified files:
    trunk/vm_core.h
    trunk/vm_eval.c
    trunk/vm_insnhelper.c
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 60678)
+++ vm_core.h	(revision 60679)
@@ -771,6 +771,7 @@ typedef struct rb_execution_context_stru https://github.com/ruby/ruby/blob/trunk/vm_core.h#L771
     VALUE errinfo;
     VALUE passed_block_handler; /* for rb_iterate */
     const rb_callable_method_entry_t *passed_bmethod_me; /* for bmethod */
+    enum method_missing_reason method_missing_reason;
 
     /* for GC */
     struct {
@@ -852,7 +853,6 @@ typedef struct rb_thread_struct { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L853
     rb_jmpbuf_t root_jmpbuf;
 
     /* misc */
-    enum method_missing_reason method_missing_reason: 8;
     unsigned int abort_on_exception: 1;
     unsigned int report_on_exception: 1;
 #ifdef USE_SIGALTSTACK
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 60678)
+++ vm_insnhelper.c	(revision 60679)
@@ -2037,7 +2037,7 @@ vm_call_opt_send(rb_execution_context_t https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2037
 	}
 	TOPN(i) = rb_str_intern(sym);
 	ci->mid = idMethodMissing;
-	rb_ec_thread_ptr(ec)->method_missing_reason = cc->aux.method_missing_reason = ci_missing_reason(ci);
+	ec->method_missing_reason = cc->aux.method_missing_reason = ci_missing_reason(ci);
     }
     else {
 	/* shift arguments */
@@ -2104,7 +2104,7 @@ vm_call_method_missing(rb_execution_cont https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2104
     argv[0] = ID2SYM(orig_ci->mid);
     INC_SP(1);
 
-    rb_ec_thread_ptr(ec)->method_missing_reason = orig_cc->aux.method_missing_reason;
+    ec->method_missing_reason = orig_cc->aux.method_missing_reason;
     return vm_call_method(ec, reg_cfp, calling, ci, cc);
 }
 
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 60678)
+++ vm_eval.c	(revision 60679)
@@ -373,7 +373,7 @@ check_funcall_missing(rb_execution_conte https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L373
 
 	new_args[0] = ID2SYM(mid);
 	MEMCPY(new_args+1, argv, VALUE, argc);
-	rb_ec_thread_ptr(ec)->method_missing_reason = MISSING_NOENTRY;
+	ec->method_missing_reason = MISSING_NOENTRY;
 	args.th = rb_ec_thread_ptr(ec);
 	args.recv = recv;
 	args.me = me;
@@ -630,8 +630,8 @@ NORETURN(static void raise_method_missin https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L630
 static VALUE
 rb_method_missing(int argc, const VALUE *argv, VALUE obj)
 {
-    rb_thread_t *th = GET_THREAD();
-    raise_method_missing(th->ec, argc, argv, obj, th->method_missing_reason);
+    rb_execution_context_t *ec = GET_EC();
+    raise_method_missing(ec, argc, argv, obj, ec->method_missing_reason);
     UNREACHABLE;
 }
 
@@ -711,7 +711,7 @@ method_missing(VALUE obj, ID id, int arg https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L711
     VALUE block_handler = vm_passed_block_handler(ec);
     const rb_callable_method_entry_t *me;
 
-    rb_ec_thread_ptr(ec)->method_missing_reason = call_status;
+    ec->method_missing_reason = call_status;
 
     if (id == idMethodMissing) {
       missing:
@@ -905,7 +905,7 @@ send_internal(int argc, const VALUE *arg https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L905
 	    }
 	}
 	id = idMethodMissing;
-	rb_ec_thread_ptr(ec)->method_missing_reason = MISSING_NOENTRY;
+	ec->method_missing_reason = MISSING_NOENTRY;
     }
     else {
 	argv++; argc--;

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

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