peephole optimization for LOADNIL before STRCAT; ref #3110

This commit is contained in:
Yukihiro "Matz" Matsumoto
2016-02-17 11:03:27 +09:00
parent d8fc09cf92
commit 819c9da8d2
+6
View File
@@ -339,6 +339,12 @@ genop_peep(codegen_scope *s, mrb_code i, int val)
return 0;
}
}
if (c0 == OP_LOADNIL) {
if (GETARG_B(i) == GETARG_A(i0)) {
s->pc--;
return 0;
}
}
break;
case OP_JMPIF:
case OP_JMPNOT: