mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
codegen.c: add peephole optimization for OP_LOADI32 before OP_MOVE.
This commit is contained in:
@@ -488,7 +488,7 @@ gen_move(codegen_scope *s, uint16_t dst, uint16_t src, int nopeep)
|
||||
s->pc = s->lastpc;
|
||||
genop_2(s, data.insn, dst, data.b);
|
||||
break;
|
||||
case OP_GETUPVAR:
|
||||
case OP_GETUPVAR: case OP_LOADI32:
|
||||
if (nopeep || data.a != src || data.a < s->nlocals) goto normal;
|
||||
s->pc = s->lastpc;
|
||||
genop_3(s, data.insn, dst, data.b, data.c);
|
||||
|
||||
Reference in New Issue
Block a user