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

ruby-changes:48330

From: ko1 <ko1@a...>
Date: Thu, 26 Oct 2017 19:49:38 +0900 (JST)
Subject: [ruby-changes:48330] ko1:r60444 (trunk): A function accepts `ec` instead of `th`.

ko1	2017-10-26 19:49:33 +0900 (Thu, 26 Oct 2017)

  New Revision: 60444

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

  Log:
    A function accepts `ec` instead of `th`.
    
    * vm.c (rb_vm_search_cf_from_ep): accept `ec` instead of `th`.

  Modified files:
    trunk/vm.c
    trunk/vm_insnhelper.c
Index: vm.c
===================================================================
--- vm.c	(revision 60443)
+++ vm.c	(revision 60444)
@@ -32,13 +32,13 @@ VM_EP_LEP(const VALUE *ep) https://github.com/ruby/ruby/blob/trunk/vm.c#L32
 }
 
 static inline const rb_control_frame_t *
-rb_vm_search_cf_from_ep(const rb_thread_t * const th, const rb_control_frame_t *cfp, const VALUE * const ep)
+rb_vm_search_cf_from_ep(const rb_execution_context_t *ec, const rb_control_frame_t *cfp, const VALUE * const ep)
 {
     if (!ep) {
 	return NULL;
     }
     else {
-	const rb_control_frame_t * const eocfp = RUBY_VM_END_CONTROL_FRAME(th->ec); /* end of control frame pointer */
+	const rb_control_frame_t * const eocfp = RUBY_VM_END_CONTROL_FRAME(ec); /* end of control frame pointer */
 
 	while (cfp < eocfp) {
 	    if (cfp->ep == ep) {
@@ -1478,7 +1478,7 @@ vm_iter_break(rb_thread_t *th, VALUE val https://github.com/ruby/ruby/blob/trunk/vm.c#L1478
 {
     rb_control_frame_t *cfp = next_not_local_frame(th->ec->cfp);
     const VALUE *ep = VM_CF_PREV_EP(cfp);
-    const rb_control_frame_t *target_cfp = rb_vm_search_cf_from_ep(th, cfp, ep);
+    const rb_control_frame_t *target_cfp = rb_vm_search_cf_from_ep(th->ec, cfp, ep);
 
 #if 0				/* raise LocalJumpError */
     if (!target_cfp) {
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 60443)
+++ vm_insnhelper.c	(revision 60444)
@@ -1105,7 +1105,7 @@ vm_throw_start(rb_thread_t *const th, rb https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1105
 	    else {
 		ep = VM_ENV_PREV_EP(ep);
 		base_iseq = base_iseq->body->parent_iseq;
-		escape_cfp = rb_vm_search_cf_from_ep(th, escape_cfp, ep);
+		escape_cfp = rb_vm_search_cf_from_ep(th->ec, escape_cfp, ep);
 		VM_ASSERT(escape_cfp->iseq == base_iseq);
 	    }
 	}
@@ -1157,7 +1157,7 @@ vm_throw_start(rb_thread_t *const th, rb https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1157
 	    ep = VM_ENV_PREV_EP(ep);
 	}
 
-	escape_cfp = rb_vm_search_cf_from_ep(th, reg_cfp, ep);
+	escape_cfp = rb_vm_search_cf_from_ep(th->ec, reg_cfp, ep);
     }
     else if (state == TAG_RETURN) {
 	const VALUE *current_ep = GET_EP();

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

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