mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 09:50:15 +01:00
py/bc: Remove unused mp_opcode_format function.
This was made redundant by f2040bfc7e, which
also did not update this function for the change to qstr-opcode encoding,
so it does not work correctly anyway.
Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -326,30 +326,6 @@ def mp_small_int_fits(i):
|
||||
return -0x2000 <= i <= 0x1FFF
|
||||
|
||||
|
||||
# this function mirrors that in py/bc.c
|
||||
def mp_opcode_format(bytecode, ip, count_var_uint):
|
||||
opcode = bytecode[ip]
|
||||
ip_start = ip
|
||||
f = (0x000003A4 >> (2 * ((opcode) >> 4))) & 3
|
||||
if f == MP_BC_FORMAT_QSTR:
|
||||
ip += 3
|
||||
else:
|
||||
extra_byte = (opcode & MP_BC_MASK_EXTRA_BYTE) == 0
|
||||
ip += 1
|
||||
if f == MP_BC_FORMAT_VAR_UINT:
|
||||
if count_var_uint:
|
||||
while bytecode[ip] & 0x80 != 0:
|
||||
ip += 1
|
||||
ip += 1
|
||||
elif f == MP_BC_FORMAT_OFFSET:
|
||||
if bytecode[ip] & 0x80 == 0:
|
||||
ip += 1
|
||||
else:
|
||||
ip += 2
|
||||
ip += extra_byte
|
||||
return f, ip - ip_start
|
||||
|
||||
|
||||
def mp_opcode_decode(bytecode, ip):
|
||||
opcode = bytecode[ip]
|
||||
ip_start = ip
|
||||
|
||||
Reference in New Issue
Block a user