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

ruby-changes:48334

From: ko1 <ko1@a...>
Date: Thu, 26 Oct 2017 19:55:44 +0900 (JST)
Subject: [ruby-changes:48334] ko1:r60448 (trunk): vm_pop_frame() accepts `ec` instead of `th`.

ko1	2017-10-26 19:55:24 +0900 (Thu, 26 Oct 2017)

  New Revision: 60448

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

  Log:
    vm_pop_frame() accepts `ec` instead of `th`.
    
    * vm_insnhelper.c (vm_pop_frame): accepts `ec` instead of `th`.

  Modified files:
    trunk/eval.c
    trunk/insns.def
    trunk/vm.c
    trunk/vm_args.c
    trunk/vm_core.h
    trunk/vm_eval.c
    trunk/vm_insnhelper.c
    trunk/vm_trace.c
Index: eval.c
===================================================================
--- eval.c	(revision 60447)
+++ eval.c	(revision 60448)
@@ -803,7 +803,7 @@ rb_raise_jump(VALUE mesg, VALUE cause) https://github.com/ruby/ruby/blob/trunk/eval.c#L803
     VALUE self = cfp->self;
     ID mid = me->called_id;
 
-    rb_vm_pop_frame(th);
+    rb_vm_pop_frame(th->ec);
     EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, self, me->def->original_id, mid, klass, Qnil);
 
     rb_longjmp(th, TAG_RAISE, mesg, cause);
Index: vm_args.c
===================================================================
--- vm_args.c	(revision 60447)
+++ vm_args.c	(revision 60448)
@@ -698,7 +698,7 @@ raise_argument_error(rb_thread_t *th, co https://github.com/ruby/ruby/blob/trunk/vm_args.c#L698
 		      iseq->body->iseq_encoded,
 		      th->ec->cfp->sp, 0, 0 /* stack_max */);
 	at = rb_threadptr_backtrace_object(th);
-	rb_vm_pop_frame(th);
+	rb_vm_pop_frame(th->ec);
     }
     else {
 	at = rb_threadptr_backtrace_object(th);
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 60447)
+++ vm_insnhelper.c	(revision 60448)
@@ -271,22 +271,22 @@ rb_vm_push_frame(rb_execution_context_t https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L271
 
 /* return TRUE if the frame is finished */
 static inline int
-vm_pop_frame(rb_thread_t *th, rb_control_frame_t *cfp, const VALUE *ep)
+vm_pop_frame(rb_execution_context_t *ec, rb_control_frame_t *cfp, const VALUE *ep)
 {
     VALUE flags = ep[VM_ENV_DATA_INDEX_FLAGS];
 
     if (VM_CHECK_MODE >= 4) rb_gc_verify_internal_consistency();
     if (VMDEBUG == 2)       SDR();
 
-    th->ec->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
+    ec->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
 
     return flags & VM_FRAME_FLAG_FINISH;
 }
 
 void
-rb_vm_pop_frame(rb_thread_t *th)
+rb_vm_pop_frame(rb_execution_context_t *ec)
 {
-    vm_pop_frame(th, th->ec->cfp, th->ec->cfp->ep);
+    vm_pop_frame(ec, ec->cfp, ec->cfp->ep);
 }
 
 /* method dispatch */
@@ -1691,7 +1691,7 @@ vm_call_iseq_setup_tailcall(rb_thread_t https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1691
 	}
     }
 
-    vm_pop_frame(th, cfp, cfp->ep);
+    vm_pop_frame(th->ec, cfp, cfp->ep);
     cfp = th->ec->cfp;
 
     sp_orig = sp = cfp->sp;
@@ -1925,7 +1925,7 @@ vm_call_cfunc_with_frame(rb_thread_t *th https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1925
 
     CHECK_CFP_CONSISTENCY("vm_call_cfunc");
 
-    rb_vm_pop_frame(th);
+    rb_vm_pop_frame(th->ec);
 
     EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, recv, me->def->original_id, ci->mid, me->owner, val);
     RUBY_DTRACE_CMETHOD_RETURN_HOOK(th, me->owner, me->def->original_id);
@@ -2551,7 +2551,7 @@ vm_yield_with_cfunc(rb_thread_t *th, https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2551
 		  (VALUE)me,
 		  0, th->ec->cfp->sp, 0, 0);
     val = (*ifunc->func)(arg, ifunc->data, argc, argv, blockarg);
-    rb_vm_pop_frame(th);
+    rb_vm_pop_frame(th->ec);
 
     return val;
 }
Index: insns.def
===================================================================
--- insns.def	(revision 60447)
+++ insns.def	(revision 60448)
@@ -996,7 +996,7 @@ leave https://github.com/ruby/ruby/blob/trunk/insns.def#L996
 
     RUBY_VM_CHECK_INTS(th);
 
-    if (vm_pop_frame(th, GET_CFP(), GET_EP())) {
+    if (vm_pop_frame(th->ec, GET_CFP(), GET_EP())) {
 #if OPT_CALL_THREADED_CODE
 	th->retval = val;
 	return 0;
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 60447)
+++ vm_core.h	(revision 60448)
@@ -1509,7 +1509,7 @@ void rb_vm_inc_const_missing_count(void) https://github.com/ruby/ruby/blob/trunk/vm_core.h#L1509
 void rb_vm_gvl_destroy(rb_vm_t *vm);
 VALUE rb_vm_call(rb_thread_t *th, VALUE recv, VALUE id, int argc,
 		 const VALUE *argv, const rb_callable_method_entry_t *me);
-void rb_vm_pop_frame(rb_thread_t *th);
+void rb_vm_pop_frame(rb_execution_context_t *ec);
 
 void rb_thread_start_timer_thread(void);
 void rb_thread_stop_timer_thread(void);
Index: vm.c
===================================================================
--- vm.c	(revision 60447)
+++ vm.c	(revision 60448)
@@ -540,7 +540,7 @@ rb_vm_pop_cfunc_frame(void) https://github.com/ruby/ruby/blob/trunk/vm.c#L540
 
     EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, cfp->self, me->def->original_id, me->called_id, me->owner, Qnil);
     RUBY_DTRACE_CMETHOD_RETURN_HOOK(th, me->owner, me->def->original_id);
-    vm_pop_frame(th, cfp, cfp->ep);
+    vm_pop_frame(th->ec, cfp, cfp->ep);
 }
 
 void
@@ -552,7 +552,7 @@ rb_vm_rewind_cfp(rb_thread_t *th, rb_con https://github.com/ruby/ruby/blob/trunk/vm.c#L552
 	printf("skipped frame: %s\n", vm_frametype_name(th->ec->cfp));
 #endif
 	if (VM_FRAME_TYPE(th->ec->cfp) != VM_FRAME_MAGIC_CFUNC) {
-	    rb_vm_pop_frame(th);
+	    rb_vm_pop_frame(th->ec);
 	}
 	else { /* unlikely path */
 	    rb_vm_pop_cfunc_frame();
@@ -963,7 +963,7 @@ rb_binding_add_dynavars(VALUE bindval, r https://github.com/ruby/ruby/blob/trunk/vm.c#L963
 
     vm_set_eval_stack(th, iseq, 0, base_block);
     vm_bind_update_env(bindval, bind, envval = vm_make_env_object(th->ec, th->ec->cfp));
-    rb_vm_pop_frame(th);
+    rb_vm_pop_frame(th->ec);
 
     env = (const rb_env_t *)envval;
     return env->env;
@@ -1830,7 +1830,7 @@ vm_exec(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/vm.c#L1830
 					       rb_vm_frame_method_entry(th->ec->cfp)->owner,
 					       rb_vm_frame_method_entry(th->ec->cfp)->def->original_id);
 	    }
-	    rb_vm_pop_frame(th);
+	    rb_vm_pop_frame(th->ec);
 	}
 
 	cfp = th->ec->cfp;
@@ -1864,7 +1864,7 @@ vm_exec(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/vm.c#L1864
 			    result = THROW_DATA_VAL(err);
 			    THROW_DATA_CATCH_FRAME_SET(err, cfp + 1);
 			    hook_before_rewind(th, th->ec->cfp, TRUE, state, err);
-			    rb_vm_pop_frame(th);
+			    rb_vm_pop_frame(th->ec);
 			    goto finish_vme;
 			}
 		    }
@@ -2008,13 +2008,13 @@ vm_exec(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/vm.c#L2008
 	    hook_before_rewind(th, th->ec->cfp, FALSE, state, err);
 
 	    if (VM_FRAME_FINISHED_P(th->ec->cfp)) {
-		rb_vm_pop_frame(th);
+		rb_vm_pop_frame(th->ec);
 		th->ec->errinfo = (VALUE)err;
 		TH_TMPPOP_TAG();
 		TH_JUMP_TAG(th, state);
 	    }
 	    else {
-		rb_vm_pop_frame(th);
+		rb_vm_pop_frame(th->ec);
 		goto exception_handler;
 	    }
 	}
@@ -2115,7 +2115,7 @@ rb_vm_call_cfunc(VALUE recv, VALUE (*fun https://github.com/ruby/ruby/blob/trunk/vm.c#L2115
 
     val = (*func)(arg);
 
-    rb_vm_pop_frame(th);
+    rb_vm_pop_frame(th->ec);
     return val;
 }
 
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 60447)
+++ vm_eval.c	(revision 60448)
@@ -87,7 +87,7 @@ vm_call0_cfunc_with_frame(rb_thread_t* t https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L87
 
 	CHECK_CFP_CONSISTENCY("vm_call0_cfunc_with_frame");
 	VM_PROFILE_UP(C2C_POPF);
-	rb_vm_pop_frame(th);
+	rb_vm_pop_frame(th->ec);
     }
     EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, recv, me->def->original_id, mid, me->owner, val);
     RUBY_DTRACE_CMETHOD_RETURN_HOOK(th, me->owner, me->def->original_id);
Index: vm_trace.c
===================================================================
--- vm_trace.c	(revision 60447)
+++ vm_trace.c	(revision 60448)
@@ -352,7 +352,7 @@ rb_threadptr_exec_event_hooks_orig(rb_tr https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L352
 		    if (VM_FRAME_FINISHED_P(th->ec->cfp)) {
 			th->ec->tag = th->ec->tag->prev;
 		    }
-		    rb_vm_pop_frame(th);
+		    rb_vm_pop_frame(th->ec);
 		}
 		TH_JUMP_TAG(th, state);
 	    }

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

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