diff options
author | Damien George <damien.p.george@gmail.com> | 2016-09-19 08:46:01 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-09-19 12:28:03 +1000 |
commit | adaf0d865cd6c81fb352751566460506392ed55f (patch) | |
tree | 0a944ff133a34b0f9ee4c6411144b049fd0ebf52 /py/showbc.c | |
parent | a5624bf3818c573611b2b7bfc755e27de97f64e4 (diff) |
py: Combine 3 comprehension opcodes (list/dict/set) into 1.
With the previous patch combining 3 emit functions into 1, it now makes
sense to also combine the corresponding VM opcodes, which is what this
patch does. This eliminates 2 opcodes which simplifies the VM and reduces
code size, in bytes: bare-arm:44, minimal:64, unix(NDEBUG,x86-64):272,
stmhal:92, esp8266:200. Profiling (with a simple script that creates many
list/dict/set comprehensions) shows no measurable change in performance.
Diffstat (limited to 'py/showbc.c')
-rw-r--r-- | py/showbc.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/py/showbc.c b/py/showbc.c index dd5959f4a..0f335ffef 100644 --- a/py/showbc.c +++ b/py/showbc.c @@ -409,11 +409,6 @@ const byte *mp_bytecode_print_str(const byte *ip) { printf("BUILD_LIST " UINT_FMT, unum); break; - case MP_BC_LIST_APPEND: - DECODE_UINT; - printf("LIST_APPEND " UINT_FMT, unum); - break; - case MP_BC_BUILD_MAP: DECODE_UINT; printf("BUILD_MAP " UINT_FMT, unum); @@ -423,21 +418,11 @@ const byte *mp_bytecode_print_str(const byte *ip) { printf("STORE_MAP"); break; - case MP_BC_MAP_ADD: - DECODE_UINT; - printf("MAP_ADD " UINT_FMT, unum); - break; - case MP_BC_BUILD_SET: DECODE_UINT; printf("BUILD_SET " UINT_FMT, unum); break; - case MP_BC_SET_ADD: - DECODE_UINT; - printf("SET_ADD " UINT_FMT, unum); - break; - #if MICROPY_PY_BUILTINS_SLICE case MP_BC_BUILD_SLICE: DECODE_UINT; @@ -445,6 +430,11 @@ const byte *mp_bytecode_print_str(const byte *ip) { break; #endif + case MP_BC_STORE_COMP: + DECODE_UINT; + printf("STORE_COMP " UINT_FMT, unum); + break; + case MP_BC_UNPACK_SEQUENCE: DECODE_UINT; printf("UNPACK_SEQUENCE " UINT_FMT, unum); |