aboutsummaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-26 08:41:34 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-26 08:41:34 +0000
commit96ff4cd1c5e0709879eab27e3f61b9c4c9260844 (patch)
treea834d26f7142d0c06af11d10f9b6bdac08ab8f55 /eval.c
parentfbf899e0204808fa2a01ade8ca8b69feb1bcc479 (diff)
downloadruby-96ff4cd1c5e0709879eab27e3f61b9c4c9260844.tar.gz
some functions accept `ec` instead of `th`.
* vm.c (vm_make_env_object): accepts `ec`. * vm.c (rb_vm_get_ruby_level_next_cfp): ditto. * vm.c (rb_vm_make_proc): ditto. * vm.c (rb_vm_make_proc_lambda): ditto. * vm_core.h: some macros accept ec instead of th (and make them inline functions): * RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW * RUBY_VM_END_CONTROL_FRAME * RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P * eval.c (frame_func_id): constify for the first parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/eval.c b/eval.c
index a55f2f7b10..dbee005e19 100644
--- a/eval.c
+++ b/eval.c
@@ -1062,7 +1062,7 @@ rb_ensure(VALUE (*b_proc)(ANYARGS), VALUE data1, VALUE (*e_proc)(ANYARGS), VALUE
}
static ID
-frame_func_id(rb_control_frame_t *cfp)
+frame_func_id(const rb_control_frame_t *cfp)
{
const rb_callable_method_entry_t *me = rb_vm_frame_method_entry(cfp);
@@ -1158,13 +1158,13 @@ prev_frame_func(void)
ID
rb_frame_last_func(void)
{
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = th->ec->cfp;
+ const rb_execution_context_t *ec = GET_EC();
+ const rb_control_frame_t *cfp = ec->cfp;
ID mid;
while (!(mid = frame_func_id(cfp)) &&
(cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp),
- !RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp)));
+ !RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(ec, cfp)));
return mid;
}
@@ -1722,10 +1722,10 @@ top_using(VALUE self, VALUE module)
}
static const VALUE *
-errinfo_place(rb_thread_t *th)
+errinfo_place(const rb_thread_t *th)
{
- rb_control_frame_t *cfp = th->ec->cfp;
- rb_control_frame_t *end_cfp = RUBY_VM_END_CONTROL_FRAME(th);
+ const rb_control_frame_t *cfp = th->ec->cfp;
+ const rb_control_frame_t *end_cfp = RUBY_VM_END_CONTROL_FRAME(th->ec);
while (RUBY_VM_VALID_CONTROL_FRAME_P(cfp, end_cfp)) {
if (VM_FRAME_RUBYFRAME_P(cfp)) {