summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-26 10:55:24 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-26 10:55:24 +0000
commit284d4c08d66d15b299c9b483a80131d73a617af4 (patch)
tree8fc08f2bc61f9b4ac4997e390c4cac1e3be86775
parent9adf6064ce7e5672cd7a91fd597e21917608a0c8 (diff)
vm_pop_frame() accepts `ec` instead of `th`.
* vm_insnhelper.c (vm_pop_frame): accepts `ec` instead of `th`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--eval.c2
-rw-r--r--insns.def2
-rw-r--r--vm.c16
-rw-r--r--vm_args.c2
-rw-r--r--vm_core.h2
-rw-r--r--vm_eval.c2
-rw-r--r--vm_insnhelper.c14
-rw-r--r--vm_trace.c2
8 files changed, 21 insertions, 21 deletions
diff --git a/eval.c b/eval.c
index dbee005e19..9d26bc3afe 100644
--- a/eval.c
+++ b/eval.c
@@ -803,7 +803,7 @@ rb_raise_jump(VALUE mesg, VALUE cause)
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);
diff --git a/insns.def b/insns.def
index 766870af53..c4dbebce14 100644
--- a/insns.def
+++ b/insns.def
@@ -996,7 +996,7 @@ leave
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;
diff --git a/vm.c b/vm.c
index 26031f9550..cbf3ca0606 100644
--- a/vm.c
+++ b/vm.c
@@ -540,7 +540,7 @@ rb_vm_pop_cfunc_frame(void)
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_control_frame_t *cfp)
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, rb_binding_t *bind, int dyncount, const I
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)
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)
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)
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 (*func)(VALUE), VALUE arg,
val = (*func)(arg);
- rb_vm_pop_frame(th);
+ rb_vm_pop_frame(th->ec);
return val;
}
diff --git a/vm_args.c b/vm_args.c
index b37ce65b47..3774cefafc 100644
--- a/vm_args.c
+++ b/vm_args.c
@@ -698,7 +698,7 @@ raise_argument_error(rb_thread_t *th, const rb_iseq_t *iseq, const VALUE exc)
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);
diff --git a/vm_core.h b/vm_core.h
index 2b9766fcb1..ca6f227c11 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -1509,7 +1509,7 @@ 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,
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);
diff --git a/vm_eval.c b/vm_eval.c
index 3cf000fbe9..4a613b556e 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -87,7 +87,7 @@ vm_call0_cfunc_with_frame(rb_thread_t* th, struct rb_calling_info *calling, cons
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);
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index b19047fd22..f3f6d74606 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -271,22 +271,22 @@ rb_vm_push_frame(rb_execution_context_t *ec,
/* 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 *th, rb_control_frame_t *cfp, struct rb_
}
}
- 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, rb_control_frame_t *reg_cfp, struct rb
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,
(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;
}
diff --git a/vm_trace.c b/vm_trace.c
index ef9ccb653c..11a4f34a36 100644
--- a/vm_trace.c
+++ b/vm_trace.c
@@ -352,7 +352,7 @@ rb_threadptr_exec_event_hooks_orig(rb_trace_arg_t *trace_arg, int pop_p)
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);
}