diff options
| author | dearblue <[email protected]> | 2020-05-24 00:42:09 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 16:21:32 +0900 |
| commit | 0d7b4deccf445e3edae9239bf40b91cc79e83634 (patch) | |
| tree | cddf29a04b9f6782060112f80c5463b11fd0949a /src/vm.c | |
| parent | f467b02d4598ab64d98727348e8a9c4f04fc9b83 (diff) | |
| download | mruby-0d7b4deccf445e3edae9239bf40b91cc79e83634.tar.gz mruby-0d7b4deccf445e3edae9239bf40b91cc79e83634.zip | |
Removed push/pop instructions for rescue/ensure
`OP_PUSHERR`, `OP_POPERR`, `OP_EPUSH` and `OP_EPOP` are removed.
Diffstat (limited to 'src/vm.c')
| -rw-r--r-- | src/vm.c | 86 |
1 files changed, 0 insertions, 86 deletions
@@ -1231,29 +1231,6 @@ RETRY_TRY_BLOCK: NEXT; } - CASE(OP_ONERR, S) { - /* check rescue stack */ - if (mrb->c->ci->ridx == UINT16_MAX-1) { - mrb_value exc = mrb_exc_new_str_lit(mrb, E_RUNTIME_ERROR, "too many nested rescues"); - mrb_exc_set(mrb, exc); - goto L_RAISE; - } - /* expand rescue stack */ - if (mrb->c->rsize <= mrb->c->ci->ridx) { - if (mrb->c->rsize == 0) mrb->c->rsize = RESCUE_STACK_INIT_SIZE; - else { - mrb->c->rsize *= 2; - if (mrb->c->rsize <= mrb->c->ci->ridx) { - mrb->c->rsize = UINT16_MAX; - } - } - mrb->c->rescue = (uint16_t*)mrb_realloc(mrb, mrb->c->rescue, sizeof(uint16_t)*mrb->c->rsize); - } - /* push rescue stack */ - mrb->c->rescue[mrb->c->ci->ridx++] = a; - NEXT; - } - CASE(OP_EXCEPT, B) { mrb_value exc; @@ -1300,11 +1277,6 @@ RETRY_TRY_BLOCK: NEXT; } - CASE(OP_POPERR, B) { - mrb->c->ci->ridx -= a; - NEXT; - } - CASE(OP_RAISEIF, B) { mrb_value exc = regs[a]; if (mrb_break_p(exc)) { @@ -1318,64 +1290,6 @@ RETRY_TRY_BLOCK: NEXT; } - CASE(OP_EPUSH, B) { - struct RProc *p; - - p = mrb_closure_new(mrb, irep->reps[a]); - /* check ensure stack */ - if (mrb->c->eidx == UINT16_MAX-1) { - mrb_value exc = mrb_exc_new_str_lit(mrb, E_RUNTIME_ERROR, "too many nested ensures"); - mrb_exc_set(mrb, exc); - goto L_RAISE; - } - /* expand ensure stack */ - if (mrb->c->esize <= mrb->c->eidx+1) { - if (mrb->c->esize == 0) mrb->c->esize = ENSURE_STACK_INIT_SIZE; - else { - mrb->c->esize *= 2; - if (mrb->c->esize <= mrb->c->eidx) { - mrb->c->esize = UINT16_MAX; - } - } - mrb->c->ensure = (struct RProc**)mrb_realloc(mrb, mrb->c->ensure, sizeof(struct RProc*)*mrb->c->esize); - } - /* push ensure stack */ - mrb->c->ensure[mrb->c->eidx++] = p; - mrb->c->ensure[mrb->c->eidx] = NULL; - mrb_gc_arena_restore(mrb, ai); - NEXT; - } - - CASE(OP_EPOP, B) { - mrb_callinfo *ci = mrb->c->ci; - unsigned int n, epos = ci->epos; - mrb_value self = regs[0]; - struct RClass *target_class = ci->target_class; - - if (mrb->c->eidx <= epos) { - NEXT; - } - - if (a > (int)mrb->c->eidx - epos) - a = mrb->c->eidx - epos; - for (n=0; n<a; n++) { - int nregs = irep->nregs; - - proc = mrb->c->ensure[epos+n]; - mrb->c->ensure[epos+n] = NULL; - if (proc == NULL) continue; - irep = proc->body.irep; - ci = cipush(mrb, pc, nregs, nregs, target_class, proc, ci->mid, 0); - mrb_stack_extend(mrb, irep->nregs); - regs[0] = self; - pc = irep->iseq; - } - pool = irep->pool; - syms = irep->syms; - mrb->c->eidx = epos; - JUMP; - } - CASE(OP_SENDV, BB) { c = CALL_MAXARGS; goto L_SEND; |
