From 5486e94c1ad7342d7a892631cc8e7ff33a022ae8 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 12 Jun 2016 00:39:41 +0300 Subject: Issue #27140: Added BUILD_CONST_KEY_MAP opcode. --- Lib/opcode.py | 1 + 1 file changed, 1 insertion(+) (limited to 'Lib/opcode.py') diff --git a/Lib/opcode.py b/Lib/opcode.py index ecc24bb165..2303407923 100644 --- a/Lib/opcode.py +++ b/Lib/opcode.py @@ -213,5 +213,6 @@ def_op('BUILD_TUPLE_UNPACK', 152) def_op('BUILD_SET_UNPACK', 153) def_op('FORMAT_VALUE', 155) +def_op('BUILD_CONST_KEY_MAP', 156) del def_op, name_op, jrel_op, jabs_op -- cgit v1.2.1 From fa60de800763bc0f7b70d67ca749fce15d2d53de Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 12 Jun 2016 17:36:24 +0300 Subject: Issue #27095: Simplified MAKE_FUNCTION and removed MAKE_CLOSURE opcodes. Patch by Demur Rumed. --- Lib/opcode.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Lib/opcode.py') diff --git a/Lib/opcode.py b/Lib/opcode.py index 2303407923..064081981d 100644 --- a/Lib/opcode.py +++ b/Lib/opcode.py @@ -173,9 +173,8 @@ haslocal.append(126) def_op('RAISE_VARARGS', 130) # Number of raise arguments (1, 2, or 3) def_op('CALL_FUNCTION', 131) # #args + (#kwargs << 8) hasnargs.append(131) -def_op('MAKE_FUNCTION', 132) # Number of args with default values +def_op('MAKE_FUNCTION', 132) # Flags def_op('BUILD_SLICE', 133) # Number of items -def_op('MAKE_CLOSURE', 134) def_op('LOAD_CLOSURE', 135) hasfree.append(135) def_op('LOAD_DEREF', 136) -- cgit v1.2.1 From 0c3c0375111bde5f7586e6c951f08a0035039a39 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Tue, 6 Sep 2016 22:07:53 +0300 Subject: Issue #27078: Added BUILD_STRING opcode. Optimized f-strings evaluation. --- Lib/opcode.py | 1 + 1 file changed, 1 insertion(+) (limited to 'Lib/opcode.py') diff --git a/Lib/opcode.py b/Lib/opcode.py index 064081981d..d9202e8353 100644 --- a/Lib/opcode.py +++ b/Lib/opcode.py @@ -213,5 +213,6 @@ def_op('BUILD_SET_UNPACK', 153) def_op('FORMAT_VALUE', 155) def_op('BUILD_CONST_KEY_MAP', 156) +def_op('BUILD_STRING', 157) del def_op, name_op, jrel_op, jabs_op -- cgit v1.2.1 From b164476aaf77ceffac36ddbbdc7f4df90fbfebd3 Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Thu, 8 Sep 2016 20:50:03 -0700 Subject: Issue #27985: Implement PEP 526 -- Syntax for Variable Annotations. Patch by Ivan Levkivskyi. --- Lib/opcode.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Lib/opcode.py') diff --git a/Lib/opcode.py b/Lib/opcode.py index d9202e8353..31d15345e9 100644 --- a/Lib/opcode.py +++ b/Lib/opcode.py @@ -119,7 +119,7 @@ def_op('WITH_CLEANUP_FINISH', 82) def_op('RETURN_VALUE', 83) def_op('IMPORT_STAR', 84) - +def_op('SETUP_ANNOTATIONS', 85) def_op('YIELD_VALUE', 86) def_op('POP_BLOCK', 87) def_op('END_FINALLY', 88) @@ -169,6 +169,7 @@ def_op('STORE_FAST', 125) # Local variable number haslocal.append(125) def_op('DELETE_FAST', 126) # Local variable number haslocal.append(126) +name_op('STORE_ANNOTATION', 127) # Index in name list def_op('RAISE_VARARGS', 130) # Number of raise arguments (1, 2, or 3) def_op('CALL_FUNCTION', 131) # #args + (#kwargs << 8) -- cgit v1.2.1 From 2b5865ab2c78d3bdaf8ad7047762b5d0d41d8654 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 9 Sep 2016 10:17:08 -0700 Subject: Rework CALL_FUNCTION* opcodes Issue #27213: Rework CALL_FUNCTION* opcodes to produce shorter and more efficient bytecode: * CALL_FUNCTION now only accepts position arguments * CALL_FUNCTION_KW accepts position arguments and keyword arguments, but keys of keyword arguments are packed into a constant tuple. * CALL_FUNCTION_EX is the most generic, it expects a tuple and a dict for positional and keyword arguments. CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW opcodes have been removed. 2 tests of test_traceback are currently broken: skip test, the issue #28050 was created to track the issue. Patch by Demur Rumed, design by Serhiy Storchaka, reviewed by Serhiy Storchaka and Victor Stinner. --- Lib/opcode.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'Lib/opcode.py') diff --git a/Lib/opcode.py b/Lib/opcode.py index 31d15345e9..be2647502e 100644 --- a/Lib/opcode.py +++ b/Lib/opcode.py @@ -31,7 +31,7 @@ hasjabs = [] haslocal = [] hascompare = [] hasfree = [] -hasnargs = [] +hasnargs = [] # unused opmap = {} opname = ['<%r>' % (op,) for op in range(256)] @@ -172,8 +172,7 @@ haslocal.append(126) name_op('STORE_ANNOTATION', 127) # Index in name list def_op('RAISE_VARARGS', 130) # Number of raise arguments (1, 2, or 3) -def_op('CALL_FUNCTION', 131) # #args + (#kwargs << 8) -hasnargs.append(131) +def_op('CALL_FUNCTION', 131) # #args def_op('MAKE_FUNCTION', 132) # Flags def_op('BUILD_SLICE', 133) # Number of items def_op('LOAD_CLOSURE', 135) @@ -185,12 +184,8 @@ hasfree.append(137) def_op('DELETE_DEREF', 138) hasfree.append(138) -def_op('CALL_FUNCTION_VAR', 140) # #args + (#kwargs << 8) -hasnargs.append(140) -def_op('CALL_FUNCTION_KW', 141) # #args + (#kwargs << 8) -hasnargs.append(141) -def_op('CALL_FUNCTION_VAR_KW', 142) # #args + (#kwargs << 8) -hasnargs.append(142) +def_op('CALL_FUNCTION_KW', 141) # #args + #kwargs +def_op('CALL_FUNCTION_EX', 142) # Flags jrel_op('SETUP_WITH', 143) -- cgit v1.2.1 From a9d40323166c43221f8a4f57170cb057f95ad2dc Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 2 Oct 2016 10:33:46 +0300 Subject: Issue #28257: Improved error message when pass a non-iterable as a var-positional argument. Added opcode BUILD_TUPLE_UNPACK_WITH_CALL. --- Lib/opcode.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Lib/opcode.py') diff --git a/Lib/opcode.py b/Lib/opcode.py index be2647502e..b5916b6619 100644 --- a/Lib/opcode.py +++ b/Lib/opcode.py @@ -196,8 +196,6 @@ def_op('MAP_ADD', 147) def_op('LOAD_CLASSDEREF', 148) hasfree.append(148) -jrel_op('SETUP_ASYNC_WITH', 154) - def_op('EXTENDED_ARG', 144) EXTENDED_ARG = 144 @@ -207,8 +205,11 @@ def_op('BUILD_MAP_UNPACK_WITH_CALL', 151) def_op('BUILD_TUPLE_UNPACK', 152) def_op('BUILD_SET_UNPACK', 153) +jrel_op('SETUP_ASYNC_WITH', 154) + def_op('FORMAT_VALUE', 155) def_op('BUILD_CONST_KEY_MAP', 156) def_op('BUILD_STRING', 157) +def_op('BUILD_TUPLE_UNPACK_WITH_CALL', 158) del def_op, name_op, jrel_op, jabs_op -- cgit v1.2.1