From e92d4e2680716d3e16a264e46394cb6e458699f9 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 7 Nov 2013 03:54:22 +0900 Subject: modified to use irep->reps to reference child ireps. preparation for removing irep array from mrb_state. note that instructions OP_LAMBDA, OP_EXEC and OP_EPUSH are incompatible, and dumped mrb format has changed. --- src/vm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/vm.c') diff --git a/src/vm.c b/src/vm.c index d35ab59f2..be3518e8d 100644 --- a/src/vm.c +++ b/src/vm.c @@ -830,7 +830,7 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int /* Bx ensure_push(SEQ[Bx]) */ struct RProc *p; - p = mrb_closure_new(mrb, mrb->irep[irep->idx+GETARG_Bx(i)]); + p = mrb_closure_new(mrb, irep->reps[GETARG_Bx(i)]); /* push ensure_stack */ if (mrb->c->esize <= mrb->c->ci->eidx) { if (mrb->c->esize == 0) mrb->c->esize = 16; @@ -1967,10 +1967,10 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int int c = GETARG_c(i); if (c & OP_L_CAPTURE) { - p = mrb_closure_new(mrb, mrb->irep[irep->idx+GETARG_b(i)]); + p = mrb_closure_new(mrb, irep->reps[GETARG_b(i)]); } else { - p = mrb_proc_new(mrb, mrb->irep[irep->idx+GETARG_b(i)]); + p = mrb_proc_new(mrb, irep->reps[GETARG_b(i)]); } if (c & OP_L_STRICT) p->flags |= MRB_PROC_STRICT; regs[GETARG_A(i)] = mrb_obj_value(p); @@ -2038,7 +2038,7 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int /* prepare stack */ mrb->c->stack += a; - p = mrb_proc_new(mrb, mrb->irep[irep->idx+GETARG_Bx(i)]); + p = mrb_proc_new(mrb, irep->reps[GETARG_Bx(i)]); p->target_class = ci->target_class; ci->proc = p; -- cgit v1.2.3