mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Unified pc and err of mrb_callinfo
This enhances self-containment. - Changed the `mrb_callinfo::pc` field to point to itself. Previously it indicated the return destination of the previous call level. `mrb_callinfo::pc` will now hold the address to its own `proc->body.irep->iseq`. - Removed `mrb_callinfo::err` field. This is because `mrb_callinfo::pc - 1` is semantically the same as the previous `err`. - The `pc0` and `pc_save` variables in `mrb_vm_exec()` are no longer needed and have been deleted. - It removes the argument because `cipush()` doesn't need to save the previous `pc`.
This commit is contained in:
@@ -136,6 +136,13 @@ MRB_API mrb_value mrb_proc_cfunc_env_get(mrb_state *mrb, mrb_int idx);
|
||||
|
||||
MRB_API mrb_value mrb_load_proc(mrb_state *mrb, const struct RProc *proc);
|
||||
|
||||
static inline void
|
||||
mrb_vm_ci_proc_set(mrb_callinfo *ci, const struct RProc *p)
|
||||
{
|
||||
ci->proc = p;
|
||||
ci->pc = (p && !MRB_PROC_CFUNC_P(p)) ? p->body.irep->iseq : NULL;
|
||||
}
|
||||
|
||||
static inline struct RClass *
|
||||
mrb_vm_ci_target_class(const mrb_callinfo *ci)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user