aboutsummaryrefslogtreecommitdiff
path: root/py/vmentrytable.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-09-19 08:46:01 +1000
committerDamien George <damien.p.george@gmail.com>2016-09-19 12:28:03 +1000
commitadaf0d865cd6c81fb352751566460506392ed55f (patch)
tree0a944ff133a34b0f9ee4c6411144b049fd0ebf52 /py/vmentrytable.h
parenta5624bf3818c573611b2b7bfc755e27de97f64e4 (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/vmentrytable.h')
-rw-r--r--py/vmentrytable.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/py/vmentrytable.h b/py/vmentrytable.h
index 9df1e40a3..dd30dd7a5 100644
--- a/py/vmentrytable.h
+++ b/py/vmentrytable.h
@@ -78,17 +78,15 @@ static const void *const entry_table[256] = {
[MP_BC_POP_EXCEPT] = &&entry_MP_BC_POP_EXCEPT,
[MP_BC_BUILD_TUPLE] = &&entry_MP_BC_BUILD_TUPLE,
[MP_BC_BUILD_LIST] = &&entry_MP_BC_BUILD_LIST,
- [MP_BC_LIST_APPEND] = &&entry_MP_BC_LIST_APPEND,
[MP_BC_BUILD_MAP] = &&entry_MP_BC_BUILD_MAP,
[MP_BC_STORE_MAP] = &&entry_MP_BC_STORE_MAP,
- [MP_BC_MAP_ADD] = &&entry_MP_BC_MAP_ADD,
#if MICROPY_PY_BUILTINS_SET
[MP_BC_BUILD_SET] = &&entry_MP_BC_BUILD_SET,
- [MP_BC_SET_ADD] = &&entry_MP_BC_SET_ADD,
#endif
#if MICROPY_PY_BUILTINS_SLICE
[MP_BC_BUILD_SLICE] = &&entry_MP_BC_BUILD_SLICE,
#endif
+ [MP_BC_STORE_COMP] = &&entry_MP_BC_STORE_COMP,
[MP_BC_UNPACK_SEQUENCE] = &&entry_MP_BC_UNPACK_SEQUENCE,
[MP_BC_UNPACK_EX] = &&entry_MP_BC_UNPACK_EX,
[MP_BC_MAKE_FUNCTION] = &&entry_MP_BC_MAKE_FUNCTION,