summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vm_core.h2
-rw-r--r--vm_eval.c10
-rw-r--r--vm_insnhelper.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/vm_core.h b/vm_core.h
index 41b91aff5a..2140778ade 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -771,6 +771,7 @@ typedef struct rb_execution_context_struct {
VALUE errinfo;
VALUE passed_block_handler; /* for rb_iterate */
const rb_callable_method_entry_t *passed_bmethod_me; /* for bmethod */
+ enum method_missing_reason method_missing_reason;
/* for GC */
struct {
@@ -852,7 +853,6 @@ typedef struct rb_thread_struct {
rb_jmpbuf_t root_jmpbuf;
/* misc */
- enum method_missing_reason method_missing_reason: 8;
unsigned int abort_on_exception: 1;
unsigned int report_on_exception: 1;
#ifdef USE_SIGALTSTACK
diff --git a/vm_eval.c b/vm_eval.c
index b11c01a1e3..7b2415edd2 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -373,7 +373,7 @@ check_funcall_missing(rb_execution_context_t *ec, VALUE klass, VALUE recv, ID mi
new_args[0] = ID2SYM(mid);
MEMCPY(new_args+1, argv, VALUE, argc);
- rb_ec_thread_ptr(ec)->method_missing_reason = MISSING_NOENTRY;
+ ec->method_missing_reason = MISSING_NOENTRY;
args.th = rb_ec_thread_ptr(ec);
args.recv = recv;
args.me = me;
@@ -630,8 +630,8 @@ NORETURN(static void raise_method_missing(rb_execution_context_t *ec, int argc,
static VALUE
rb_method_missing(int argc, const VALUE *argv, VALUE obj)
{
- rb_thread_t *th = GET_THREAD();
- raise_method_missing(th->ec, argc, argv, obj, th->method_missing_reason);
+ rb_execution_context_t *ec = GET_EC();
+ raise_method_missing(ec, argc, argv, obj, ec->method_missing_reason);
UNREACHABLE;
}
@@ -711,7 +711,7 @@ method_missing(VALUE obj, ID id, int argc, const VALUE *argv, enum method_missin
VALUE block_handler = vm_passed_block_handler(ec);
const rb_callable_method_entry_t *me;
- rb_ec_thread_ptr(ec)->method_missing_reason = call_status;
+ ec->method_missing_reason = call_status;
if (id == idMethodMissing) {
missing:
@@ -905,7 +905,7 @@ send_internal(int argc, const VALUE *argv, VALUE recv, call_type scope)
}
}
id = idMethodMissing;
- rb_ec_thread_ptr(ec)->method_missing_reason = MISSING_NOENTRY;
+ ec->method_missing_reason = MISSING_NOENTRY;
}
else {
argv++; argc--;
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 1cb1e5664f..0cc43af303 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -2037,7 +2037,7 @@ vm_call_opt_send(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, struct
}
TOPN(i) = rb_str_intern(sym);
ci->mid = idMethodMissing;
- rb_ec_thread_ptr(ec)->method_missing_reason = cc->aux.method_missing_reason = ci_missing_reason(ci);
+ ec->method_missing_reason = cc->aux.method_missing_reason = ci_missing_reason(ci);
}
else {
/* shift arguments */
@@ -2104,7 +2104,7 @@ vm_call_method_missing(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp,
argv[0] = ID2SYM(orig_ci->mid);
INC_SP(1);
- rb_ec_thread_ptr(ec)->method_missing_reason = orig_cc->aux.method_missing_reason;
+ ec->method_missing_reason = orig_cc->aux.method_missing_reason;
return vm_call_method(ec, reg_cfp, calling, ci, cc);
}