refactor genop_peep(); ref #1505

parent e7082a50
......@@ -277,16 +277,6 @@ genop_peep(codegen_scope *s, mrb_code i, int val)
case OP_MOVE:
s->iseq[s->pc-1] = MKOP_AB(OP_RETURN, GETARG_B(i0), OP_R_NORMAL);
return;
case OP_LOADI:
genop(s, MKOP_AB(OP_RETURN, GETARG_A(i0), OP_R_NORMAL));
return;
case OP_ARRAY:
case OP_HASH:
case OP_RANGE:
case OP_AREF:
case OP_GETUPVAR:
genop(s, MKOP_AB(OP_RETURN, GETARG_A(i0), OP_R_NORMAL));
return;
case OP_SETIV:
case OP_SETCV:
case OP_SETCONST:
......@@ -298,28 +288,6 @@ genop_peep(codegen_scope *s, mrb_code i, int val)
i0 = s->iseq[s->pc-1];
genop(s, MKOP_AB(OP_RETURN, GETARG_A(i0), OP_R_NORMAL));
return;
case OP_LOADSYM:
case OP_GETGLOBAL:
case OP_GETIV:
case OP_GETCV:
case OP_GETCONST:
case OP_GETSPECIAL:
case OP_LOADL:
case OP_STRING:
s->iseq[s->pc-1] = MKOP_ABx(c0, GETARG_A(i0), GETARG_Bx(i0));
genop(s, MKOP_AB(OP_RETURN, GETARG_A(i0), OP_R_NORMAL));
return;
case OP_SCLASS:
s->iseq[s->pc-1] = MKOP_AB(c0, GETARG_A(i), GETARG_B(i0));
genop(s, MKOP_AB(OP_RETURN, 0, OP_R_NORMAL));
return;
case OP_LOADNIL:
case OP_LOADSELF:
case OP_LOADT:
case OP_LOADF:
case OP_OCLASS:
genop(s, MKOP_AB(OP_RETURN, GETARG_A(i0), OP_R_NORMAL));
return;
#if 0
case OP_SEND:
if (GETARG_B(i) == OP_R_NORMAL && GETARG_A(i) == GETARG_A(i0)) {
......
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