skip useless OP_MOVE in peephole optimization

This commit is contained in:
Yukihiro Matsumoto
2012-10-23 14:14:26 +09:00
parent 413528ce80
commit 09376f9b2a
+4
View File
@@ -170,6 +170,10 @@ genop_peep(codegen_scope *s, mrb_code i, int val)
switch (c1) {
case OP_MOVE:
if (GETARG_A(i) == GETARG_B(i)) {
/* skip useless OP_MOVE */
return;
}
if (val) break;
switch (c0) {
case OP_MOVE: