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

ruby-changes:48406

From: ko1 <ko1@a...>
Date: Sat, 28 Oct 2017 20:53:04 +0900 (JST)
Subject: [ruby-changes:48406] ko1:r60520 (trunk): `th` -> `ec` for rb_vm_call()

ko1	2017-10-28 20:52:56 +0900 (Sat, 28 Oct 2017)

  New Revision: 60520

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

  Log:
    `th` -> `ec` for rb_vm_call()
    
    * vm_eval.c (rb_vm_call): accepts `ec` instead of `th`.
    
    * proc.c: catch up this fix.

  Modified files:
    trunk/proc.c
    trunk/vm_core.h
    trunk/vm_eval.c
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 60519)
+++ vm_core.h	(revision 60520)
@@ -1508,7 +1508,7 @@ const rb_env_t *rb_vm_env_prev_env(const https://github.com/ruby/ruby/blob/trunk/vm_core.h#L1508
 const VALUE *rb_binding_add_dynavars(VALUE bindval, rb_binding_t *bind, int dyncount, const ID *dynvars);
 void rb_vm_inc_const_missing_count(void);
 void rb_vm_gvl_destroy(rb_vm_t *vm);
-VALUE rb_vm_call(rb_thread_t *th, VALUE recv, VALUE id, int argc,
+VALUE rb_vm_call(rb_execution_context_t *ec, VALUE recv, VALUE id, int argc,
 		 const VALUE *argv, const rb_callable_method_entry_t *me);
 void rb_vm_pop_frame(rb_execution_context_t *ec);
 
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 60519)
+++ vm_eval.c	(revision 60520)
@@ -202,9 +202,9 @@ vm_call0_body(rb_execution_context_t *ec https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L202
 }
 
 VALUE
-rb_vm_call(rb_thread_t *th, VALUE recv, VALUE id, int argc, const VALUE *argv, const rb_callable_method_entry_t *me)
+rb_vm_call(rb_execution_context_t *ec, VALUE recv, VALUE id, int argc, const VALUE *argv, const rb_callable_method_entry_t *me)
 {
-    return vm_call0(th->ec, recv, id, argc, argv, me);
+    return vm_call0(ec, recv, id, argc, argv, me);
 }
 
 static inline VALUE
Index: proc.c
===================================================================
--- proc.c	(revision 60519)
+++ proc.c	(revision 60520)
@@ -2096,32 +2096,32 @@ method_callable_method_entry(const struc https://github.com/ruby/ruby/blob/trunk/proc.c#L2096
 }
 
 static inline VALUE
-call_method_data(rb_thread_t *th, const struct METHOD *data,
+call_method_data(rb_execution_context_t *ec, const struct METHOD *data,
 		 int argc, const VALUE *argv, VALUE passed_procval)
 {
-    vm_passed_block_handler_set(th->ec, proc_to_block_handler(passed_procval));
-    return rb_vm_call(th, data->recv, data->me->called_id, argc, argv,
+    vm_passed_block_handler_set(ec, proc_to_block_handler(passed_procval));
+    return rb_vm_call(ec, data->recv, data->me->called_id, argc, argv,
 		      method_callable_method_entry(data));
 }
 
 static VALUE
-call_method_data_safe(rb_thread_t *th, const struct METHOD *data,
+call_method_data_safe(rb_execution_context_t *ec, const struct METHOD *data,
 		      int argc, const VALUE *argv, VALUE passed_procval,
 		      int safe)
 {
     VALUE result = Qnil;	/* OK */
     enum ruby_tag_type state;
 
-    EC_PUSH_TAG(th->ec);
+    EC_PUSH_TAG(ec);
     if ((state = EC_EXEC_TAG()) == TAG_NONE) {
 	/* result is used only if state == 0, no exceptions is caught. */
 	/* otherwise it doesn't matter even if clobbered. */
-	NO_CLOBBERED(result) = call_method_data(th, data, argc, argv, passed_procval);
+	NO_CLOBBERED(result) = call_method_data(ec, data, argc, argv, passed_procval);
     }
     EC_POP_TAG();
     rb_set_safe_level_force(safe);
     if (state)
-	EC_JUMP_TAG(th->ec, state);
+	EC_JUMP_TAG(ec, state);
     return result;
 }
 
@@ -2129,7 +2129,7 @@ VALUE https://github.com/ruby/ruby/blob/trunk/proc.c#L2129
 rb_method_call_with_block(int argc, const VALUE *argv, VALUE method, VALUE passed_procval)
 {
     const struct METHOD *data;
-    rb_thread_t *const th = GET_THREAD();
+    rb_execution_context_t *ec = GET_EC();
 
     TypedData_Get_Struct(method, struct METHOD, &method_data_type, data);
     if (data->recv == Qundef) {
@@ -2140,10 +2140,10 @@ rb_method_call_with_block(int argc, cons https://github.com/ruby/ruby/blob/trunk/proc.c#L2140
 	int safe = rb_safe_level();
 	if (safe < safe_level_to_run) {
 	    rb_set_safe_level_force(safe_level_to_run);
-	    return call_method_data_safe(th, data, argc, argv, passed_procval, safe);
+	    return call_method_data_safe(ec, data, argc, argv, passed_procval, safe);
 	}
     }
-    return call_method_data(th, data, argc, argv, passed_procval);
+    return call_method_data(ec, data, argc, argv, passed_procval);
 }
 
 /**********************************************************************

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

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