aboutsummaryrefslogtreecommitdiff
path: root/py/showbc.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-01-13 23:08:47 +0000
committerDamien George <damien.p.george@gmail.com>2015-01-13 23:08:47 +0000
commitd6ed6702f74a0e14f71f7ad9f995be8fded12ef5 (patch)
treed521077a96161a47de9ab52e1b1f041737157755 /py/showbc.c
parent4c81ba8015238a343593468aa5173440fd392e32 (diff)
py/showbc.c: Handle new LOAD_CONST_OBJ opcode, and opcodes with cache.
Diffstat (limited to 'py/showbc.c')
-rw-r--r--py/showbc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/py/showbc.c b/py/showbc.c
index 67c740fbc..7c55d8cc8 100644
--- a/py/showbc.c
+++ b/py/showbc.c
@@ -183,6 +183,12 @@ const byte *mp_bytecode_print_str(const byte *ip) {
printf("LOAD_CONST_STRING '%s'", qstr_str(qstr));
break;
+ case MP_BC_LOAD_CONST_OBJ:
+ DECODE_PTR;
+ printf("LOAD_CONST_OBJ %p=", (void*)unum);
+ mp_obj_print((mp_obj_t)unum, PRINT_REPR);
+ break;
+
case MP_BC_LOAD_NULL:
printf("LOAD_NULL");
break;
@@ -200,16 +206,25 @@ const byte *mp_bytecode_print_str(const byte *ip) {
case MP_BC_LOAD_NAME:
DECODE_QSTR;
printf("LOAD_NAME %s", qstr_str(qstr));
+ if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) {
+ printf(" (cache=%u)", *ip++);
+ }
break;
case MP_BC_LOAD_GLOBAL:
DECODE_QSTR;
printf("LOAD_GLOBAL %s", qstr_str(qstr));
+ if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) {
+ printf(" (cache=%u)", *ip++);
+ }
break;
case MP_BC_LOAD_ATTR:
DECODE_QSTR;
printf("LOAD_ATTR %s", qstr_str(qstr));
+ if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) {
+ printf(" (cache=%u)", *ip++);
+ }
break;
case MP_BC_LOAD_METHOD:
@@ -248,6 +263,9 @@ const byte *mp_bytecode_print_str(const byte *ip) {
case MP_BC_STORE_ATTR:
DECODE_QSTR;
printf("STORE_ATTR %s", qstr_str(qstr));
+ if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) {
+ printf(" (cache=%u)", *ip++);
+ }
break;
case MP_BC_STORE_SUBSCR: