vm.c (mrb_exec_irep): remove recently added separate_module argument

The argument was added in #6512
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-05-07 23:41:17 +09:00
parent ef0cbc2981
commit 41e91a2ca8
4 changed files with 7 additions and 14 deletions
+1 -1
View File
@@ -199,7 +199,7 @@ void mrb_gc_free_iv(mrb_state*, struct RObject*);
#define MRB_CI_SET_SEPARATE_MODULE(ci) MRB_FLAG_ENABLE((ci)->vis, 2)
mrb_int mrb_ci_bidx(mrb_callinfo *ci);
mrb_int mrb_ci_nregs(mrb_callinfo *ci);
mrb_value mrb_exec_irep(mrb_state *mrb, mrb_value self, const struct RProc *p, mrb_bool separate_module);
mrb_value mrb_exec_irep(mrb_state *mrb, mrb_value self, const struct RProc *p);
mrb_value mrb_obj_instance_eval(mrb_state*, mrb_value);
mrb_value mrb_object_exec(mrb_state *mrb, mrb_value self, struct RClass *target_class);
mrb_value mrb_mod_module_eval(mrb_state*, mrb_value);
+3 -1
View File
@@ -147,9 +147,11 @@ exec_irep(mrb_state *mrb, mrb_value self, struct RProc *proc)
/* no argument passed from eval() */
ci->n = 0;
ci->nk = 0;
/* clear visibility */
MRB_CI_SET_SEPARATE_MODULE(ci);
/* clear block */
ci->stack[1] = mrb_nil_value();
return mrb_exec_irep(mrb, self, proc, TRUE);
return mrb_exec_irep(mrb, self, proc);
}
static void
+1 -1
View File
@@ -248,7 +248,7 @@ mcall(mrb_state *mrb, mrb_value self, mrb_value recv)
mrb->c->ci->mid = mid;
mrb->c->ci->u.target_class = tc;
return mrb_exec_irep(mrb, recv, proc, FALSE);
return mrb_exec_irep(mrb, recv, proc);
}
static mrb_value
+2 -11
View File
@@ -812,13 +812,10 @@ exec_irep(mrb_state *mrb, mrb_value self, const struct RProc *p)
}
mrb_value
mrb_exec_irep(mrb_state *mrb, mrb_value self, const struct RProc *p, mrb_bool separate_module)
mrb_exec_irep(mrb_state *mrb, mrb_value self, const struct RProc *p)
{
mrb_callinfo *ci = mrb->c->ci;
if (ci->cci == CINFO_NONE) {
if (separate_module) {
MRB_CI_SET_SEPARATE_MODULE(ci);
}
return exec_irep(mrb, self, p);
}
else {
@@ -828,9 +825,6 @@ mrb_exec_irep(mrb_state *mrb, mrb_value self, const struct RProc *p, mrb_bool se
check_method_noarg(mrb, ci);
}
ci = cipush(mrb, 0, CINFO_DIRECT, CI_TARGET_CLASS(ci), p, NULL, ci->mid, ci->n|(ci->nk<<4));
if (separate_module) {
MRB_CI_SET_SEPARATE_MODULE(ci);
}
mrb->exc = NULL;
ret = MRB_PROC_CFUNC(p)(mrb, self);
cipop(mrb);
@@ -838,9 +832,6 @@ mrb_exec_irep(mrb_state *mrb, mrb_value self, const struct RProc *p, mrb_bool se
else {
mrb_int keep = ci_bidx(ci) + 1; /* receiver + block */
ci = cipush(mrb, 0, CINFO_SKIP, CI_TARGET_CLASS(ci), p, NULL, ci->mid, ci->n|(ci->nk<<4));
if (separate_module) {
MRB_CI_SET_SEPARATE_MODULE(ci);
}
ret = mrb_vm_run(mrb, p, self, keep);
}
if (mrb->exc && mrb->jmp) {
@@ -864,7 +855,7 @@ mrb_object_exec(mrb_state *mrb, mrb_value self, struct RClass *target_class)
mrb_gc_protect(mrb, blk);
ci->stack[bidx] = mrb_nil_value();
mrb_vm_ci_target_class_set(ci, target_class);
return mrb_exec_irep(mrb, self, mrb_proc_ptr(blk), FALSE);
return mrb_exec_irep(mrb, self, mrb_proc_ptr(blk));
}
static mrb_noreturn void