diff options
Diffstat (limited to 'py/showbc.c')
-rw-r--r-- | py/showbc.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/py/showbc.c b/py/showbc.c index 684d9af0c0..0bccf8427f 100644 --- a/py/showbc.c +++ b/py/showbc.c @@ -82,7 +82,6 @@ const mp_uint_t *mp_showbc_const_table; void mp_bytecode_print(const void *descr, const byte *ip, mp_uint_t len, const mp_uint_t *const_table) { mp_showbc_code_start = ip; - mp_showbc_const_table = const_table; // get bytecode parameters mp_uint_t n_state = mp_decode_uint(&ip); @@ -159,7 +158,7 @@ void mp_bytecode_print(const void *descr, const byte *ip, mp_uint_t len, const m printf(" bc=" INT_FMT " line=" UINT_FMT "\n", bc, source_line); } } - mp_bytecode_print2(ip, len - 0); + mp_bytecode_print2(ip, len - 0, const_table); } const byte *mp_bytecode_print_str(const byte *ip) { @@ -246,6 +245,11 @@ const byte *mp_bytecode_print_str(const byte *ip) { printf("LOAD_METHOD %s", qstr_str(qst)); break; + case MP_BC_LOAD_SUPER_METHOD: + DECODE_QSTR; + printf("LOAD_SUPER_METHOD %s", qstr_str(qst)); + break; + case MP_BC_LOAD_BUILD_CLASS: printf("LOAD_BUILD_CLASS"); break; @@ -388,6 +392,10 @@ const byte *mp_bytecode_print_str(const byte *ip) { printf("GET_ITER"); break; + case MP_BC_GET_ITER_STACK: + printf("GET_ITER_STACK"); + break; + case MP_BC_FOR_ITER: DECODE_ULABEL; // the jump offset if iteration finishes; for labels are always forward printf("FOR_ITER " UINT_FMT, (mp_uint_t)(ip + unum - mp_showbc_code_start)); @@ -547,8 +555,9 @@ const byte *mp_bytecode_print_str(const byte *ip) { return ip; } -void mp_bytecode_print2(const byte *ip, mp_uint_t len) { +void mp_bytecode_print2(const byte *ip, size_t len, const mp_uint_t *const_table) { mp_showbc_code_start = ip; + mp_showbc_const_table = const_table; while (ip < len + mp_showbc_code_start) { printf("%02u ", (uint)(ip - mp_showbc_code_start)); ip = mp_bytecode_print_str(ip); |