py: Change jump-if-x-or-pop opcodes to have unsigned offset argument.
These jumps are always forwards, and it's more efficient in the VM to decode an unsigned argument. These opcodes are already optimised versions of the sequence "dup-top pop-jump-if-x pop" so it doesn't hurt generality to optimise them further. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -338,12 +338,12 @@ const byte *mp_bytecode_print_str(const mp_print_t *print, const byte *ip_start,
|
||||
break;
|
||||
|
||||
case MP_BC_JUMP_IF_TRUE_OR_POP:
|
||||
DECODE_SLABEL;
|
||||
DECODE_ULABEL;
|
||||
mp_printf(print, "JUMP_IF_TRUE_OR_POP " UINT_FMT, (mp_uint_t)(ip + unum - ip_start));
|
||||
break;
|
||||
|
||||
case MP_BC_JUMP_IF_FALSE_OR_POP:
|
||||
DECODE_SLABEL;
|
||||
DECODE_ULABEL;
|
||||
mp_printf(print, "JUMP_IF_FALSE_OR_POP " UINT_FMT, (mp_uint_t)(ip + unum - ip_start));
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user