summaryrefslogtreecommitdiffstatshomepage
path: root/py/bc0.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/bc0.h
parenta5624bf3818c573611b2b7bfc755e27de97f64e4 (diff)
downloadmicropython-adaf0d865cd6c81fb352751566460506392ed55f.tar.gz
micropython-adaf0d865cd6c81fb352751566460506392ed55f.zip
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/bc0.h')
-rw-r--r--py/bc0.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/py/bc0.h b/py/bc0.h
index b0b7d5c795..5ff9e50a89 100644
--- a/py/bc0.h
+++ b/py/bc0.h
@@ -82,13 +82,11 @@
#define MP_BC_BUILD_TUPLE (0x50) // uint
#define MP_BC_BUILD_LIST (0x51) // uint
-#define MP_BC_LIST_APPEND (0x52) // uint
#define MP_BC_BUILD_MAP (0x53) // uint
#define MP_BC_STORE_MAP (0x54)
-#define MP_BC_MAP_ADD (0x55) // uint
#define MP_BC_BUILD_SET (0x56) // uint
-#define MP_BC_SET_ADD (0x57) // uint
#define MP_BC_BUILD_SLICE (0x58) // uint
+#define MP_BC_STORE_COMP (0x57) // uint
#define MP_BC_UNPACK_SEQUENCE (0x59) // uint
#define MP_BC_UNPACK_EX (0x5a) // uint