aboutsummaryrefslogtreecommitdiffstats
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-07 06:14:00 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-07 06:14:00 +0000
commit76e8dc03d1a4ae7fd706fca86009837f4dd76158 (patch)
tree55fdbe501aa2b0e364c9a2845ef7479e6697ffeb /vm_insnhelper.c
parentbe29a3e1a0f76ba5d3a78ba05a40266c92fd09bd (diff)
downloadruby-76e8dc03d1a4ae7fd706fca86009837f4dd76158.tar.gz
th->ec: vm_once_dispatch.
* vm_insnhelper.c (vm_once_dispatch): accepts `ec`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 102e73feeb..8e7d9f9fe2 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -3260,8 +3260,9 @@ vm_ic_update(IC ic, VALUE val, const VALUE *reg_ep)
}
static VALUE
-vm_once_dispatch(ISEQ iseq, IC ic, rb_thread_t *th)
+vm_once_dispatch(rb_execution_context_t *ec, ISEQ iseq, IC ic)
{
+ rb_thread_t *th = rb_ec_thread_ptr(ec);
rb_thread_t *const RUNNING_THREAD_ONCE_DONE = (rb_thread_t *)(0x1);
union iseq_inline_storage_entry *const is = (union iseq_inline_storage_entry *)ic;
@@ -3275,7 +3276,7 @@ vm_once_dispatch(ISEQ iseq, IC ic, rb_thread_t *th)
val = is->once.value = rb_ensure(vm_once_exec, (VALUE)iseq, vm_once_clear, (VALUE)is);
/* is->once.running_thread is cleared by vm_once_clear() */
is->once.running_thread = RUNNING_THREAD_ONCE_DONE; /* success */
- rb_iseq_add_mark_object(th->ec->cfp->iseq, val);
+ rb_iseq_add_mark_object(ec->cfp->iseq, val);
return val;
}
else if (is->once.running_thread == th) {
@@ -3284,7 +3285,7 @@ vm_once_dispatch(ISEQ iseq, IC ic, rb_thread_t *th)
}
else {
/* waiting for finish */
- RUBY_VM_CHECK_INTS(th->ec);
+ RUBY_VM_CHECK_INTS(ec);
rb_thread_schedule();
goto again;
}