aboutsummaryrefslogtreecommitdiffstats
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-27 01:35:12 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-27 01:35:12 +0000
commitf551177a93bab89fd3a302b22b76394fa53e7d26 (patch)
treedaf6931c5bffb46d11f8e0cf81c1a9d74ce98208 /vm_insnhelper.c
parentb3bd21b90b6edf7b0e2d37ad760d6049e8fdaac2 (diff)
downloadruby-f551177a93bab89fd3a302b22b76394fa53e7d26.tar.gz
vm_throw* accept `ec` instead of `th`.
* vm_insnhelper.c (vm_throw*): accept `ec` instead of `th`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 6d1b13b807..5ba1de2f27 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1046,31 +1046,31 @@ vm_setinstancevariable(VALUE obj, ID id, VALUE val, IC ic)
}
static VALUE
-vm_throw_continue(rb_thread_t *th, VALUE err)
+vm_throw_continue(const rb_execution_context_t *ec, VALUE err)
{
/* continue throw */
if (FIXNUM_P(err)) {
- th->ec->tag->state = FIX2INT(err);
+ ec->tag->state = FIX2INT(err);
}
else if (SYMBOL_P(err)) {
- th->ec->tag->state = TAG_THROW;
+ ec->tag->state = TAG_THROW;
}
else if (THROW_DATA_P(err)) {
- th->ec->tag->state = THROW_DATA_STATE((struct vm_throw_data *)err);
+ ec->tag->state = THROW_DATA_STATE((struct vm_throw_data *)err);
}
else {
- th->ec->tag->state = TAG_RAISE;
+ ec->tag->state = TAG_RAISE;
}
return err;
}
static VALUE
-vm_throw_start(rb_thread_t *const th, rb_control_frame_t *const reg_cfp, enum ruby_tag_type state,
+vm_throw_start(const rb_execution_context_t *ec, rb_control_frame_t *const reg_cfp, enum ruby_tag_type state,
const int flag, const rb_num_t level, const VALUE throwobj)
{
const rb_control_frame_t *escape_cfp = NULL;
- 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 */
if (flag != 0) {
/* do nothing */
@@ -1090,7 +1090,7 @@ vm_throw_start(rb_thread_t *const th, rb_control_frame_t *const reg_cfp, enum ru
else {
ep = VM_ENV_PREV_EP(ep);
base_iseq = base_iseq->body->parent_iseq;
- escape_cfp = rb_vm_search_cf_from_ep(th->ec, escape_cfp, ep);
+ escape_cfp = rb_vm_search_cf_from_ep(ec, escape_cfp, ep);
VM_ASSERT(escape_cfp->iseq == base_iseq);
}
}
@@ -1142,7 +1142,7 @@ vm_throw_start(rb_thread_t *const th, rb_control_frame_t *const reg_cfp, enum ru
ep = VM_ENV_PREV_EP(ep);
}
- escape_cfp = rb_vm_search_cf_from_ep(th->ec, reg_cfp, ep);
+ escape_cfp = rb_vm_search_cf_from_ep(ec, reg_cfp, ep);
}
else if (state == TAG_RETURN) {
const VALUE *current_ep = GET_EP();
@@ -1215,12 +1215,12 @@ vm_throw_start(rb_thread_t *const th, rb_control_frame_t *const reg_cfp, enum ru
rb_bug("isns(throw): unsupport throw type");
}
- th->ec->tag->state = state;
+ ec->tag->state = state;
return (VALUE)THROW_DATA_NEW(throwobj, escape_cfp, state);
}
static VALUE
-vm_throw(rb_thread_t *th, rb_control_frame_t *reg_cfp,
+vm_throw(const rb_execution_context_t *ec, rb_control_frame_t *reg_cfp,
rb_num_t throw_state, VALUE throwobj)
{
const int state = (int)(throw_state & VM_THROW_STATE_MASK);
@@ -1228,10 +1228,10 @@ vm_throw(rb_thread_t *th, rb_control_frame_t *reg_cfp,
const rb_num_t level = throw_state >> VM_THROW_LEVEL_SHIFT;
if (state != 0) {
- return vm_throw_start(th, reg_cfp, state, flag, level, throwobj);
+ return vm_throw_start(ec, reg_cfp, state, flag, level, throwobj);
}
else {
- return vm_throw_continue(th, throwobj);
+ return vm_throw_continue(ec, throwobj);
}
}