peephole optimization for LOADNIL before STRCAT; ref #3110

parent d8fc09cf
...@@ -339,6 +339,12 @@ genop_peep(codegen_scope *s, mrb_code i, int val) ...@@ -339,6 +339,12 @@ genop_peep(codegen_scope *s, mrb_code i, int val)
return 0; return 0;
} }
} }
if (c0 == OP_LOADNIL) {
if (GETARG_B(i) == GETARG_A(i0)) {
s->pc--;
return 0;
}
}
break; break;
case OP_JMPIF: case OP_JMPIF:
case OP_JMPNOT: case OP_JMPNOT:
......
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