From adaf0d865cd6c81fb352751566460506392ed55f Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 19 Sep 2016 08:46:01 +1000 Subject: 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. --- py/bc0.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'py/bc0.h') diff --git a/py/bc0.h b/py/bc0.h index b0b7d5c79..5ff9e50a8 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 -- cgit v1.2.3