Skip to content

Commit

Permalink
Simplify code since OP_EXEC never takes CFUNC Proc; #3678
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed May 31, 2017
1 parent ff7df93 commit eb69eeb
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions src/vm.c
Expand Up @@ -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) {
Expand Down

0 comments on commit eb69eeb

Please sign in to comment.