remove ci->nreg initialization from cipush()

parent 296b0571
...@@ -227,7 +227,6 @@ cipush(mrb_state *mrb) ...@@ -227,7 +227,6 @@ cipush(mrb_state *mrb)
c->ciend = c->cibase + size * 2; c->ciend = c->cibase + size * 2;
} }
ci = ++c->ci; ci = ++c->ci;
ci->nregs = 2; /* protect method_missing arg and block */
ci->eidx = eidx; ci->eidx = eidx;
ci->ridx = ridx; ci->ridx = ridx;
ci->env = 0; ci->env = 0;
...@@ -468,6 +467,7 @@ mrb_f_send(mrb_state *mrb, mrb_value self) ...@@ -468,6 +467,7 @@ mrb_f_send(mrb_state *mrb, mrb_value self)
ci->nregs = p->body.irep->nregs; ci->nregs = p->body.irep->nregs;
ci = cipush(mrb); ci = cipush(mrb);
ci->nregs = 0;
ci->target_class = 0; ci->target_class = 0;
ci->pc = p->body.irep->iseq; ci->pc = p->body.irep->iseq;
ci->stackent = mrb->c->stack; ci->stackent = mrb->c->stack;
...@@ -497,6 +497,7 @@ eval_under(mrb_state *mrb, mrb_value self, mrb_value blk, struct RClass *c) ...@@ -497,6 +497,7 @@ eval_under(mrb_state *mrb, mrb_value self, mrb_value blk, struct RClass *c)
} }
ci->nregs = p->body.irep->nregs; ci->nregs = p->body.irep->nregs;
ci = cipush(mrb); ci = cipush(mrb);
ci->nregs = 0;
ci->target_class = 0; ci->target_class = 0;
ci->pc = p->body.irep->iseq; ci->pc = p->body.irep->iseq;
ci->stackent = mrb->c->stack; ci->stackent = mrb->c->stack;
...@@ -1249,6 +1250,7 @@ RETRY_TRY_BLOCK: ...@@ -1249,6 +1250,7 @@ RETRY_TRY_BLOCK:
mrb->c->stack[0] = recv; mrb->c->stack[0] = recv;
if (MRB_PROC_CFUNC_P(m)) { if (MRB_PROC_CFUNC_P(m)) {
ci->nregs = 0;
mrb->c->stack[0] = m->body.func(mrb, recv); mrb->c->stack[0] = m->body.func(mrb, recv);
mrb_gc_arena_restore(mrb, ai); mrb_gc_arena_restore(mrb, ai);
if (mrb->exc) goto L_RAISE; if (mrb->exc) goto L_RAISE;
...@@ -2254,6 +2256,7 @@ RETRY_TRY_BLOCK: ...@@ -2254,6 +2256,7 @@ RETRY_TRY_BLOCK:
ci->proc = p; ci->proc = p;
if (MRB_PROC_CFUNC_P(p)) { if (MRB_PROC_CFUNC_P(p)) {
ci->nregs = 0;
mrb->c->stack[0] = p->body.func(mrb, recv); mrb->c->stack[0] = p->body.func(mrb, recv);
mrb_gc_arena_restore(mrb, ai); mrb_gc_arena_restore(mrb, ai);
if (mrb->exc) goto L_RAISE; if (mrb->exc) goto L_RAISE;
...@@ -2383,6 +2386,7 @@ mrb_toplevel_run_keep(mrb_state *mrb, struct RProc *proc, unsigned int stack_kee ...@@ -2383,6 +2386,7 @@ mrb_toplevel_run_keep(mrb_state *mrb, struct RProc *proc, unsigned int stack_kee
return mrb_context_run(mrb, proc, mrb_top_self(mrb), stack_keep); return mrb_context_run(mrb, proc, mrb_top_self(mrb), stack_keep);
} }
ci = cipush(mrb); ci = cipush(mrb);
ci->nregs = 1; /* protect the receiver */
ci->acc = CI_ACC_SKIP; ci->acc = CI_ACC_SKIP;
ci->target_class = mrb->object_class; ci->target_class = mrb->object_class;
v = mrb_context_run(mrb, proc, mrb_top_self(mrb), stack_keep); v = mrb_context_run(mrb, proc, mrb_top_self(mrb), stack_keep);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment