Permalink
Browse files

Simplify code since OP_EXEC never takes CFUNC Proc; #3678

  • Loading branch information...
matz committed May 31, 2017
1 parent ff7df93 commit eb69eebfd701a01292c116ada098a71bb25ee625
Showing with 7 additions and 19 deletions.
  1. +7 −19 src/vm.c
View
@@ -2626,25 +2626,13 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
p->target_class = ci->target_class;
ci->proc = p;
if (MRB_PROC_CFUNC_P(p)) {
ci->nregs = 0;
mrb->c->stack[0] = p->body.func(mrb, recv);
mrb_gc_arena_restore(mrb, ai);
if (mrb->exc) goto L_RAISE;
/* pop stackpos */
mrb->c->stack = mrb->c->ci->stackent;
cipop(mrb);
NEXT;
}
else {
irep = p->body.irep;
pool = irep->pool;
syms = irep->syms;
stack_extend(mrb, irep->nregs);
ci->nregs = irep->nregs;
pc = irep->iseq;
JUMP;
}
irep = p->body.irep;
pool = irep->pool;
syms = irep->syms;
stack_extend(mrb, irep->nregs);
ci->nregs = irep->nregs;
pc = irep->iseq;
JUMP;
}
CASE(OP_METHOD) {

0 comments on commit eb69eeb

Please sign in to comment.