From 28adc9087e963f4b74410d4a8af83d0423358c3f Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Sat, 10 Jun 2023 17:36:52 -0700 Subject: [PATCH 01/10] Replace KW_NAMES with LOAD_CONST/PUSH_NULL --- Doc/library/dis.rst | 9 - Include/internal/pycore_opcode.h | 4 +- Include/opcode.h | 2 - Lib/opcode.py | 3 +- Lib/test/test_compiler_codegen.py | 1 + Lib/test/test_dis.py | 300 ++++++----- Lib/test/test_monitoring.py | 13 +- Lib/test/test_sys.py | 2 +- Objects/frameobject.c | 2 +- Programs/test_frozenmain.h | 66 +-- Python/bytecodes.c | 84 ++-- Python/ceval.c | 2 - Python/compile.c | 23 +- Python/flowgraph.c | 2 - Python/generated_cases.c.h | 798 +++++++++++++++--------------- Python/opcode_metadata.h | 41 +- Python/opcode_targets.h | 2 +- 17 files changed, 687 insertions(+), 667 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 9b90f1ef23d92c..847d414b3018c3 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1370,15 +1370,6 @@ iterations of the loop. .. versionadded:: 3.11 -.. opcode:: KW_NAMES (consti) - - Prefixes :opcode:`CALL`. - Stores a reference to ``co_consts[consti]`` into an internal variable - for use by :opcode:`CALL`. ``co_consts[consti]`` must be a tuple of strings. - - .. versionadded:: 3.11 - - .. opcode:: MAKE_FUNCTION (flags) Pushes a new function object on the stack. From bottom to top, the consumed diff --git a/Include/internal/pycore_opcode.h b/Include/internal/pycore_opcode.h index 450ae8f5da7b29..ded38a969681c3 100644 --- a/Include/internal/pycore_opcode.h +++ b/Include/internal/pycore_opcode.h @@ -154,7 +154,6 @@ const uint8_t _PyOpcode_Deopt[256] = { [JUMP_BACKWARD] = JUMP_BACKWARD, [JUMP_BACKWARD_NO_INTERRUPT] = JUMP_BACKWARD_NO_INTERRUPT, [JUMP_FORWARD] = JUMP_FORWARD, - [KW_NAMES] = KW_NAMES, [LIST_APPEND] = LIST_APPEND, [LIST_EXTEND] = LIST_EXTEND, [LOAD_ASSERTION_ERROR] = LOAD_ASSERTION_ERROR, @@ -417,7 +416,7 @@ static const char *const _PyOpcode_OpName[267] = { [STORE_FAST_LOAD_FAST] = "STORE_FAST_LOAD_FAST", [STORE_FAST_STORE_FAST] = "STORE_FAST_STORE_FAST", [CALL] = "CALL", - [KW_NAMES] = "KW_NAMES", + [172] = "<172>", [CALL_INTRINSIC_1] = "CALL_INTRINSIC_1", [CALL_INTRINSIC_2] = "CALL_INTRINSIC_2", [LOAD_FROM_DICT_OR_GLOBALS] = "LOAD_FROM_DICT_OR_GLOBALS", @@ -520,6 +519,7 @@ static const char *const _PyOpcode_OpName[267] = { case 161: \ case 166: \ case 167: \ + case 172: \ case 177: \ case 178: \ case 179: \ diff --git a/Include/opcode.h b/Include/opcode.h index 7f69fd6d322bd8..31bd08178911f6 100644 --- a/Include/opcode.h +++ b/Include/opcode.h @@ -118,7 +118,6 @@ extern "C" { #define STORE_FAST_LOAD_FAST 169 #define STORE_FAST_STORE_FAST 170 #define CALL 171 -#define KW_NAMES 172 #define CALL_INTRINSIC_1 173 #define CALL_INTRINSIC_2 174 #define LOAD_FROM_DICT_OR_GLOBALS 175 @@ -229,7 +228,6 @@ extern "C" { #define HAS_CONST(op) (false\ || ((op) == LOAD_CONST) \ || ((op) == RETURN_CONST) \ - || ((op) == KW_NAMES) \ ) #define NB_ADD 0 diff --git a/Lib/opcode.py b/Lib/opcode.py index 0c41bef578a223..4ce1c36bcaa6fb 100644 --- a/Lib/opcode.py +++ b/Lib/opcode.py @@ -226,8 +226,7 @@ def pseudo_op(name, op, real_ops): def_op('STORE_FAST_LOAD_FAST', 169) def_op('STORE_FAST_STORE_FAST', 170) def_op('CALL', 171) -def_op('KW_NAMES', 172) -hasconst.append(172) + def_op('CALL_INTRINSIC_1', 173) def_op('CALL_INTRINSIC_2', 174) diff --git a/Lib/test/test_compiler_codegen.py b/Lib/test/test_compiler_codegen.py index ea57df9cd2400b..400aadcf937430 100644 --- a/Lib/test/test_compiler_codegen.py +++ b/Lib/test/test_compiler_codegen.py @@ -43,6 +43,7 @@ def test_for_loop(self): ('PUSH_NULL', None, 2), ('LOAD_NAME', 2, 2), ('LOAD_NAME', 1, 2), + ('PUSH_NULL', None, 2), ('CALL', 1, 2), ('POP_TOP', None), ('JUMP', loop_lbl), diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index cb35175d206902..62861afea0b048 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -104,6 +104,7 @@ def _f(a): %3d LOAD_GLOBAL 1 (NULL + print) LOAD_FAST 0 (a) + PUSH_NULL CALL 1 POP_TOP @@ -117,6 +118,7 @@ def _f(a): RESUME 0 LOAD_GLOBAL 1 LOAD_FAST 0 + PUSH_NULL CALL 1 POP_TOP RETURN_CONST 1 @@ -136,12 +138,13 @@ def bug708901(): %3d LOAD_CONST 2 (10) -%3d CALL 2 +%3d PUSH_NULL + CALL 2 GET_ITER - >> FOR_ITER 3 (to 36) + >> FOR_ITER 3 (to 38) STORE_FAST 0 (res) -%3d JUMP_BACKWARD 5 (to 26) +%3d JUMP_BACKWARD 5 (to 28) %3d >> END_FOR RETURN_CONST 0 (None) @@ -166,11 +169,13 @@ def bug1333982(x=[]): MAKE_FUNCTION 0 LOAD_FAST 0 (x) GET_ITER + PUSH_NULL CALL 0 %3d LOAD_CONST 2 (1) %3d BINARY_OP 0 (+) + PUSH_NULL CALL 0 RAISE_VARARGS 1 """ % (bug1333982.__code__.co_firstlineno, @@ -240,7 +245,7 @@ def wrap_func_w_kwargs(): LOAD_CONST 1 (1) LOAD_CONST 2 (2) LOAD_CONST 3 (5) - KW_NAMES 4 (('c',)) + LOAD_CONST 4 (('c',)) CALL 3 POP_TOP RETURN_CONST 0 (None) @@ -348,6 +353,7 @@ def wrap_func_w_kwargs(): 3 PUSH_NULL LOAD_NAME 3 (fun) LOAD_CONST 0 (1) + PUSH_NULL CALL 1 LOAD_NAME 2 (__annotations__) LOAD_CONST 2 ('y') @@ -358,6 +364,7 @@ def wrap_func_w_kwargs(): PUSH_NULL LOAD_NAME 3 (fun) LOAD_CONST 3 (0) + PUSH_NULL CALL 1 STORE_SUBSCR LOAD_NAME 1 (int) @@ -477,6 +484,7 @@ def _with(c): %3d LOAD_CONST 0 (None) LOAD_CONST 0 (None) LOAD_CONST 0 (None) + PUSH_NULL CALL 2 POP_TOP @@ -486,7 +494,7 @@ def _with(c): %3d >> PUSH_EXC_INFO WITH_EXCEPT_START - POP_JUMP_IF_TRUE 1 (to 42) + POP_JUMP_IF_TRUE 1 (to 44) RERAISE 2 >> POP_TOP POP_EXCEPT @@ -537,13 +545,14 @@ async def _asyncwith(c): %3d LOAD_CONST 0 (None) LOAD_CONST 0 (None) LOAD_CONST 0 (None) + PUSH_NULL CALL 2 GET_AWAITABLE 2 LOAD_CONST 0 (None) - >> SEND 3 (to 60) + >> SEND 3 (to 62) YIELD_VALUE 2 RESUME 3 - JUMP_BACKWARD_NO_INTERRUPT 5 (to 50) + JUMP_BACKWARD_NO_INTERRUPT 5 (to 52) >> END_SEND POP_TOP @@ -552,20 +561,20 @@ async def _asyncwith(c): RETURN_CONST 0 (None) %3d >> CLEANUP_THROW - JUMP_BACKWARD 26 (to 24) + JUMP_BACKWARD 27 (to 24) >> CLEANUP_THROW - JUMP_BACKWARD 11 (to 60) + JUMP_BACKWARD 11 (to 62) >> PUSH_EXC_INFO WITH_EXCEPT_START GET_AWAITABLE 2 LOAD_CONST 0 (None) - >> SEND 4 (to 102) + >> SEND 4 (to 104) YIELD_VALUE 3 RESUME 3 - JUMP_BACKWARD_NO_INTERRUPT 5 (to 90) + JUMP_BACKWARD_NO_INTERRUPT 5 (to 92) >> CLEANUP_THROW >> END_SEND - POP_JUMP_IF_TRUE 1 (to 108) + POP_JUMP_IF_TRUE 1 (to 110) RERAISE 2 >> POP_TOP POP_EXCEPT @@ -613,12 +622,14 @@ def _tryfinallyconst(b): %3d PUSH_NULL LOAD_FAST 1 (b) + PUSH_NULL CALL 0 POP_TOP RETURN_VALUE >> PUSH_EXC_INFO PUSH_NULL LOAD_FAST 1 (b) + PUSH_NULL CALL 0 POP_TOP RERAISE 0 @@ -642,12 +653,14 @@ def _tryfinallyconst(b): %3d PUSH_NULL LOAD_FAST 0 (b) + PUSH_NULL CALL 0 POP_TOP RETURN_CONST 1 (1) PUSH_EXC_INFO PUSH_NULL LOAD_FAST 0 (b) + PUSH_NULL CALL 0 POP_TOP RERAISE 0 @@ -712,7 +725,9 @@ def foo(x): MAKE_FUNCTION 8 (closure) LOAD_DEREF 1 (y) GET_ITER + PUSH_NULL CALL 0 + PUSH_NULL CALL 1 RETURN_VALUE """ % (dis_nested_0, @@ -783,14 +798,15 @@ def loop_test(): LOAD_CONST 2 (3) BINARY_OP 5 (*) GET_ITER - >> FOR_ITER_LIST 14 (to 48) + >> FOR_ITER_LIST 15 (to 50) STORE_FAST 0 (i) %3d LOAD_GLOBAL_MODULE 1 (NULL + load_test) LOAD_FAST 0 (i) + PUSH_NULL CALL_PY_WITH_DEFAULTS 1 POP_TOP - JUMP_BACKWARD 16 (to 16) + JUMP_BACKWARD 17 (to 16) %3d >> END_FOR RETURN_CONST 0 (None) @@ -1227,6 +1243,7 @@ def test_call_specialize(self): 1 PUSH_NULL LOAD_NAME 0 (str) LOAD_CONST 0 (1) + PUSH_NULL CALL_NO_KW_STR_1 1 RETURN_VALUE """ @@ -1606,10 +1623,11 @@ def _prepare_test_cases(): Instruction(opname='BUILD_LIST', opcode=103, arg=0, argval=0, argrepr='', offset=38, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='BUILD_MAP', opcode=105, arg=0, argval=0, argrepr='', offset=40, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='Hello world!', argrepr="'Hello world!'", offset=42, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=7, argval=7, argrepr='', offset=44, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=52, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='f', argrepr='f', offset=54, starts_line=8, is_jump_target=False, positions=None), - Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=56, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=44, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=7, argval=7, argrepr='', offset=46, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=54, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='f', argrepr='f', offset=56, starts_line=8, is_jump_target=False, positions=None), + Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=58, starts_line=None, is_jump_target=False, positions=None), ] expected_opinfo_f = [ @@ -1631,10 +1649,11 @@ def _prepare_test_cases(): Instruction(opname='LOAD_DEREF', opcode=137, arg=4, argval='b', argrepr='b', offset=38, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_DEREF', opcode=137, arg=0, argval='c', argrepr='c', offset=40, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_DEREF', opcode=137, arg=1, argval='d', argrepr='d', offset=42, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=4, argval=4, argrepr='', offset=44, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=52, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='inner', argrepr='inner', offset=54, starts_line=6, is_jump_target=False, positions=None), - Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=56, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=44, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=4, argval=4, argrepr='', offset=46, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=54, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='inner', argrepr='inner', offset=56, starts_line=6, is_jump_target=False, positions=None), + Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=58, starts_line=None, is_jump_target=False, positions=None), ] expected_opinfo_inner = [ @@ -1646,126 +1665,136 @@ def _prepare_test_cases(): Instruction(opname='LOAD_DEREF', opcode=137, arg=4, argval='c', argrepr='c', offset=18, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_DEREF', opcode=137, arg=5, argval='d', argrepr='d', offset=20, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_FAST_LOAD_FAST', opcode=168, arg=1, argval=('e', 'f'), argrepr='e, f', offset=22, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=6, argval=6, argrepr='', offset=24, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=32, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='RETURN_CONST', opcode=121, arg=0, argval=None, argrepr='None', offset=34, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=24, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=6, argval=6, argrepr='', offset=26, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=34, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='RETURN_CONST', opcode=121, arg=0, argval=None, argrepr='None', offset=36, starts_line=None, is_jump_target=False, positions=None), ] - expected_opinfo_jumpy = [ Instruction(opname='RESUME', opcode=151, arg=0, argval=0, argrepr='', offset=0, starts_line=1, is_jump_target=False, positions=None), Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='range', argrepr='NULL + range', offset=2, starts_line=3, is_jump_target=False, positions=None), Instruction(opname='LOAD_CONST', opcode=100, arg=1, argval=10, argrepr='10', offset=12, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=14, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='GET_ITER', opcode=68, arg=None, argval=None, argrepr='', offset=22, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='FOR_ITER', opcode=93, arg=28, argval=84, argrepr='to 84', offset=24, starts_line=None, is_jump_target=True, positions=None), - Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', argrepr='i', offset=28, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=30, starts_line=4, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=40, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=42, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=50, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=52, starts_line=5, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=54, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='COMPARE_OP', opcode=107, arg=2, argval='<', argrepr='<', offset=56, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=2, argval=66, argrepr='to 66', offset=60, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='JUMP_BACKWARD', opcode=140, arg=21, argval=24, argrepr='to 24', offset=62, starts_line=6, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=66, starts_line=7, is_jump_target=True, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, argrepr='6', offset=68, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='COMPARE_OP', opcode=107, arg=68, argval='>', argrepr='>', offset=70, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_JUMP_IF_TRUE', opcode=115, arg=2, argval=80, argrepr='to 80', offset=74, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='JUMP_BACKWARD', opcode=140, arg=28, argval=24, argrepr='to 24', offset=76, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=80, starts_line=8, is_jump_target=True, positions=None), - Instruction(opname='JUMP_FORWARD', opcode=110, arg=12, argval=108, argrepr='to 108', offset=82, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='END_FOR', opcode=4, arg=None, argval=None, argrepr='', offset=84, starts_line=3, is_jump_target=True, positions=None), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=86, starts_line=10, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='I can haz else clause?', argrepr="'I can haz else clause?'", offset=96, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=98, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=106, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST_CHECK', opcode=127, arg=0, argval='i', argrepr='i', offset=108, starts_line=11, is_jump_target=True, positions=None), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=33, argval=178, argrepr='to 178', offset=110, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=112, starts_line=12, is_jump_target=True, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=122, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=124, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=132, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=134, starts_line=13, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, argrepr='1', offset=136, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='BINARY_OP', opcode=122, arg=23, argval=23, argrepr='-=', offset=138, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', argrepr='i', offset=142, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=144, starts_line=14, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, argrepr='6', offset=146, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='COMPARE_OP', opcode=107, arg=68, argval='>', argrepr='>', offset=148, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=2, argval=158, argrepr='to 158', offset=152, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='JUMP_BACKWARD', opcode=140, arg=25, argval=108, argrepr='to 108', offset=154, starts_line=15, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=158, starts_line=16, is_jump_target=True, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=160, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='COMPARE_OP', opcode=107, arg=2, argval='<', argrepr='<', offset=162, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=1, argval=170, argrepr='to 170', offset=166, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='JUMP_FORWARD', opcode=110, arg=15, argval=200, argrepr='to 200', offset=168, starts_line=17, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=170, starts_line=11, is_jump_target=True, positions=None), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=2, argval=178, argrepr='to 178', offset=172, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='JUMP_BACKWARD', opcode=140, arg=33, argval=112, argrepr='to 112', offset=174, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=178, starts_line=19, is_jump_target=True, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=6, argval='Who let lolcatz into this test suite?', argrepr="'Who let lolcatz into this test suite?'", offset=188, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=190, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=198, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='NOP', opcode=9, arg=None, argval=None, argrepr='', offset=200, starts_line=20, is_jump_target=True, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, argrepr='1', offset=202, starts_line=21, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=7, argval=0, argrepr='0', offset=204, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='BINARY_OP', opcode=122, arg=11, argval=11, argrepr='/', offset=206, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=210, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=212, starts_line=25, is_jump_target=False, positions=None), - Instruction(opname='BEFORE_WITH', opcode=53, arg=None, argval=None, argrepr='', offset=214, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='STORE_FAST', opcode=125, arg=1, argval='dodgy', argrepr='dodgy', offset=216, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=218, starts_line=26, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=8, argval='Never reach this', argrepr="'Never reach this'", offset=228, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=230, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=238, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=240, starts_line=25, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=242, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=244, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=2, argval=2, argrepr='', offset=246, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=254, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=256, starts_line=28, is_jump_target=True, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=266, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=268, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=276, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='RETURN_CONST', opcode=121, arg=0, argval=None, argrepr='None', offset=278, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='PUSH_EXC_INFO', opcode=35, arg=None, argval=None, argrepr='', offset=280, starts_line=25, is_jump_target=False, positions=None), - Instruction(opname='WITH_EXCEPT_START', opcode=49, arg=None, argval=None, argrepr='', offset=282, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_JUMP_IF_TRUE', opcode=115, arg=1, argval=288, argrepr='to 288', offset=284, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='RERAISE', opcode=119, arg=2, argval=2, argrepr='', offset=286, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=288, starts_line=None, is_jump_target=True, positions=None), - Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=290, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=14, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=16, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='GET_ITER', opcode=68, arg=None, argval=None, argrepr='', offset=24, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='FOR_ITER', opcode=93, arg=29, argval=88, argrepr='to 88', offset=26, starts_line=None, is_jump_target=True, positions=None), + Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', argrepr='i', offset=30, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=32, starts_line=4, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=42, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=44, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=46, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=54, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=56, starts_line=5, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=58, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='COMPARE_OP', opcode=107, arg=2, argval='<', argrepr='<', offset=60, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=2, argval=70, argrepr='to 70', offset=64, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='JUMP_BACKWARD', opcode=140, arg=22, argval=26, argrepr='to 26', offset=66, starts_line=6, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=70, starts_line=7, is_jump_target=True, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, argrepr='6', offset=72, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='COMPARE_OP', opcode=107, arg=68, argval='>', argrepr='>', offset=74, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_JUMP_IF_TRUE', opcode=115, arg=2, argval=84, argrepr='to 84', offset=78, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='JUMP_BACKWARD', opcode=140, arg=29, argval=26, argrepr='to 26', offset=80, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=84, starts_line=8, is_jump_target=True, positions=None), + Instruction(opname='JUMP_FORWARD', opcode=110, arg=13, argval=114, argrepr='to 114', offset=86, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='END_FOR', opcode=4, arg=None, argval=None, argrepr='', offset=88, starts_line=3, is_jump_target=True, positions=None), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=90, starts_line=10, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='I can haz else clause?', argrepr="'I can haz else clause?'", offset=100, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=102, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=104, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=112, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST_CHECK', opcode=127, arg=0, argval='i', argrepr='i', offset=114, starts_line=11, is_jump_target=True, positions=None), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=34, argval=186, argrepr='to 186', offset=116, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=118, starts_line=12, is_jump_target=True, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=128, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=130, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=132, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=140, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=142, starts_line=13, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, argrepr='1', offset=144, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='BINARY_OP', opcode=122, arg=23, argval=23, argrepr='-=', offset=146, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', argrepr='i', offset=150, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=152, starts_line=14, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, argrepr='6', offset=154, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='COMPARE_OP', opcode=107, arg=68, argval='>', argrepr='>', offset=156, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=2, argval=166, argrepr='to 166', offset=160, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='JUMP_BACKWARD', opcode=140, arg=26, argval=114, argrepr='to 114', offset=162, starts_line=15, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=166, starts_line=16, is_jump_target=True, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=168, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='COMPARE_OP', opcode=107, arg=2, argval='<', argrepr='<', offset=170, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=1, argval=178, argrepr='to 178', offset=174, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='JUMP_FORWARD', opcode=110, arg=16, argval=210, argrepr='to 210', offset=176, starts_line=17, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=178, starts_line=11, is_jump_target=True, positions=None), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=2, argval=186, argrepr='to 186', offset=180, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='JUMP_BACKWARD', opcode=140, arg=34, argval=118, argrepr='to 118', offset=182, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=186, starts_line=19, is_jump_target=True, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=6, argval='Who let lolcatz into this test suite?', argrepr="'Who let lolcatz into this test suite?'", offset=196, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=198, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=200, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=208, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='NOP', opcode=9, arg=None, argval=None, argrepr='', offset=210, starts_line=20, is_jump_target=True, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, argrepr='1', offset=212, starts_line=21, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=7, argval=0, argrepr='0', offset=214, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='BINARY_OP', opcode=122, arg=11, argval=11, argrepr='/', offset=216, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=220, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=222, starts_line=25, is_jump_target=False, positions=None), + Instruction(opname='BEFORE_WITH', opcode=53, arg=None, argval=None, argrepr='', offset=224, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='STORE_FAST', opcode=125, arg=1, argval='dodgy', argrepr='dodgy', offset=226, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=228, starts_line=26, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=8, argval='Never reach this', argrepr="'Never reach this'", offset=238, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=240, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=242, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=250, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=252, starts_line=25, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=254, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=256, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=258, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=2, argval=2, argrepr='', offset=260, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=268, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=270, starts_line=28, is_jump_target=True, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=280, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=282, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=284, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=292, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=294, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='JUMP_BACKWARD', opcode=140, arg=22, argval=256, argrepr='to 256', offset=296, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=300, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=302, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=304, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='PUSH_EXC_INFO', opcode=35, arg=None, argval=None, argrepr='', offset=306, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=4, argval='ZeroDivisionError', argrepr='ZeroDivisionError', offset=308, starts_line=22, is_jump_target=False, positions=None), - Instruction(opname='CHECK_EXC_MATCH', opcode=36, arg=None, argval=None, argrepr='', offset=318, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=15, argval=352, argrepr='to 352', offset=320, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=322, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=324, starts_line=23, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=9, argval='Here we go, here we go, here we go...', argrepr="'Here we go, here we go, here we go...'", offset=334, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=336, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=344, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=346, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='JUMP_BACKWARD', opcode=140, arg=48, argval=256, argrepr='to 256', offset=348, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='RERAISE', opcode=119, arg=0, argval=0, argrepr='', offset=352, starts_line=22, is_jump_target=True, positions=None), - Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=354, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=356, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=358, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='PUSH_EXC_INFO', opcode=35, arg=None, argval=None, argrepr='', offset=360, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=362, starts_line=28, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=372, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=374, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=382, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='RERAISE', opcode=119, arg=0, argval=0, argrepr='', offset=384, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=386, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=388, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=390, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='RETURN_CONST', opcode=121, arg=0, argval=None, argrepr='None', offset=294, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='PUSH_EXC_INFO', opcode=35, arg=None, argval=None, argrepr='', offset=296, starts_line=25, is_jump_target=False, positions=None), + Instruction(opname='WITH_EXCEPT_START', opcode=49, arg=None, argval=None, argrepr='', offset=298, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_JUMP_IF_TRUE', opcode=115, arg=1, argval=304, argrepr='to 304', offset=300, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='RERAISE', opcode=119, arg=2, argval=2, argrepr='', offset=302, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=304, starts_line=None, is_jump_target=True, positions=None), + Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=306, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=308, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=310, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='JUMP_BACKWARD', opcode=140, arg=23, argval=270, argrepr='to 270', offset=312, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=316, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=318, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=320, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='PUSH_EXC_INFO', opcode=35, arg=None, argval=None, argrepr='', offset=322, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=4, argval='ZeroDivisionError', argrepr='ZeroDivisionError', offset=324, starts_line=22, is_jump_target=False, positions=None), + Instruction(opname='CHECK_EXC_MATCH', opcode=36, arg=None, argval=None, argrepr='', offset=334, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=16, argval=370, argrepr='to 370', offset=336, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=338, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=340, starts_line=23, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=9, argval='Here we go, here we go, here we go...', argrepr="'Here we go, here we go, here we go...'", offset=350, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=352, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=354, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=362, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=364, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='JUMP_BACKWARD', opcode=140, arg=50, argval=270, argrepr='to 270', offset=366, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='RERAISE', opcode=119, arg=0, argval=0, argrepr='', offset=370, starts_line=22, is_jump_target=True, positions=None), + Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=372, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=374, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=376, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='PUSH_EXC_INFO', opcode=35, arg=None, argval=None, argrepr='', offset=378, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=380, starts_line=28, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=390, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=392, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=394, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=402, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='RERAISE', opcode=119, arg=0, argval=0, argrepr='', offset=404, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=406, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=408, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=410, starts_line=None, is_jump_target=False, positions=None), ] # One last piece of inspect fodder to check the default line number handling @@ -1833,6 +1862,7 @@ def test_co_positions(self): (2, 2, 8, 9), (1, 3, 0, 1), (1, 3, 0, 1), + (1, 3, 0, 1), (1, 3, 0, 1) ] self.assertEqual(positions, expected) diff --git a/Lib/test/test_monitoring.py b/Lib/test/test_monitoring.py index f854c582846660..6f843462bb6e0f 100644 --- a/Lib/test/test_monitoring.py +++ b/Lib/test/test_monitoring.py @@ -838,11 +838,12 @@ def func2(): ('instruction', 'func2', 8), ('instruction', 'func2', 28), ('instruction', 'func2', 30), - ('instruction', 'func2', 38), - ('line', 'func2', 3), + ('instruction', 'func2', 32), ('instruction', 'func2', 40), + ('line', 'func2', 3), ('instruction', 'func2', 42), ('instruction', 'func2', 44), + ('instruction', 'func2', 46), ('line', 'check_events', 11)]) def test_try_except(self): @@ -1158,8 +1159,8 @@ def func(): ('line', 'func', 5), ('line', 'meth', 1), ('jump', 'func', 5, 5), - ('jump', 'func', 5, '[offset=112]'), - ('branch', 'func', '[offset=118]', '[offset=120]'), + ('jump', 'func', 5, '[offset=116]'), + ('branch', 'func', '[offset=122]', '[offset=124]'), ('line', 'check_events', 11)]) self.check_events(func, recorders = FLOW_AND_LINE_RECORDERS, expected = [ @@ -1174,8 +1175,8 @@ def func(): ('line', 'meth', 1), ('return', None), ('jump', 'func', 5, 5), - ('jump', 'func', 5, '[offset=112]'), - ('branch', 'func', '[offset=118]', '[offset=120]'), + ('jump', 'func', 5, '[offset=116]'), + ('branch', 'func', '[offset=122]', '[offset=124]'), ('return', None), ('line', 'check_events', 11)]) diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index d81501f6f1df6a..ae1c8000921ca5 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -1446,7 +1446,7 @@ class C(object): pass def func(): return sys._getframe() x = func() - check(x, size('3Pi3c7P2ic??2P')) + check(x, size('3Pi3c7P2ic??3P')) # function def func(): pass check(func, size('15Pi')) diff --git a/Objects/frameobject.c b/Objects/frameobject.c index f2061e6a18fa40..ecd927cd13bf44 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -426,7 +426,7 @@ mark_stacks(PyCodeObject *code_obj, int len) case CALL: { int args = oparg; - for (int j = 0; j < args+2; j++) { + for (int j = 0; j < args+3; j++) { next_stack = pop_value(next_stack); } next_stack = push_value(next_stack, Object); diff --git a/Programs/test_frozenmain.h b/Programs/test_frozenmain.h index 51d65533cbda9f..a6866c24cc6082 100644 --- a/Programs/test_frozenmain.h +++ b/Programs/test_frozenmain.h @@ -1,38 +1,38 @@ // Auto-generated by Programs/freeze_test_frozenmain.py unsigned char M_test_frozenmain[] = { 227,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0, - 0,0,0,0,0,243,164,0,0,0,151,0,100,0,100,1, + 0,0,0,0,0,243,172,0,0,0,151,0,100,0,100,1, 108,0,90,0,100,0,100,1,108,1,90,1,2,0,101,2, - 100,2,171,1,0,0,0,0,0,0,1,0,2,0,101,2, - 100,3,101,0,106,6,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,171,2,0,0,0,0,0,0, - 1,0,2,0,101,1,106,8,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,171,0,0,0,0,0, - 0,0,100,4,25,0,0,0,90,5,100,5,68,0,93,20, - 0,0,90,6,2,0,101,2,100,6,101,6,155,0,100,7, - 101,5,101,6,25,0,0,0,155,0,157,4,171,1,0,0, - 0,0,0,0,1,0,140,22,0,0,4,0,121,1,41,8, - 233,0,0,0,0,78,122,18,70,114,111,122,101,110,32,72, - 101,108,108,111,32,87,111,114,108,100,122,8,115,121,115,46, - 97,114,103,118,218,6,99,111,110,102,105,103,41,5,218,12, - 112,114,111,103,114,97,109,95,110,97,109,101,218,10,101,120, - 101,99,117,116,97,98,108,101,218,15,117,115,101,95,101,110, - 118,105,114,111,110,109,101,110,116,218,17,99,111,110,102,105, - 103,117,114,101,95,99,95,115,116,100,105,111,218,14,98,117, - 102,102,101,114,101,100,95,115,116,100,105,111,122,7,99,111, - 110,102,105,103,32,122,2,58,32,41,7,218,3,115,121,115, - 218,17,95,116,101,115,116,105,110,116,101,114,110,97,108,99, - 97,112,105,218,5,112,114,105,110,116,218,4,97,114,103,118, - 218,11,103,101,116,95,99,111,110,102,105,103,115,114,3,0, - 0,0,218,3,107,101,121,169,0,243,0,0,0,0,250,18, - 116,101,115,116,95,102,114,111,122,101,110,109,97,105,110,46, - 112,121,250,8,60,109,111,100,117,108,101,62,114,18,0,0, - 0,1,0,0,0,115,102,0,0,0,240,3,1,1,1,243, - 8,0,1,11,219,0,24,225,0,5,208,6,26,212,0,27, - 217,0,5,128,106,144,35,151,40,145,40,212,0,27,216,9, - 38,208,9,26,215,9,38,209,9,38,211,9,40,168,24,209, - 9,50,128,6,240,2,6,12,2,242,0,7,1,42,128,67, - 241,14,0,5,10,136,71,144,67,144,53,152,2,152,54,160, - 35,153,59,152,45,208,10,40,214,4,41,241,15,7,1,42, - 114,16,0,0,0, + 100,2,2,0,171,1,0,0,0,0,0,0,1,0,2,0, + 101,2,100,3,101,0,106,6,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,2,0,171,2,0,0, + 0,0,0,0,1,0,2,0,101,1,106,8,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0, + 171,0,0,0,0,0,0,0,100,4,25,0,0,0,90,5, + 100,5,68,0,93,21,0,0,90,6,2,0,101,2,100,6, + 101,6,155,0,100,7,101,5,101,6,25,0,0,0,155,0, + 157,4,2,0,171,1,0,0,0,0,0,0,1,0,140,23, + 0,0,4,0,121,1,41,8,233,0,0,0,0,78,122,18, + 70,114,111,122,101,110,32,72,101,108,108,111,32,87,111,114, + 108,100,122,8,115,121,115,46,97,114,103,118,218,6,99,111, + 110,102,105,103,41,5,218,12,112,114,111,103,114,97,109,95, + 110,97,109,101,218,10,101,120,101,99,117,116,97,98,108,101, + 218,15,117,115,101,95,101,110,118,105,114,111,110,109,101,110, + 116,218,17,99,111,110,102,105,103,117,114,101,95,99,95,115, + 116,100,105,111,218,14,98,117,102,102,101,114,101,100,95,115, + 116,100,105,111,122,7,99,111,110,102,105,103,32,122,2,58, + 32,41,7,218,3,115,121,115,218,17,95,116,101,115,116,105, + 110,116,101,114,110,97,108,99,97,112,105,218,5,112,114,105, + 110,116,218,4,97,114,103,118,218,11,103,101,116,95,99,111, + 110,102,105,103,115,114,3,0,0,0,218,3,107,101,121,169, + 0,243,0,0,0,0,250,18,116,101,115,116,95,102,114,111, + 122,101,110,109,97,105,110,46,112,121,250,8,60,109,111,100, + 117,108,101,62,114,18,0,0,0,1,0,0,0,115,102,0, + 0,0,240,3,1,1,1,243,8,0,1,11,219,0,24,225, + 0,5,208,6,26,213,0,27,217,0,5,128,106,144,35,151, + 40,145,40,213,0,27,216,9,38,208,9,26,215,9,38,209, + 9,38,212,9,40,168,24,209,9,50,128,6,240,2,6,12, + 2,242,0,7,1,42,128,67,241,14,0,5,10,136,71,144, + 67,144,53,152,2,152,54,160,35,153,59,152,45,208,10,40, + 215,4,41,241,15,7,1,42,114,16,0,0,0, }; diff --git a/Python/bytecodes.c b/Python/bytecodes.c index e7f7c1a96f8dcb..a06b0188005ee3 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -73,7 +73,6 @@ dummy_func( _PyCFrame cframe, _Py_CODEUNIT *next_instr, PyObject **stack_pointer, - PyObject *kwnames, int throwflag, binaryfunc binary_ops[], PyObject *args[] @@ -2589,18 +2588,12 @@ dummy_func( assert(oparg & 1); } - inst(KW_NAMES, (--)) { - assert(kwnames == NULL); - assert(oparg < PyTuple_GET_SIZE(frame->f_code->co_consts)); - kwnames = GETITEM(frame->f_code->co_consts, oparg); - } - inst(INSTRUMENTED_CALL, ( -- )) { - int is_meth = PEEK(oparg+2) != NULL; + int is_meth = PEEK(oparg + 3) != NULL; int total_args = oparg + is_meth; - PyObject *function = PEEK(total_args + 1); + PyObject *function = PEEK(total_args + 2); PyObject *arg = total_args == 0 ? - &_PyInstrumentation_MISSING : PEEK(total_args); + &_PyInstrumentation_MISSING : PEEK(total_args + 1); int err = _Py_call_instrumentation_2args( tstate, PY_MONITORING_EVENT_CALL, frame, next_instr-1, function, arg); @@ -2634,13 +2627,12 @@ dummy_func( }; // On entry, the stack is either - // [NULL, callable, arg1, arg2, ...] + // [NULL, callable, arg1, arg2, ..., kwnames] // or - // [method, self, arg1, arg2, ...] - // (Some args may be keywords, see KW_NAMES, which sets 'kwnames'.) + // [method, self, arg1, arg2, ..., kwnames] // On exit, the stack is [result]. // When calling Python, inline the call using DISPATCH_INLINED(). - inst(CALL, (unused/1, unused/2, method, callable, args[oparg] -- res)) { + inst(CALL, (unused/1, unused/2, method, callable, args[oparg], kwnames -- res)) { int is_meth = method != NULL; int total_args = oparg; if (is_meth) { @@ -2681,9 +2673,9 @@ dummy_func( tstate, (PyFunctionObject *)callable, locals, args, positional_args, kwnames ); - kwnames = NULL; + Py_XDECREF(kwnames); // Manipulate stack directly since we leave using DISPATCH_INLINED(). - STACK_SHRINK(oparg + 2); + STACK_SHRINK(oparg + 3); // The frame has stolen all the arguments from the stack, // so there is no need to clean them up. if (new_frame == NULL) { @@ -2700,7 +2692,7 @@ dummy_func( kwnames); if (opcode == INSTRUMENTED_CALL) { PyObject *arg = total_args == 0 ? - &_PyInstrumentation_MISSING : PEEK(total_args); + &_PyInstrumentation_MISSING : PEEK(total_args + 1); if (res == NULL) { _Py_call_instrumentation_exc2( tstate, PY_MONITORING_EVENT_C_RAISE, @@ -2715,7 +2707,7 @@ dummy_func( } } } - kwnames = NULL; + Py_XDECREF(kwnames); assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL)); Py_DECREF(callable); for (int i = 0; i < total_args; i++) { @@ -2728,19 +2720,19 @@ dummy_func( // Start out with [NULL, bound_method, arg1, arg2, ...] // Transform to [callable, self, arg1, arg2, ...] // Then fall through to CALL_PY_EXACT_ARGS - inst(CALL_BOUND_METHOD_EXACT_ARGS, (unused/1, unused/2, method, callable, unused[oparg] -- unused)) { + inst(CALL_BOUND_METHOD_EXACT_ARGS, (unused/1, unused/2, method, callable, unused[oparg], unused -- unused)) { DEOPT_IF(method != NULL, CALL); DEOPT_IF(Py_TYPE(callable) != &PyMethod_Type, CALL); STAT_INC(CALL, hit); PyObject *self = ((PyMethodObject *)callable)->im_self; - PEEK(oparg + 1) = Py_NewRef(self); // callable + PEEK(oparg + 2) = Py_NewRef(self); // callable PyObject *meth = ((PyMethodObject *)callable)->im_func; - PEEK(oparg + 2) = Py_NewRef(meth); // method + PEEK(oparg + 3) = Py_NewRef(meth); // method Py_DECREF(callable); GO_TO_INSTRUCTION(CALL_PY_EXACT_ARGS); } - inst(CALL_PY_EXACT_ARGS, (unused/1, func_version/2, method, callable, args[oparg] -- unused)) { + inst(CALL_PY_EXACT_ARGS, (unused/1, func_version/2, method, callable, args[oparg], kwnames -- unused)) { assert(kwnames == NULL); DEOPT_IF(tstate->interp->eval_frame, CALL); int is_meth = method != NULL; @@ -2762,13 +2754,13 @@ dummy_func( new_frame->localsplus[i] = args[i]; } // Manipulate stack directly since we leave using DISPATCH_INLINED(). - STACK_SHRINK(oparg + 2); + STACK_SHRINK(oparg + 3); JUMPBY(INLINE_CACHE_ENTRIES_CALL); frame->return_offset = 0; DISPATCH_INLINED(new_frame); } - inst(CALL_PY_WITH_DEFAULTS, (unused/1, func_version/2, method, callable, args[oparg] -- unused)) { + inst(CALL_PY_WITH_DEFAULTS, (unused/1, func_version/2, method, callable, args[oparg], kwnames -- unused)) { assert(kwnames == NULL); DEOPT_IF(tstate->interp->eval_frame, CALL); int is_meth = method != NULL; @@ -2800,13 +2792,13 @@ dummy_func( new_frame->localsplus[i] = Py_NewRef(def); } // Manipulate stack and cache directly since we leave using DISPATCH_INLINED(). - STACK_SHRINK(oparg + 2); + STACK_SHRINK(oparg + 3); JUMPBY(INLINE_CACHE_ENTRIES_CALL); frame->return_offset = 0; DISPATCH_INLINED(new_frame); } - inst(CALL_NO_KW_TYPE_1, (unused/1, unused/2, null, callable, args[oparg] -- res)) { + inst(CALL_NO_KW_TYPE_1, (unused/1, unused/2, null, callable, args[oparg], kwnames -- res)) { assert(kwnames == NULL); assert(oparg == 1); DEOPT_IF(null != NULL, CALL); @@ -2818,7 +2810,7 @@ dummy_func( Py_DECREF(&PyType_Type); // I.e., callable } - inst(CALL_NO_KW_STR_1, (unused/1, unused/2, null, callable, args[oparg] -- res)) { + inst(CALL_NO_KW_STR_1, (unused/1, unused/2, null, callable, args[oparg], kwnames -- res)) { assert(kwnames == NULL); assert(oparg == 1); DEOPT_IF(null != NULL, CALL); @@ -2832,7 +2824,7 @@ dummy_func( CHECK_EVAL_BREAKER(); } - inst(CALL_NO_KW_TUPLE_1, (unused/1, unused/2, null, callable, args[oparg] -- res)) { + inst(CALL_NO_KW_TUPLE_1, (unused/1, unused/2, null, callable, args[oparg], kwnames -- res)) { assert(kwnames == NULL); assert(oparg == 1); DEOPT_IF(null != NULL, CALL); @@ -2846,7 +2838,7 @@ dummy_func( CHECK_EVAL_BREAKER(); } - inst(CALL_BUILTIN_CLASS, (unused/1, unused/2, method, callable, args[oparg] -- res)) { + inst(CALL_BUILTIN_CLASS, (unused/1, unused/2, method, callable, args[oparg], kwnames -- res)) { int is_meth = method != NULL; int total_args = oparg; if (is_meth) { @@ -2861,7 +2853,7 @@ dummy_func( STAT_INC(CALL, hit); res = tp->tp_vectorcall((PyObject *)tp, args, total_args - kwnames_len, kwnames); - kwnames = NULL; + Py_XDECREF(kwnames); /* Free the arguments. */ for (int i = 0; i < total_args; i++) { Py_DECREF(args[i]); @@ -2871,7 +2863,7 @@ dummy_func( CHECK_EVAL_BREAKER(); } - inst(CALL_NO_KW_BUILTIN_O, (unused/1, unused/2, method, callable, args[oparg] -- res)) { + inst(CALL_NO_KW_BUILTIN_O, (unused/1, unused/2, method, callable, args[oparg], kwnames -- res)) { /* Builtin METH_O functions */ assert(kwnames == NULL); int is_meth = method != NULL; @@ -2902,7 +2894,7 @@ dummy_func( CHECK_EVAL_BREAKER(); } - inst(CALL_NO_KW_BUILTIN_FAST, (unused/1, unused/2, method, callable, args[oparg] -- res)) { + inst(CALL_NO_KW_BUILTIN_FAST, (unused/1, unused/2, method, callable, args[oparg], kwnames -- res)) { /* Builtin METH_FASTCALL functions, without keywords */ assert(kwnames == NULL); int is_meth = method != NULL; @@ -2937,7 +2929,7 @@ dummy_func( CHECK_EVAL_BREAKER(); } - inst(CALL_BUILTIN_FAST_WITH_KEYWORDS, (unused/1, unused/2, method, callable, args[oparg] -- res)) { + inst(CALL_BUILTIN_FAST_WITH_KEYWORDS, (unused/1, unused/2, method, callable, args[oparg], kwnames -- res)) { /* Builtin METH_FASTCALL | METH_KEYWORDS functions */ int is_meth = method != NULL; int total_args = oparg; @@ -2961,7 +2953,7 @@ dummy_func( kwnames ); assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL)); - kwnames = NULL; + Py_XDECREF(kwnames); /* Free the arguments. */ for (int i = 0; i < total_args; i++) { @@ -2972,7 +2964,7 @@ dummy_func( CHECK_EVAL_BREAKER(); } - inst(CALL_NO_KW_LEN, (unused/1, unused/2, method, callable, args[oparg] -- res)) { + inst(CALL_NO_KW_LEN, (unused/1, unused/2, method, callable, args[oparg], kwnames -- res)) { assert(kwnames == NULL); /* len(o) */ int is_meth = method != NULL; @@ -2999,7 +2991,7 @@ dummy_func( ERROR_IF(res == NULL, error); } - inst(CALL_NO_KW_ISINSTANCE, (unused/1, unused/2, method, callable, args[oparg] -- res)) { + inst(CALL_NO_KW_ISINSTANCE, (unused/1, unused/2, method, callable, args[oparg], kwnames -- res)) { assert(kwnames == NULL); /* isinstance(o, o2) */ int is_meth = method != NULL; @@ -3029,7 +3021,7 @@ dummy_func( } // This is secretly a super-instruction - inst(CALL_NO_KW_LIST_APPEND, (unused/1, unused/2, method, self, args[oparg] -- unused)) { + inst(CALL_NO_KW_LIST_APPEND, (unused/1, unused/2, method, self, args[oparg], kwnames -- unused)) { assert(kwnames == NULL); assert(oparg == 1); assert(method != NULL); @@ -3042,14 +3034,14 @@ dummy_func( } Py_DECREF(self); Py_DECREF(method); - STACK_SHRINK(3); + STACK_SHRINK(4); // CALL + POP_TOP JUMPBY(INLINE_CACHE_ENTRIES_CALL + 1); assert(next_instr[-1].op.code == POP_TOP); DISPATCH(); } - inst(CALL_NO_KW_METHOD_DESCRIPTOR_O, (unused/1, unused/2, method, unused, args[oparg] -- res)) { + inst(CALL_NO_KW_METHOD_DESCRIPTOR_O, (unused/1, unused/2, method, unused, args[oparg], kwnames -- res)) { assert(kwnames == NULL); int is_meth = method != NULL; int total_args = oparg; @@ -3058,7 +3050,7 @@ dummy_func( total_args++; } PyMethodDescrObject *callable = - (PyMethodDescrObject *)PEEK(total_args + 1); + (PyMethodDescrObject *)PEEK(total_args + 2); DEOPT_IF(total_args != 2, CALL); DEOPT_IF(!Py_IS_TYPE(callable, &PyMethodDescr_Type), CALL); PyMethodDef *meth = callable->d_method; @@ -3083,7 +3075,7 @@ dummy_func( CHECK_EVAL_BREAKER(); } - inst(CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS, (unused/1, unused/2, method, unused, args[oparg] -- res)) { + inst(CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS, (unused/1, unused/2, method, unused, args[oparg], kwnames -- res)) { int is_meth = method != NULL; int total_args = oparg; if (is_meth) { @@ -3091,7 +3083,7 @@ dummy_func( total_args++; } PyMethodDescrObject *callable = - (PyMethodDescrObject *)PEEK(total_args + 1); + (PyMethodDescrObject *)PEEK(total_args + 2); DEOPT_IF(!Py_IS_TYPE(callable, &PyMethodDescr_Type), CALL); PyMethodDef *meth = callable->d_method; DEOPT_IF(meth->ml_flags != (METH_FASTCALL|METH_KEYWORDS), CALL); @@ -3104,7 +3096,7 @@ dummy_func( (_PyCFunctionFastWithKeywords)(void(*)(void))meth->ml_meth; res = cfunc(self, args + 1, nargs - KWNAMES_LEN(), kwnames); assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL)); - kwnames = NULL; + Py_XDECREF(kwnames); /* Free the arguments. */ for (int i = 0; i < total_args; i++) { @@ -3115,7 +3107,7 @@ dummy_func( CHECK_EVAL_BREAKER(); } - inst(CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS, (unused/1, unused/2, method, unused, args[oparg] -- res)) { + inst(CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS, (unused/1, unused/2, method, unused, args[oparg], kwnames -- res)) { assert(kwnames == NULL); assert(oparg == 0 || oparg == 1); int is_meth = method != NULL; @@ -3147,7 +3139,7 @@ dummy_func( CHECK_EVAL_BREAKER(); } - inst(CALL_NO_KW_METHOD_DESCRIPTOR_FAST, (unused/1, unused/2, method, unused, args[oparg] -- res)) { + inst(CALL_NO_KW_METHOD_DESCRIPTOR_FAST, (unused/1, unused/2, method, unused, args[oparg], kwnames -- res)) { assert(kwnames == NULL); int is_meth = method != NULL; int total_args = oparg; @@ -3156,7 +3148,7 @@ dummy_func( total_args++; } PyMethodDescrObject *callable = - (PyMethodDescrObject *)PEEK(total_args + 1); + (PyMethodDescrObject *)PEEK(total_args + 2); /* Builtin METH_FASTCALL methods, without keywords */ DEOPT_IF(!Py_IS_TYPE(callable, &PyMethodDescr_Type), CALL); PyMethodDef *meth = callable->d_method; diff --git a/Python/ceval.c b/Python/ceval.c index e81b6beedfcee1..a2afa662eb174e 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -658,7 +658,6 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int _PyCFrame cframe; _PyInterpreterFrame entry_frame; - PyObject *kwnames = NULL; // Borrowed reference. Reset by CALL instructions. /* WARNING: Because the _PyCFrame lives on the C stack, * but can be accessed from a heap allocated object (tstate) @@ -848,7 +847,6 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int pop_1_error: STACK_SHRINK(1); error: - kwnames = NULL; /* Double-check exception status. */ #ifdef NDEBUG if (!_PyErr_Occurred(tstate)) { diff --git a/Python/compile.c b/Python/compile.c index e3a76236f5723a..0a65424d13f491 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1459,6 +1459,7 @@ compiler_call_exit_with_nones(struct compiler *c, location loc) ADDOP_LOAD_CONST(c, loc, Py_None); ADDOP_LOAD_CONST(c, loc, Py_None); ADDOP_LOAD_CONST(c, loc, Py_None); + ADDOP(c, loc, PUSH_NULL); ADDOP_I(c, loc, CALL, 2); return SUCCESS; } @@ -1839,6 +1840,7 @@ compiler_apply_decorators(struct compiler *c, asdl_expr_seq* decos) for (Py_ssize_t i = asdl_seq_LEN(decos) - 1; i > -1; i--) { location loc = LOC((expr_ty)asdl_seq_GET(decos, i)); + ADDOP(c, loc, PUSH_NULL); ADDOP_I(c, loc, CALL, 0); } return SUCCESS; @@ -2349,6 +2351,7 @@ compiler_function(struct compiler *c, stmt_ty s, int is_async) if (num_typeparam_args > 0) { ADDOP_I(c, loc, SWAP, num_typeparam_args + 1); } + ADDOP(c, loc, PUSH_NULL); ADDOP_I(c, loc, CALL, num_typeparam_args); } @@ -2578,6 +2581,7 @@ compiler_class(struct compiler *c, stmt_ty s) return ERROR; } Py_DECREF(co); + ADDOP(c, loc, PUSH_NULL); ADDOP_I(c, loc, CALL, 0); } else { RETURN_IF_ERROR(compiler_call_helper(c, loc, 2, @@ -2668,6 +2672,7 @@ compiler_typealias(struct compiler *c, stmt_ty s) return ERROR; } Py_DECREF(co); + ADDOP(c, loc, PUSH_NULL); ADDOP_I(c, loc, CALL, 0); } RETURN_IF_ERROR(compiler_nameop(c, loc, name, Store)); @@ -3862,6 +3867,7 @@ compiler_assert(struct compiler *c, stmt_ty s) ADDOP(c, LOC(s), LOAD_ASSERTION_ERROR); if (s->v.Assert.msg) { VISIT(c, expr, s->v.Assert.msg); + ADDOP(c, LOC(s), PUSH_NULL); ADDOP_I(c, LOC(s), CALL, 0); } ADDOP_I(c, LOC(s), RAISE_VARARGS, 1); @@ -4860,6 +4866,9 @@ maybe_optimize_method_call(struct compiler *c, expr_ty e) RETURN_IF_ERROR( compiler_call_simple_kw_helper(c, loc, kwds, kwdsl)); } + else { + ADDOP(c, loc, PUSH_NULL); + } loc = update_start_location_to_match_attr(c, LOC(e), meth); ADDOP_I(c, loc, CALL, argsl + kwdsl); return 1; @@ -4924,6 +4933,7 @@ compiler_joined_str(struct compiler *c, expr_ty e) VISIT(c, expr, asdl_seq_GET(e->v.JoinedStr.values, i)); ADDOP_I(c, loc, LIST_APPEND, 1); } + ADDOP(c, loc, PUSH_NULL); ADDOP_I(c, loc, CALL, 1); } else { @@ -5027,7 +5037,7 @@ compiler_subkwargs(struct compiler *c, location loc, } /* Used by compiler_call_helper and maybe_optimize_method_call to emit - * KW_NAMES before CALL. + * kwnames before CALL. */ static int compiler_call_simple_kw_helper(struct compiler *c, location loc, @@ -5042,12 +5052,7 @@ compiler_call_simple_kw_helper(struct compiler *c, location loc, keyword_ty kw = asdl_seq_GET(keywords, i); PyTuple_SET_ITEM(names, i, Py_NewRef(kw->arg)); } - Py_ssize_t arg = compiler_add_const(c->c_const_cache, c->u, names); - if (arg < 0) { - return ERROR; - } - Py_DECREF(names); - ADDOP_I(c, loc, KW_NAMES, arg); + ADDOP_LOAD_CONST_NEW(c, loc, names); return SUCCESS; } @@ -5093,6 +5098,9 @@ compiler_call_helper(struct compiler *c, location loc, RETURN_IF_ERROR( compiler_call_simple_kw_helper(c, loc, keywords, nkwelts)); } + else { + ADDOP(c, loc, PUSH_NULL); + } ADDOP_I(c, loc, CALL, n + nelts + nkwelts); return SUCCESS; @@ -5693,6 +5701,7 @@ compiler_comprehension(struct compiler *c, expr_ty e, int type, goto error; } + ADDOP(c, loc, PUSH_NULL); ADDOP_I(c, loc, CALL, 0); if (is_async_generator && type != COMP_GENEXP) { diff --git a/Python/flowgraph.c b/Python/flowgraph.c index a144057cd9383a..16d9bc483e29d9 100644 --- a/Python/flowgraph.c +++ b/Python/flowgraph.c @@ -1528,8 +1528,6 @@ optimize_basic_block(PyObject *const_cache, basicblock *bb, PyObject *consts) INSTR_SET_OP0(inst, NOP); } break; - case KW_NAMES: - break; case PUSH_NULL: if (nextop == LOAD_GLOBAL && (inst[1].i_opcode & 1) == 0) { INSTR_SET_OP0(inst, NOP); diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 5f54c8655b9aa2..bcb1c34d8cb10e 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -8,7 +8,7 @@ } TARGET(RESUME) { - #line 137 "Python/bytecodes.c" + #line 136 "Python/bytecodes.c" assert(tstate->cframe == &cframe); assert(frame == cframe.current_frame); /* Possibly combine this with eval breaker */ @@ -25,7 +25,7 @@ } TARGET(INSTRUMENTED_RESUME) { - #line 151 "Python/bytecodes.c" + #line 150 "Python/bytecodes.c" /* Possible performance enhancement: * We need to check the eval breaker anyway, can we * combine the instrument verison check and the eval breaker test? @@ -57,7 +57,7 @@ TARGET(LOAD_CLOSURE) { PyObject *value; - #line 179 "Python/bytecodes.c" + #line 178 "Python/bytecodes.c" /* We keep LOAD_CLOSURE so that the bytecode stays more readable. */ value = GETLOCAL(oparg); if (value == NULL) goto unbound_local_error; @@ -70,7 +70,7 @@ TARGET(LOAD_FAST_CHECK) { PyObject *value; - #line 186 "Python/bytecodes.c" + #line 185 "Python/bytecodes.c" value = GETLOCAL(oparg); if (value == NULL) goto unbound_local_error; Py_INCREF(value); @@ -82,7 +82,7 @@ TARGET(LOAD_FAST) { PyObject *value; - #line 192 "Python/bytecodes.c" + #line 191 "Python/bytecodes.c" value = GETLOCAL(oparg); assert(value != NULL); Py_INCREF(value); @@ -94,7 +94,7 @@ TARGET(LOAD_FAST_AND_CLEAR) { PyObject *value; - #line 198 "Python/bytecodes.c" + #line 197 "Python/bytecodes.c" value = GETLOCAL(oparg); // do not use SETLOCAL here, it decrefs the old value GETLOCAL(oparg) = NULL; @@ -107,7 +107,7 @@ TARGET(LOAD_FAST_LOAD_FAST) { PyObject *value1; PyObject *value2; - #line 204 "Python/bytecodes.c" + #line 203 "Python/bytecodes.c" uint32_t oparg1 = oparg >> 4; uint32_t oparg2 = oparg & 15; value1 = GETLOCAL(oparg1); @@ -123,7 +123,7 @@ TARGET(LOAD_CONST) { PyObject *value; - #line 213 "Python/bytecodes.c" + #line 212 "Python/bytecodes.c" value = GETITEM(frame->f_code->co_consts, oparg); Py_INCREF(value); #line 130 "Python/generated_cases.c.h" @@ -134,7 +134,7 @@ TARGET(STORE_FAST) { PyObject *value = stack_pointer[-1]; - #line 218 "Python/bytecodes.c" + #line 217 "Python/bytecodes.c" SETLOCAL(oparg, value); #line 140 "Python/generated_cases.c.h" STACK_SHRINK(1); @@ -144,7 +144,7 @@ TARGET(STORE_FAST_LOAD_FAST) { PyObject *value1 = stack_pointer[-1]; PyObject *value2; - #line 222 "Python/bytecodes.c" + #line 221 "Python/bytecodes.c" uint32_t oparg1 = oparg >> 4; uint32_t oparg2 = oparg & 15; SETLOCAL(oparg1, value1); @@ -158,7 +158,7 @@ TARGET(STORE_FAST_STORE_FAST) { PyObject *value1 = stack_pointer[-1]; PyObject *value2 = stack_pointer[-2]; - #line 230 "Python/bytecodes.c" + #line 229 "Python/bytecodes.c" uint32_t oparg1 = oparg >> 4; uint32_t oparg2 = oparg & 15; SETLOCAL(oparg1, value1); @@ -170,7 +170,7 @@ TARGET(POP_TOP) { PyObject *value = stack_pointer[-1]; - #line 237 "Python/bytecodes.c" + #line 236 "Python/bytecodes.c" #line 175 "Python/generated_cases.c.h" Py_DECREF(value); STACK_SHRINK(1); @@ -179,7 +179,7 @@ TARGET(PUSH_NULL) { PyObject *res; - #line 241 "Python/bytecodes.c" + #line 240 "Python/bytecodes.c" res = NULL; #line 185 "Python/generated_cases.c.h" STACK_GROW(1); @@ -192,13 +192,13 @@ PyObject *_tmp_2 = stack_pointer[-2]; { PyObject *value = _tmp_1; - #line 237 "Python/bytecodes.c" + #line 236 "Python/bytecodes.c" #line 197 "Python/generated_cases.c.h" Py_DECREF(value); } { PyObject *value = _tmp_2; - #line 237 "Python/bytecodes.c" + #line 236 "Python/bytecodes.c" #line 203 "Python/generated_cases.c.h" Py_DECREF(value); } @@ -209,7 +209,7 @@ TARGET(INSTRUMENTED_END_FOR) { PyObject *value = stack_pointer[-1]; PyObject *receiver = stack_pointer[-2]; - #line 247 "Python/bytecodes.c" + #line 246 "Python/bytecodes.c" /* Need to create a fake StopIteration error here, * to conform to PEP 380 */ if (PyGen_Check(receiver)) { @@ -229,7 +229,7 @@ TARGET(END_SEND) { PyObject *value = stack_pointer[-1]; PyObject *receiver = stack_pointer[-2]; - #line 260 "Python/bytecodes.c" + #line 259 "Python/bytecodes.c" Py_DECREF(receiver); #line 235 "Python/generated_cases.c.h" STACK_SHRINK(1); @@ -240,7 +240,7 @@ TARGET(INSTRUMENTED_END_SEND) { PyObject *value = stack_pointer[-1]; PyObject *receiver = stack_pointer[-2]; - #line 264 "Python/bytecodes.c" + #line 263 "Python/bytecodes.c" if (PyGen_Check(receiver) || PyCoro_CheckExact(receiver)) { PyErr_SetObject(PyExc_StopIteration, value); if (monitor_stop_iteration(tstate, frame, next_instr-1)) { @@ -258,11 +258,11 @@ TARGET(UNARY_NEGATIVE) { PyObject *value = stack_pointer[-1]; PyObject *res; - #line 275 "Python/bytecodes.c" + #line 274 "Python/bytecodes.c" res = PyNumber_Negative(value); #line 264 "Python/generated_cases.c.h" Py_DECREF(value); - #line 277 "Python/bytecodes.c" + #line 276 "Python/bytecodes.c" if (res == NULL) goto pop_1_error; #line 268 "Python/generated_cases.c.h" stack_pointer[-1] = res; @@ -272,11 +272,11 @@ TARGET(UNARY_NOT) { PyObject *value = stack_pointer[-1]; PyObject *res; - #line 281 "Python/bytecodes.c" + #line 280 "Python/bytecodes.c" int err = PyObject_IsTrue(value); #line 278 "Python/generated_cases.c.h" Py_DECREF(value); - #line 283 "Python/bytecodes.c" + #line 282 "Python/bytecodes.c" if (err < 0) goto pop_1_error; if (err == 0) { res = Py_True; @@ -292,11 +292,11 @@ TARGET(UNARY_INVERT) { PyObject *value = stack_pointer[-1]; PyObject *res; - #line 293 "Python/bytecodes.c" + #line 292 "Python/bytecodes.c" res = PyNumber_Invert(value); #line 298 "Python/generated_cases.c.h" Py_DECREF(value); - #line 295 "Python/bytecodes.c" + #line 294 "Python/bytecodes.c" if (res == NULL) goto pop_1_error; #line 302 "Python/generated_cases.c.h" stack_pointer[-1] = res; @@ -309,7 +309,7 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 311 "Python/bytecodes.c" + #line 310 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(left), BINARY_OP); DEOPT_IF(!PyLong_CheckExact(right), BINARY_OP); #line 316 "Python/generated_cases.c.h" @@ -320,7 +320,7 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 316 "Python/bytecodes.c" + #line 315 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); res = _PyLong_Multiply((PyLongObject *)left, (PyLongObject *)right); _Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free); @@ -341,7 +341,7 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 311 "Python/bytecodes.c" + #line 310 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(left), BINARY_OP); DEOPT_IF(!PyLong_CheckExact(right), BINARY_OP); #line 348 "Python/generated_cases.c.h" @@ -352,7 +352,7 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 324 "Python/bytecodes.c" + #line 323 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); res = _PyLong_Add((PyLongObject *)left, (PyLongObject *)right); _Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free); @@ -373,7 +373,7 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 311 "Python/bytecodes.c" + #line 310 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(left), BINARY_OP); DEOPT_IF(!PyLong_CheckExact(right), BINARY_OP); #line 380 "Python/generated_cases.c.h" @@ -384,7 +384,7 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 332 "Python/bytecodes.c" + #line 331 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); res = _PyLong_Subtract((PyLongObject *)left, (PyLongObject *)right); _Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free); @@ -405,7 +405,7 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 347 "Python/bytecodes.c" + #line 346 "Python/bytecodes.c" DEOPT_IF(!PyFloat_CheckExact(left), BINARY_OP); DEOPT_IF(!PyFloat_CheckExact(right), BINARY_OP); #line 412 "Python/generated_cases.c.h" @@ -416,7 +416,7 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 352 "Python/bytecodes.c" + #line 351 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); double dres = ((PyFloatObject *)left)->ob_fval * @@ -437,7 +437,7 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 347 "Python/bytecodes.c" + #line 346 "Python/bytecodes.c" DEOPT_IF(!PyFloat_CheckExact(left), BINARY_OP); DEOPT_IF(!PyFloat_CheckExact(right), BINARY_OP); #line 444 "Python/generated_cases.c.h" @@ -448,7 +448,7 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 360 "Python/bytecodes.c" + #line 359 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); double dres = ((PyFloatObject *)left)->ob_fval + @@ -469,7 +469,7 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 347 "Python/bytecodes.c" + #line 346 "Python/bytecodes.c" DEOPT_IF(!PyFloat_CheckExact(left), BINARY_OP); DEOPT_IF(!PyFloat_CheckExact(right), BINARY_OP); #line 476 "Python/generated_cases.c.h" @@ -480,7 +480,7 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 368 "Python/bytecodes.c" + #line 367 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); double dres = ((PyFloatObject *)left)->ob_fval - @@ -501,7 +501,7 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 383 "Python/bytecodes.c" + #line 382 "Python/bytecodes.c" DEOPT_IF(!PyUnicode_CheckExact(left), BINARY_OP); DEOPT_IF(!PyUnicode_CheckExact(right), BINARY_OP); #line 508 "Python/generated_cases.c.h" @@ -512,7 +512,7 @@ PyObject *right = _tmp_1; PyObject *left = _tmp_2; PyObject *res; - #line 388 "Python/bytecodes.c" + #line 387 "Python/bytecodes.c" STAT_INC(BINARY_OP, hit); res = PyUnicode_Concat(left, right); _Py_DECREF_SPECIALIZED(left, _PyUnicode_ExactDealloc); @@ -533,7 +533,7 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 383 "Python/bytecodes.c" + #line 382 "Python/bytecodes.c" DEOPT_IF(!PyUnicode_CheckExact(left), BINARY_OP); DEOPT_IF(!PyUnicode_CheckExact(right), BINARY_OP); #line 540 "Python/generated_cases.c.h" @@ -543,7 +543,7 @@ { PyObject *right = _tmp_1; PyObject *left = _tmp_2; - #line 405 "Python/bytecodes.c" + #line 404 "Python/bytecodes.c" _Py_CODEUNIT true_next = next_instr[INLINE_CACHE_ENTRIES_BINARY_OP]; assert(true_next.op.code == STORE_FAST); PyObject **target_local = &GETLOCAL(true_next.op.arg); @@ -579,7 +579,7 @@ PyObject *sub = stack_pointer[-1]; PyObject *container = stack_pointer[-2]; PyObject *res; - #line 442 "Python/bytecodes.c" + #line 441 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyBinarySubscrCache *cache = (_PyBinarySubscrCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -594,7 +594,7 @@ #line 595 "Python/generated_cases.c.h" Py_DECREF(container); Py_DECREF(sub); - #line 454 "Python/bytecodes.c" + #line 453 "Python/bytecodes.c" if (res == NULL) goto pop_2_error; #line 600 "Python/generated_cases.c.h" STACK_SHRINK(1); @@ -608,7 +608,7 @@ PyObject *start = stack_pointer[-2]; PyObject *container = stack_pointer[-3]; PyObject *res; - #line 458 "Python/bytecodes.c" + #line 457 "Python/bytecodes.c" PyObject *slice = _PyBuildSlice_ConsumeRefs(start, stop); // Can't use ERROR_IF() here, because we haven't // DECREF'ed container yet, and we still own slice. @@ -632,7 +632,7 @@ PyObject *start = stack_pointer[-2]; PyObject *container = stack_pointer[-3]; PyObject *v = stack_pointer[-4]; - #line 473 "Python/bytecodes.c" + #line 472 "Python/bytecodes.c" PyObject *slice = _PyBuildSlice_ConsumeRefs(start, stop); int err; if (slice == NULL) { @@ -654,7 +654,7 @@ PyObject *sub = stack_pointer[-1]; PyObject *list = stack_pointer[-2]; PyObject *res; - #line 488 "Python/bytecodes.c" + #line 487 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(sub), BINARY_SUBSCR); DEOPT_IF(!PyList_CheckExact(list), BINARY_SUBSCR); @@ -679,7 +679,7 @@ PyObject *sub = stack_pointer[-1]; PyObject *tuple = stack_pointer[-2]; PyObject *res; - #line 504 "Python/bytecodes.c" + #line 503 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(sub), BINARY_SUBSCR); DEOPT_IF(!PyTuple_CheckExact(tuple), BINARY_SUBSCR); @@ -704,7 +704,7 @@ PyObject *sub = stack_pointer[-1]; PyObject *dict = stack_pointer[-2]; PyObject *res; - #line 520 "Python/bytecodes.c" + #line 519 "Python/bytecodes.c" DEOPT_IF(!PyDict_CheckExact(dict), BINARY_SUBSCR); STAT_INC(BINARY_SUBSCR, hit); res = PyDict_GetItemWithError(dict, sub); @@ -715,7 +715,7 @@ #line 716 "Python/generated_cases.c.h" Py_DECREF(dict); Py_DECREF(sub); - #line 528 "Python/bytecodes.c" + #line 527 "Python/bytecodes.c" if (true) goto pop_2_error; } Py_INCREF(res); // Do this before DECREF'ing dict, sub @@ -731,7 +731,7 @@ TARGET(BINARY_SUBSCR_GETITEM) { PyObject *sub = stack_pointer[-1]; PyObject *container = stack_pointer[-2]; - #line 535 "Python/bytecodes.c" + #line 534 "Python/bytecodes.c" DEOPT_IF(tstate->interp->eval_frame, BINARY_SUBSCR); PyTypeObject *tp = Py_TYPE(container); DEOPT_IF(!PyType_HasFeature(tp, Py_TPFLAGS_HEAPTYPE), BINARY_SUBSCR); @@ -760,7 +760,7 @@ TARGET(LIST_APPEND) { PyObject *v = stack_pointer[-1]; PyObject *list = stack_pointer[-(2 + (oparg-1))]; - #line 560 "Python/bytecodes.c" + #line 559 "Python/bytecodes.c" if (_PyList_AppendTakeRef((PyListObject *)list, v) < 0) goto pop_1_error; #line 766 "Python/generated_cases.c.h" STACK_SHRINK(1); @@ -770,11 +770,11 @@ TARGET(SET_ADD) { PyObject *v = stack_pointer[-1]; PyObject *set = stack_pointer[-(2 + (oparg-1))]; - #line 564 "Python/bytecodes.c" + #line 563 "Python/bytecodes.c" int err = PySet_Add(set, v); #line 776 "Python/generated_cases.c.h" Py_DECREF(v); - #line 566 "Python/bytecodes.c" + #line 565 "Python/bytecodes.c" if (err) goto pop_1_error; #line 780 "Python/generated_cases.c.h" STACK_SHRINK(1); @@ -788,7 +788,7 @@ PyObject *container = stack_pointer[-2]; PyObject *v = stack_pointer[-3]; uint16_t counter = read_u16(&next_instr[0].cache); - #line 576 "Python/bytecodes.c" + #line 575 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION if (ADAPTIVE_COUNTER_IS_ZERO(counter)) { next_instr--; @@ -807,7 +807,7 @@ Py_DECREF(v); Py_DECREF(container); Py_DECREF(sub); - #line 591 "Python/bytecodes.c" + #line 590 "Python/bytecodes.c" if (err) goto pop_3_error; #line 813 "Python/generated_cases.c.h" STACK_SHRINK(3); @@ -819,7 +819,7 @@ PyObject *sub = stack_pointer[-1]; PyObject *list = stack_pointer[-2]; PyObject *value = stack_pointer[-3]; - #line 595 "Python/bytecodes.c" + #line 594 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(sub), STORE_SUBSCR); DEOPT_IF(!PyList_CheckExact(list), STORE_SUBSCR); @@ -846,7 +846,7 @@ PyObject *sub = stack_pointer[-1]; PyObject *dict = stack_pointer[-2]; PyObject *value = stack_pointer[-3]; - #line 614 "Python/bytecodes.c" + #line 613 "Python/bytecodes.c" DEOPT_IF(!PyDict_CheckExact(dict), STORE_SUBSCR); STAT_INC(STORE_SUBSCR, hit); int err = _PyDict_SetItem_Take2((PyDictObject *)dict, sub, value); @@ -861,13 +861,13 @@ TARGET(DELETE_SUBSCR) { PyObject *sub = stack_pointer[-1]; PyObject *container = stack_pointer[-2]; - #line 622 "Python/bytecodes.c" + #line 621 "Python/bytecodes.c" /* del container[sub] */ int err = PyObject_DelItem(container, sub); #line 868 "Python/generated_cases.c.h" Py_DECREF(container); Py_DECREF(sub); - #line 625 "Python/bytecodes.c" + #line 624 "Python/bytecodes.c" if (err) goto pop_2_error; #line 873 "Python/generated_cases.c.h" STACK_SHRINK(2); @@ -877,12 +877,12 @@ TARGET(CALL_INTRINSIC_1) { PyObject *value = stack_pointer[-1]; PyObject *res; - #line 629 "Python/bytecodes.c" + #line 628 "Python/bytecodes.c" assert(oparg <= MAX_INTRINSIC_1); res = _PyIntrinsics_UnaryFunctions[oparg](tstate, value); #line 884 "Python/generated_cases.c.h" Py_DECREF(value); - #line 632 "Python/bytecodes.c" + #line 631 "Python/bytecodes.c" if (res == NULL) goto pop_1_error; #line 888 "Python/generated_cases.c.h" stack_pointer[-1] = res; @@ -893,13 +893,13 @@ PyObject *value1 = stack_pointer[-1]; PyObject *value2 = stack_pointer[-2]; PyObject *res; - #line 636 "Python/bytecodes.c" + #line 635 "Python/bytecodes.c" assert(oparg <= MAX_INTRINSIC_2); res = _PyIntrinsics_BinaryFunctions[oparg](tstate, value2, value1); #line 900 "Python/generated_cases.c.h" Py_DECREF(value2); Py_DECREF(value1); - #line 639 "Python/bytecodes.c" + #line 638 "Python/bytecodes.c" if (res == NULL) goto pop_2_error; #line 905 "Python/generated_cases.c.h" STACK_SHRINK(1); @@ -909,7 +909,7 @@ TARGET(RAISE_VARARGS) { PyObject **args = (stack_pointer - oparg); - #line 643 "Python/bytecodes.c" + #line 642 "Python/bytecodes.c" PyObject *cause = NULL, *exc = NULL; switch (oparg) { case 2: @@ -932,7 +932,7 @@ TARGET(INTERPRETER_EXIT) { PyObject *retval = stack_pointer[-1]; - #line 663 "Python/bytecodes.c" + #line 662 "Python/bytecodes.c" assert(frame == &entry_frame); assert(_PyFrame_IsIncomplete(frame)); STACK_SHRINK(1); // Since we're not going to DISPATCH() @@ -948,7 +948,7 @@ TARGET(RETURN_VALUE) { PyObject *retval = stack_pointer[-1]; - #line 676 "Python/bytecodes.c" + #line 675 "Python/bytecodes.c" STACK_SHRINK(1); assert(EMPTY()); _PyFrame_SetStackPointer(frame, stack_pointer); @@ -966,7 +966,7 @@ TARGET(INSTRUMENTED_RETURN_VALUE) { PyObject *retval = stack_pointer[-1]; - #line 691 "Python/bytecodes.c" + #line 690 "Python/bytecodes.c" int err = _Py_call_instrumentation_arg( tstate, PY_MONITORING_EVENT_PY_RETURN, frame, next_instr-1, retval); @@ -987,7 +987,7 @@ } TARGET(RETURN_CONST) { - #line 710 "Python/bytecodes.c" + #line 709 "Python/bytecodes.c" PyObject *retval = GETITEM(frame->f_code->co_consts, oparg); Py_INCREF(retval); assert(EMPTY()); @@ -1005,7 +1005,7 @@ } TARGET(INSTRUMENTED_RETURN_CONST) { - #line 726 "Python/bytecodes.c" + #line 725 "Python/bytecodes.c" PyObject *retval = GETITEM(frame->f_code->co_consts, oparg); int err = _Py_call_instrumentation_arg( tstate, PY_MONITORING_EVENT_PY_RETURN, @@ -1029,7 +1029,7 @@ TARGET(GET_AITER) { PyObject *obj = stack_pointer[-1]; PyObject *iter; - #line 746 "Python/bytecodes.c" + #line 745 "Python/bytecodes.c" unaryfunc getter = NULL; PyTypeObject *type = Py_TYPE(obj); @@ -1044,14 +1044,14 @@ type->tp_name); #line 1046 "Python/generated_cases.c.h" Py_DECREF(obj); - #line 759 "Python/bytecodes.c" + #line 758 "Python/bytecodes.c" if (true) goto pop_1_error; } iter = (*getter)(obj); #line 1053 "Python/generated_cases.c.h" Py_DECREF(obj); - #line 764 "Python/bytecodes.c" + #line 763 "Python/bytecodes.c" if (iter == NULL) goto pop_1_error; if (Py_TYPE(iter)->tp_as_async == NULL || @@ -1072,7 +1072,7 @@ TARGET(GET_ANEXT) { PyObject *aiter = stack_pointer[-1]; PyObject *awaitable; - #line 779 "Python/bytecodes.c" + #line 778 "Python/bytecodes.c" unaryfunc getter = NULL; PyObject *next_iter = NULL; PyTypeObject *type = Py_TYPE(aiter); @@ -1124,7 +1124,7 @@ TARGET(GET_AWAITABLE) { PyObject *iterable = stack_pointer[-1]; PyObject *iter; - #line 824 "Python/bytecodes.c" + #line 823 "Python/bytecodes.c" iter = _PyCoro_GetAwaitableIter(iterable); if (iter == NULL) { @@ -1133,7 +1133,7 @@ #line 1135 "Python/generated_cases.c.h" Py_DECREF(iterable); - #line 831 "Python/bytecodes.c" + #line 830 "Python/bytecodes.c" if (iter != NULL && PyCoro_CheckExact(iter)) { PyObject *yf = _PyGen_yf((PyGenObject*)iter); @@ -1161,7 +1161,7 @@ PyObject *v = stack_pointer[-1]; PyObject *receiver = stack_pointer[-2]; PyObject *retval; - #line 855 "Python/bytecodes.c" + #line 854 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PySendCache *cache = (_PySendCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -1217,7 +1217,7 @@ TARGET(SEND_GEN) { PyObject *v = stack_pointer[-1]; PyObject *receiver = stack_pointer[-2]; - #line 904 "Python/bytecodes.c" + #line 903 "Python/bytecodes.c" DEOPT_IF(tstate->interp->eval_frame, SEND); PyGenObject *gen = (PyGenObject *)receiver; DEOPT_IF(Py_TYPE(gen) != &PyGen_Type && @@ -1238,7 +1238,7 @@ TARGET(INSTRUMENTED_YIELD_VALUE) { PyObject *retval = stack_pointer[-1]; - #line 922 "Python/bytecodes.c" + #line 921 "Python/bytecodes.c" assert(frame != &entry_frame); PyGenObject *gen = _PyFrame_GetGenerator(frame); gen->gi_frame_state = FRAME_SUSPENDED; @@ -1260,7 +1260,7 @@ TARGET(YIELD_VALUE) { PyObject *retval = stack_pointer[-1]; - #line 941 "Python/bytecodes.c" + #line 940 "Python/bytecodes.c" // NOTE: It's important that YIELD_VALUE never raises an exception! // The compiler treats any exception raised here as a failed close() // or throw() call. @@ -1281,7 +1281,7 @@ TARGET(POP_EXCEPT) { PyObject *exc_value = stack_pointer[-1]; - #line 959 "Python/bytecodes.c" + #line 958 "Python/bytecodes.c" _PyErr_StackItem *exc_info = tstate->exc_info; Py_XSETREF(exc_info->exc_value, exc_value); #line 1288 "Python/generated_cases.c.h" @@ -1292,7 +1292,7 @@ TARGET(RERAISE) { PyObject *exc = stack_pointer[-1]; PyObject **values = (stack_pointer - (1 + oparg)); - #line 964 "Python/bytecodes.c" + #line 963 "Python/bytecodes.c" assert(oparg >= 0 && oparg <= 2); if (oparg) { PyObject *lasti = values[0]; @@ -1316,13 +1316,13 @@ TARGET(END_ASYNC_FOR) { PyObject *exc = stack_pointer[-1]; PyObject *awaitable = stack_pointer[-2]; - #line 984 "Python/bytecodes.c" + #line 983 "Python/bytecodes.c" assert(exc && PyExceptionInstance_Check(exc)); if (PyErr_GivenExceptionMatches(exc, PyExc_StopAsyncIteration)) { #line 1323 "Python/generated_cases.c.h" Py_DECREF(awaitable); Py_DECREF(exc); - #line 987 "Python/bytecodes.c" + #line 986 "Python/bytecodes.c" } else { Py_INCREF(exc); @@ -1340,7 +1340,7 @@ PyObject *sub_iter = stack_pointer[-3]; PyObject *none; PyObject *value; - #line 996 "Python/bytecodes.c" + #line 995 "Python/bytecodes.c" assert(throwflag); assert(exc_value && PyExceptionInstance_Check(exc_value)); if (PyErr_GivenExceptionMatches(exc_value, PyExc_StopIteration)) { @@ -1349,7 +1349,7 @@ Py_DECREF(sub_iter); Py_DECREF(last_sent_val); Py_DECREF(exc_value); - #line 1001 "Python/bytecodes.c" + #line 1000 "Python/bytecodes.c" none = Py_None; } else { @@ -1365,7 +1365,7 @@ TARGET(LOAD_ASSERTION_ERROR) { PyObject *value; - #line 1010 "Python/bytecodes.c" + #line 1009 "Python/bytecodes.c" value = Py_NewRef(PyExc_AssertionError); #line 1371 "Python/generated_cases.c.h" STACK_GROW(1); @@ -1375,7 +1375,7 @@ TARGET(LOAD_BUILD_CLASS) { PyObject *bc; - #line 1014 "Python/bytecodes.c" + #line 1013 "Python/bytecodes.c" if (PyDict_CheckExact(BUILTINS())) { bc = _PyDict_GetItemWithError(BUILTINS(), &_Py_ID(__build_class__)); @@ -1405,7 +1405,7 @@ TARGET(STORE_NAME) { PyObject *v = stack_pointer[-1]; - #line 1039 "Python/bytecodes.c" + #line 1038 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); PyObject *ns = LOCALS(); int err; @@ -1414,7 +1414,7 @@ "no locals found when storing %R", name); #line 1416 "Python/generated_cases.c.h" Py_DECREF(v); - #line 1046 "Python/bytecodes.c" + #line 1045 "Python/bytecodes.c" if (true) goto pop_1_error; } if (PyDict_CheckExact(ns)) @@ -1423,7 +1423,7 @@ err = PyObject_SetItem(ns, name, v); #line 1425 "Python/generated_cases.c.h" Py_DECREF(v); - #line 1053 "Python/bytecodes.c" + #line 1052 "Python/bytecodes.c" if (err) goto pop_1_error; #line 1429 "Python/generated_cases.c.h" STACK_SHRINK(1); @@ -1431,7 +1431,7 @@ } TARGET(DELETE_NAME) { - #line 1057 "Python/bytecodes.c" + #line 1056 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); PyObject *ns = LOCALS(); int err; @@ -1456,7 +1456,7 @@ PREDICTED(UNPACK_SEQUENCE); static_assert(INLINE_CACHE_ENTRIES_UNPACK_SEQUENCE == 1, "incorrect cache size"); PyObject *seq = stack_pointer[-1]; - #line 1083 "Python/bytecodes.c" + #line 1082 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyUnpackSequenceCache *cache = (_PyUnpackSequenceCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -1471,7 +1471,7 @@ int res = unpack_iterable(tstate, seq, oparg, -1, top); #line 1473 "Python/generated_cases.c.h" Py_DECREF(seq); - #line 1096 "Python/bytecodes.c" + #line 1095 "Python/bytecodes.c" if (res == 0) goto pop_1_error; #line 1477 "Python/generated_cases.c.h" STACK_SHRINK(1); @@ -1483,7 +1483,7 @@ TARGET(UNPACK_SEQUENCE_TWO_TUPLE) { PyObject *seq = stack_pointer[-1]; PyObject **values = stack_pointer - (1); - #line 1100 "Python/bytecodes.c" + #line 1099 "Python/bytecodes.c" DEOPT_IF(!PyTuple_CheckExact(seq), UNPACK_SEQUENCE); DEOPT_IF(PyTuple_GET_SIZE(seq) != 2, UNPACK_SEQUENCE); assert(oparg == 2); @@ -1501,7 +1501,7 @@ TARGET(UNPACK_SEQUENCE_TUPLE) { PyObject *seq = stack_pointer[-1]; PyObject **values = stack_pointer - (1); - #line 1110 "Python/bytecodes.c" + #line 1109 "Python/bytecodes.c" DEOPT_IF(!PyTuple_CheckExact(seq), UNPACK_SEQUENCE); DEOPT_IF(PyTuple_GET_SIZE(seq) != oparg, UNPACK_SEQUENCE); STAT_INC(UNPACK_SEQUENCE, hit); @@ -1520,7 +1520,7 @@ TARGET(UNPACK_SEQUENCE_LIST) { PyObject *seq = stack_pointer[-1]; PyObject **values = stack_pointer - (1); - #line 1121 "Python/bytecodes.c" + #line 1120 "Python/bytecodes.c" DEOPT_IF(!PyList_CheckExact(seq), UNPACK_SEQUENCE); DEOPT_IF(PyList_GET_SIZE(seq) != oparg, UNPACK_SEQUENCE); STAT_INC(UNPACK_SEQUENCE, hit); @@ -1538,13 +1538,13 @@ TARGET(UNPACK_EX) { PyObject *seq = stack_pointer[-1]; - #line 1132 "Python/bytecodes.c" + #line 1131 "Python/bytecodes.c" int totalargs = 1 + (oparg & 0xFF) + (oparg >> 8); PyObject **top = stack_pointer + totalargs - 1; int res = unpack_iterable(tstate, seq, oparg & 0xFF, oparg >> 8, top); #line 1546 "Python/generated_cases.c.h" Py_DECREF(seq); - #line 1136 "Python/bytecodes.c" + #line 1135 "Python/bytecodes.c" if (res == 0) goto pop_1_error; #line 1550 "Python/generated_cases.c.h" STACK_GROW((oparg & 0xFF) + (oparg >> 8)); @@ -1557,7 +1557,7 @@ PyObject *owner = stack_pointer[-1]; PyObject *v = stack_pointer[-2]; uint16_t counter = read_u16(&next_instr[0].cache); - #line 1147 "Python/bytecodes.c" + #line 1146 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION if (ADAPTIVE_COUNTER_IS_ZERO(counter)) { PyObject *name = GETITEM(frame->f_code->co_names, oparg); @@ -1576,7 +1576,7 @@ #line 1577 "Python/generated_cases.c.h" Py_DECREF(v); Py_DECREF(owner); - #line 1163 "Python/bytecodes.c" + #line 1162 "Python/bytecodes.c" if (err) goto pop_2_error; #line 1582 "Python/generated_cases.c.h" STACK_SHRINK(2); @@ -1586,12 +1586,12 @@ TARGET(DELETE_ATTR) { PyObject *owner = stack_pointer[-1]; - #line 1167 "Python/bytecodes.c" + #line 1166 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); int err = PyObject_SetAttr(owner, name, (PyObject *)NULL); #line 1593 "Python/generated_cases.c.h" Py_DECREF(owner); - #line 1170 "Python/bytecodes.c" + #line 1169 "Python/bytecodes.c" if (err) goto pop_1_error; #line 1597 "Python/generated_cases.c.h" STACK_SHRINK(1); @@ -1600,12 +1600,12 @@ TARGET(STORE_GLOBAL) { PyObject *v = stack_pointer[-1]; - #line 1174 "Python/bytecodes.c" + #line 1173 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); int err = PyDict_SetItem(GLOBALS(), name, v); #line 1607 "Python/generated_cases.c.h" Py_DECREF(v); - #line 1177 "Python/bytecodes.c" + #line 1176 "Python/bytecodes.c" if (err) goto pop_1_error; #line 1611 "Python/generated_cases.c.h" STACK_SHRINK(1); @@ -1613,7 +1613,7 @@ } TARGET(DELETE_GLOBAL) { - #line 1181 "Python/bytecodes.c" + #line 1180 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); int err; err = PyDict_DelItem(GLOBALS(), name); @@ -1633,7 +1633,7 @@ PyObject *_tmp_1; { PyObject *locals; - #line 1195 "Python/bytecodes.c" + #line 1194 "Python/bytecodes.c" locals = LOCALS(); if (locals == NULL) { _PyErr_SetString(tstate, PyExc_SystemError, @@ -1653,7 +1653,7 @@ PyObject *_tmp_1; { PyObject *locals; - #line 1195 "Python/bytecodes.c" + #line 1194 "Python/bytecodes.c" locals = LOCALS(); if (locals == NULL) { _PyErr_SetString(tstate, PyExc_SystemError, @@ -1667,7 +1667,7 @@ { PyObject *mod_or_class_dict = _tmp_1; PyObject *v; - #line 1207 "Python/bytecodes.c" + #line 1206 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); if (PyDict_CheckExact(mod_or_class_dict)) { v = PyDict_GetItemWithError(mod_or_class_dict, name); @@ -1737,7 +1737,7 @@ { PyObject *mod_or_class_dict = _tmp_1; PyObject *v; - #line 1207 "Python/bytecodes.c" + #line 1206 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); if (PyDict_CheckExact(mod_or_class_dict)) { v = PyDict_GetItemWithError(mod_or_class_dict, name); @@ -1806,7 +1806,7 @@ static_assert(INLINE_CACHE_ENTRIES_LOAD_GLOBAL == 4, "incorrect cache size"); PyObject *null = NULL; PyObject *v; - #line 1276 "Python/bytecodes.c" + #line 1275 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyLoadGlobalCache *cache = (_PyLoadGlobalCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -1872,7 +1872,7 @@ PyObject *res; uint16_t index = read_u16(&next_instr[1].cache); uint16_t version = read_u16(&next_instr[2].cache); - #line 1330 "Python/bytecodes.c" + #line 1329 "Python/bytecodes.c" DEOPT_IF(!PyDict_CheckExact(GLOBALS()), LOAD_GLOBAL); PyDictObject *dict = (PyDictObject *)GLOBALS(); DEOPT_IF(dict->ma_keys->dk_version != version, LOAD_GLOBAL); @@ -1898,7 +1898,7 @@ uint16_t index = read_u16(&next_instr[1].cache); uint16_t mod_version = read_u16(&next_instr[2].cache); uint16_t bltn_version = read_u16(&next_instr[3].cache); - #line 1343 "Python/bytecodes.c" + #line 1342 "Python/bytecodes.c" DEOPT_IF(!PyDict_CheckExact(GLOBALS()), LOAD_GLOBAL); DEOPT_IF(!PyDict_CheckExact(BUILTINS()), LOAD_GLOBAL); PyDictObject *mdict = (PyDictObject *)GLOBALS(); @@ -1923,7 +1923,7 @@ } TARGET(DELETE_FAST) { - #line 1360 "Python/bytecodes.c" + #line 1359 "Python/bytecodes.c" PyObject *v = GETLOCAL(oparg); if (v == NULL) goto unbound_local_error; SETLOCAL(oparg, NULL); @@ -1932,7 +1932,7 @@ } TARGET(MAKE_CELL) { - #line 1366 "Python/bytecodes.c" + #line 1365 "Python/bytecodes.c" // "initial" is probably NULL but not if it's an arg (or set // via PyFrame_LocalsToFast() before MAKE_CELL has run). PyObject *initial = GETLOCAL(oparg); @@ -1946,7 +1946,7 @@ } TARGET(DELETE_DEREF) { - #line 1377 "Python/bytecodes.c" + #line 1376 "Python/bytecodes.c" PyObject *cell = GETLOCAL(oparg); PyObject *oldobj = PyCell_GET(cell); // Can't use ERROR_IF here. @@ -1964,7 +1964,7 @@ TARGET(LOAD_FROM_DICT_OR_DEREF) { PyObject *class_dict = stack_pointer[-1]; PyObject *value; - #line 1390 "Python/bytecodes.c" + #line 1389 "Python/bytecodes.c" PyObject *name; assert(class_dict); assert(oparg >= 0 && oparg < frame->f_code->co_nlocalsplus); @@ -2006,7 +2006,7 @@ TARGET(LOAD_DEREF) { PyObject *value; - #line 1427 "Python/bytecodes.c" + #line 1426 "Python/bytecodes.c" PyObject *cell = GETLOCAL(oparg); value = PyCell_GET(cell); if (value == NULL) { @@ -2022,7 +2022,7 @@ TARGET(STORE_DEREF) { PyObject *v = stack_pointer[-1]; - #line 1437 "Python/bytecodes.c" + #line 1436 "Python/bytecodes.c" PyObject *cell = GETLOCAL(oparg); PyObject *oldobj = PyCell_GET(cell); PyCell_SET(cell, v); @@ -2033,7 +2033,7 @@ } TARGET(COPY_FREE_VARS) { - #line 1444 "Python/bytecodes.c" + #line 1443 "Python/bytecodes.c" /* Copy closure variables to free variables */ PyCodeObject *co = frame->f_code; assert(PyFunction_Check(frame->f_funcobj)); @@ -2051,13 +2051,13 @@ TARGET(BUILD_STRING) { PyObject **pieces = (stack_pointer - oparg); PyObject *str; - #line 1457 "Python/bytecodes.c" + #line 1456 "Python/bytecodes.c" str = _PyUnicode_JoinArray(&_Py_STR(empty), pieces, oparg); #line 2057 "Python/generated_cases.c.h" for (int _i = oparg; --_i >= 0;) { Py_DECREF(pieces[_i]); } - #line 1459 "Python/bytecodes.c" + #line 1458 "Python/bytecodes.c" if (str == NULL) { STACK_SHRINK(oparg); goto error; } #line 2063 "Python/generated_cases.c.h" STACK_SHRINK(oparg); @@ -2069,7 +2069,7 @@ TARGET(BUILD_TUPLE) { PyObject **values = (stack_pointer - oparg); PyObject *tup; - #line 1463 "Python/bytecodes.c" + #line 1462 "Python/bytecodes.c" tup = _PyTuple_FromArraySteal(values, oparg); if (tup == NULL) { STACK_SHRINK(oparg); goto error; } #line 2076 "Python/generated_cases.c.h" @@ -2082,7 +2082,7 @@ TARGET(BUILD_LIST) { PyObject **values = (stack_pointer - oparg); PyObject *list; - #line 1468 "Python/bytecodes.c" + #line 1467 "Python/bytecodes.c" list = _PyList_FromArraySteal(values, oparg); if (list == NULL) { STACK_SHRINK(oparg); goto error; } #line 2089 "Python/generated_cases.c.h" @@ -2095,7 +2095,7 @@ TARGET(LIST_EXTEND) { PyObject *iterable = stack_pointer[-1]; PyObject *list = stack_pointer[-(2 + (oparg-1))]; - #line 1473 "Python/bytecodes.c" + #line 1472 "Python/bytecodes.c" PyObject *none_val = _PyList_Extend((PyListObject *)list, iterable); if (none_val == NULL) { if (_PyErr_ExceptionMatches(tstate, PyExc_TypeError) && @@ -2108,7 +2108,7 @@ } #line 2110 "Python/generated_cases.c.h" Py_DECREF(iterable); - #line 1484 "Python/bytecodes.c" + #line 1483 "Python/bytecodes.c" if (true) goto pop_1_error; } assert(Py_IsNone(none_val)); @@ -2121,11 +2121,11 @@ TARGET(SET_UPDATE) { PyObject *iterable = stack_pointer[-1]; PyObject *set = stack_pointer[-(2 + (oparg-1))]; - #line 1491 "Python/bytecodes.c" + #line 1490 "Python/bytecodes.c" int err = _PySet_Update(set, iterable); #line 2127 "Python/generated_cases.c.h" Py_DECREF(iterable); - #line 1493 "Python/bytecodes.c" + #line 1492 "Python/bytecodes.c" if (err < 0) goto pop_1_error; #line 2131 "Python/generated_cases.c.h" STACK_SHRINK(1); @@ -2135,7 +2135,7 @@ TARGET(BUILD_SET) { PyObject **values = (stack_pointer - oparg); PyObject *set; - #line 1497 "Python/bytecodes.c" + #line 1496 "Python/bytecodes.c" set = PySet_New(NULL); if (set == NULL) goto error; @@ -2160,7 +2160,7 @@ TARGET(BUILD_MAP) { PyObject **values = (stack_pointer - oparg*2); PyObject *map; - #line 1514 "Python/bytecodes.c" + #line 1513 "Python/bytecodes.c" map = _PyDict_FromItems( values, 2, values+1, 2, @@ -2172,7 +2172,7 @@ for (int _i = oparg*2; --_i >= 0;) { Py_DECREF(values[_i]); } - #line 1522 "Python/bytecodes.c" + #line 1521 "Python/bytecodes.c" if (map == NULL) { STACK_SHRINK(oparg*2); goto error; } #line 2178 "Python/generated_cases.c.h" STACK_SHRINK(oparg*2); @@ -2182,7 +2182,7 @@ } TARGET(SETUP_ANNOTATIONS) { - #line 1526 "Python/bytecodes.c" + #line 1525 "Python/bytecodes.c" int err; PyObject *ann_dict; if (LOCALS() == NULL) { @@ -2230,7 +2230,7 @@ PyObject *keys = stack_pointer[-1]; PyObject **values = (stack_pointer - (1 + oparg)); PyObject *map; - #line 1568 "Python/bytecodes.c" + #line 1567 "Python/bytecodes.c" if (!PyTuple_CheckExact(keys) || PyTuple_GET_SIZE(keys) != (Py_ssize_t)oparg) { _PyErr_SetString(tstate, PyExc_SystemError, @@ -2245,7 +2245,7 @@ Py_DECREF(values[_i]); } Py_DECREF(keys); - #line 1578 "Python/bytecodes.c" + #line 1577 "Python/bytecodes.c" if (map == NULL) { STACK_SHRINK(oparg); goto pop_1_error; } #line 2251 "Python/generated_cases.c.h" STACK_SHRINK(oparg); @@ -2255,7 +2255,7 @@ TARGET(DICT_UPDATE) { PyObject *update = stack_pointer[-1]; - #line 1582 "Python/bytecodes.c" + #line 1581 "Python/bytecodes.c" PyObject *dict = PEEK(oparg + 1); // update is still on the stack if (PyDict_Update(dict, update) < 0) { if (_PyErr_ExceptionMatches(tstate, PyExc_AttributeError)) { @@ -2265,7 +2265,7 @@ } #line 2267 "Python/generated_cases.c.h" Py_DECREF(update); - #line 1590 "Python/bytecodes.c" + #line 1589 "Python/bytecodes.c" if (true) goto pop_1_error; } #line 2272 "Python/generated_cases.c.h" @@ -2276,14 +2276,14 @@ TARGET(DICT_MERGE) { PyObject *update = stack_pointer[-1]; - #line 1596 "Python/bytecodes.c" + #line 1595 "Python/bytecodes.c" PyObject *dict = PEEK(oparg + 1); // update is still on the stack if (_PyDict_MergeEx(dict, update, 2) < 0) { format_kwargs_error(tstate, PEEK(3 + oparg), update); #line 2285 "Python/generated_cases.c.h" Py_DECREF(update); - #line 1601 "Python/bytecodes.c" + #line 1600 "Python/bytecodes.c" if (true) goto pop_1_error; } #line 2290 "Python/generated_cases.c.h" @@ -2295,7 +2295,7 @@ TARGET(MAP_ADD) { PyObject *value = stack_pointer[-1]; PyObject *key = stack_pointer[-2]; - #line 1607 "Python/bytecodes.c" + #line 1606 "Python/bytecodes.c" PyObject *dict = PEEK(oparg + 2); // key, value are still on the stack assert(PyDict_CheckExact(dict)); /* dict[key] = value */ @@ -2307,7 +2307,7 @@ } TARGET(INSTRUMENTED_LOAD_SUPER_ATTR) { - #line 1615 "Python/bytecodes.c" + #line 1614 "Python/bytecodes.c" _PySuperAttrCache *cache = (_PySuperAttrCache *)next_instr; // cancel out the decrement that will happen in LOAD_SUPER_ATTR; we // don't want to specialize instrumented instructions @@ -2324,7 +2324,7 @@ PyObject *global_super = stack_pointer[-3]; PyObject *res2 = NULL; PyObject *res; - #line 1629 "Python/bytecodes.c" + #line 1628 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg >> 2); int load_method = oparg & 1; #if ENABLE_SPECIALIZATION @@ -2370,7 +2370,7 @@ Py_DECREF(global_super); Py_DECREF(class); Py_DECREF(self); - #line 1671 "Python/bytecodes.c" + #line 1670 "Python/bytecodes.c" if (super == NULL) goto pop_3_error; res = PyObject_GetAttr(super, name); Py_DECREF(super); @@ -2390,7 +2390,7 @@ PyObject *global_super = stack_pointer[-3]; PyObject *res2 = NULL; PyObject *res; - #line 1678 "Python/bytecodes.c" + #line 1677 "Python/bytecodes.c" assert(!(oparg & 1)); DEOPT_IF(global_super != (PyObject *)&PySuper_Type, LOAD_SUPER_ATTR); DEOPT_IF(!PyType_Check(class), LOAD_SUPER_ATTR); @@ -2401,7 +2401,7 @@ Py_DECREF(global_super); Py_DECREF(class); Py_DECREF(self); - #line 1685 "Python/bytecodes.c" + #line 1684 "Python/bytecodes.c" if (res == NULL) goto pop_3_error; #line 2407 "Python/generated_cases.c.h" STACK_SHRINK(2); @@ -2418,7 +2418,7 @@ PyObject *global_super = stack_pointer[-3]; PyObject *res2; PyObject *res; - #line 1689 "Python/bytecodes.c" + #line 1688 "Python/bytecodes.c" assert(oparg & 1); DEOPT_IF(global_super != (PyObject *)&PySuper_Type, LOAD_SUPER_ATTR); DEOPT_IF(!PyType_Check(class), LOAD_SUPER_ATTR); @@ -2455,7 +2455,7 @@ PyObject *owner = stack_pointer[-1]; PyObject *res2 = NULL; PyObject *res; - #line 1728 "Python/bytecodes.c" + #line 1727 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyAttrCache *cache = (_PyAttrCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -2491,7 +2491,7 @@ */ #line 2493 "Python/generated_cases.c.h" Py_DECREF(owner); - #line 1762 "Python/bytecodes.c" + #line 1761 "Python/bytecodes.c" if (meth == NULL) goto pop_1_error; res2 = NULL; res = meth; @@ -2502,7 +2502,7 @@ res = PyObject_GetAttr(owner, name); #line 2504 "Python/generated_cases.c.h" Py_DECREF(owner); - #line 1771 "Python/bytecodes.c" + #line 1770 "Python/bytecodes.c" if (res == NULL) goto pop_1_error; } #line 2509 "Python/generated_cases.c.h" @@ -2519,7 +2519,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t index = read_u16(&next_instr[3].cache); - #line 1776 "Python/bytecodes.c" + #line 1775 "Python/bytecodes.c" PyTypeObject *tp = Py_TYPE(owner); assert(type_version != 0); DEOPT_IF(tp->tp_version_tag != type_version, LOAD_ATTR); @@ -2547,7 +2547,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t index = read_u16(&next_instr[3].cache); - #line 1792 "Python/bytecodes.c" + #line 1791 "Python/bytecodes.c" DEOPT_IF(!PyModule_CheckExact(owner), LOAD_ATTR); PyDictObject *dict = (PyDictObject *)((PyModuleObject *)owner)->md_dict; assert(dict != NULL); @@ -2575,7 +2575,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t index = read_u16(&next_instr[3].cache); - #line 1808 "Python/bytecodes.c" + #line 1807 "Python/bytecodes.c" PyTypeObject *tp = Py_TYPE(owner); assert(type_version != 0); DEOPT_IF(tp->tp_version_tag != type_version, LOAD_ATTR); @@ -2617,7 +2617,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t index = read_u16(&next_instr[3].cache); - #line 1838 "Python/bytecodes.c" + #line 1837 "Python/bytecodes.c" PyTypeObject *tp = Py_TYPE(owner); assert(type_version != 0); DEOPT_IF(tp->tp_version_tag != type_version, LOAD_ATTR); @@ -2642,7 +2642,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); PyObject *descr = read_obj(&next_instr[5].cache); - #line 1851 "Python/bytecodes.c" + #line 1850 "Python/bytecodes.c" DEOPT_IF(!PyType_Check(cls), LOAD_ATTR); DEOPT_IF(((PyTypeObject *)cls)->tp_version_tag != type_version, @@ -2668,7 +2668,7 @@ uint32_t type_version = read_u32(&next_instr[1].cache); uint32_t func_version = read_u32(&next_instr[3].cache); PyObject *fget = read_obj(&next_instr[5].cache); - #line 1866 "Python/bytecodes.c" + #line 1865 "Python/bytecodes.c" DEOPT_IF(tstate->interp->eval_frame, LOAD_ATTR); PyTypeObject *cls = Py_TYPE(owner); @@ -2700,7 +2700,7 @@ uint32_t type_version = read_u32(&next_instr[1].cache); uint32_t func_version = read_u32(&next_instr[3].cache); PyObject *getattribute = read_obj(&next_instr[5].cache); - #line 1892 "Python/bytecodes.c" + #line 1891 "Python/bytecodes.c" DEOPT_IF(tstate->interp->eval_frame, LOAD_ATTR); PyTypeObject *cls = Py_TYPE(owner); DEOPT_IF(cls->tp_version_tag != type_version, LOAD_ATTR); @@ -2734,7 +2734,7 @@ PyObject *value = stack_pointer[-2]; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t index = read_u16(&next_instr[3].cache); - #line 1920 "Python/bytecodes.c" + #line 1919 "Python/bytecodes.c" PyTypeObject *tp = Py_TYPE(owner); assert(type_version != 0); DEOPT_IF(tp->tp_version_tag != type_version, STORE_ATTR); @@ -2763,7 +2763,7 @@ PyObject *value = stack_pointer[-2]; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t hint = read_u16(&next_instr[3].cache); - #line 1940 "Python/bytecodes.c" + #line 1939 "Python/bytecodes.c" PyTypeObject *tp = Py_TYPE(owner); assert(type_version != 0); DEOPT_IF(tp->tp_version_tag != type_version, STORE_ATTR); @@ -2813,7 +2813,7 @@ PyObject *value = stack_pointer[-2]; uint32_t type_version = read_u32(&next_instr[1].cache); uint16_t index = read_u16(&next_instr[3].cache); - #line 1981 "Python/bytecodes.c" + #line 1980 "Python/bytecodes.c" PyTypeObject *tp = Py_TYPE(owner); assert(type_version != 0); DEOPT_IF(tp->tp_version_tag != type_version, STORE_ATTR); @@ -2835,7 +2835,7 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *res; - #line 2000 "Python/bytecodes.c" + #line 1999 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyCompareOpCache *cache = (_PyCompareOpCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -2851,7 +2851,7 @@ #line 2852 "Python/generated_cases.c.h" Py_DECREF(left); Py_DECREF(right); - #line 2013 "Python/bytecodes.c" + #line 2012 "Python/bytecodes.c" if (res == NULL) goto pop_2_error; #line 2857 "Python/generated_cases.c.h" STACK_SHRINK(1); @@ -2864,7 +2864,7 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *res; - #line 2017 "Python/bytecodes.c" + #line 2016 "Python/bytecodes.c" DEOPT_IF(!PyFloat_CheckExact(left), COMPARE_OP); DEOPT_IF(!PyFloat_CheckExact(right), COMPARE_OP); STAT_INC(COMPARE_OP, hit); @@ -2886,7 +2886,7 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *res; - #line 2031 "Python/bytecodes.c" + #line 2030 "Python/bytecodes.c" DEOPT_IF(!PyLong_CheckExact(left), COMPARE_OP); DEOPT_IF(!PyLong_CheckExact(right), COMPARE_OP); DEOPT_IF(!_PyLong_IsCompact((PyLongObject *)left), COMPARE_OP); @@ -2912,7 +2912,7 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *res; - #line 2049 "Python/bytecodes.c" + #line 2048 "Python/bytecodes.c" DEOPT_IF(!PyUnicode_CheckExact(left), COMPARE_OP); DEOPT_IF(!PyUnicode_CheckExact(right), COMPARE_OP); STAT_INC(COMPARE_OP, hit); @@ -2935,12 +2935,12 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *b; - #line 2063 "Python/bytecodes.c" + #line 2062 "Python/bytecodes.c" int res = Py_Is(left, right) ^ oparg; #line 2941 "Python/generated_cases.c.h" Py_DECREF(left); Py_DECREF(right); - #line 2065 "Python/bytecodes.c" + #line 2064 "Python/bytecodes.c" b = res ? Py_True : Py_False; #line 2946 "Python/generated_cases.c.h" STACK_SHRINK(1); @@ -2952,12 +2952,12 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *b; - #line 2069 "Python/bytecodes.c" + #line 2068 "Python/bytecodes.c" int res = PySequence_Contains(right, left); #line 2958 "Python/generated_cases.c.h" Py_DECREF(left); Py_DECREF(right); - #line 2071 "Python/bytecodes.c" + #line 2070 "Python/bytecodes.c" if (res < 0) goto pop_2_error; b = (res ^ oparg) ? Py_True : Py_False; #line 2964 "Python/generated_cases.c.h" @@ -2971,12 +2971,12 @@ PyObject *exc_value = stack_pointer[-2]; PyObject *rest; PyObject *match; - #line 2076 "Python/bytecodes.c" + #line 2075 "Python/bytecodes.c" if (check_except_star_type_valid(tstate, match_type) < 0) { #line 2977 "Python/generated_cases.c.h" Py_DECREF(exc_value); Py_DECREF(match_type); - #line 2078 "Python/bytecodes.c" + #line 2077 "Python/bytecodes.c" if (true) goto pop_2_error; } @@ -2987,7 +2987,7 @@ #line 2988 "Python/generated_cases.c.h" Py_DECREF(exc_value); Py_DECREF(match_type); - #line 2086 "Python/bytecodes.c" + #line 2085 "Python/bytecodes.c" if (res < 0) goto pop_2_error; assert((match == NULL) == (rest == NULL)); @@ -3006,19 +3006,19 @@ PyObject *right = stack_pointer[-1]; PyObject *left = stack_pointer[-2]; PyObject *b; - #line 2097 "Python/bytecodes.c" + #line 2096 "Python/bytecodes.c" assert(PyExceptionInstance_Check(left)); if (check_except_type_valid(tstate, right) < 0) { #line 3013 "Python/generated_cases.c.h" Py_DECREF(right); - #line 2100 "Python/bytecodes.c" + #line 2099 "Python/bytecodes.c" if (true) goto pop_1_error; } int res = PyErr_GivenExceptionMatches(left, right); #line 3020 "Python/generated_cases.c.h" Py_DECREF(right); - #line 2105 "Python/bytecodes.c" + #line 2104 "Python/bytecodes.c" b = res ? Py_True : Py_False; #line 3024 "Python/generated_cases.c.h" stack_pointer[-1] = b; @@ -3029,13 +3029,13 @@ PyObject *fromlist = stack_pointer[-1]; PyObject *level = stack_pointer[-2]; PyObject *res; - #line 2109 "Python/bytecodes.c" + #line 2108 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); res = import_name(tstate, frame, name, fromlist, level); #line 3036 "Python/generated_cases.c.h" Py_DECREF(level); Py_DECREF(fromlist); - #line 2112 "Python/bytecodes.c" + #line 2111 "Python/bytecodes.c" if (res == NULL) goto pop_2_error; #line 3041 "Python/generated_cases.c.h" STACK_SHRINK(1); @@ -3046,7 +3046,7 @@ TARGET(IMPORT_FROM) { PyObject *from = stack_pointer[-1]; PyObject *res; - #line 2116 "Python/bytecodes.c" + #line 2115 "Python/bytecodes.c" PyObject *name = GETITEM(frame->f_code->co_names, oparg); res = import_from(tstate, from, name); if (res == NULL) goto error; @@ -3057,14 +3057,14 @@ } TARGET(JUMP_FORWARD) { - #line 2122 "Python/bytecodes.c" + #line 2121 "Python/bytecodes.c" JUMPBY(oparg); #line 3063 "Python/generated_cases.c.h" DISPATCH(); } TARGET(JUMP_BACKWARD) { - #line 2126 "Python/bytecodes.c" + #line 2125 "Python/bytecodes.c" _Py_CODEUNIT *here = next_instr - 1; assert(oparg <= INSTR_OFFSET()); JUMPBY(1-oparg); @@ -3087,7 +3087,7 @@ } TARGET(ENTER_EXECUTOR) { - #line 2146 "Python/bytecodes.c" + #line 2145 "Python/bytecodes.c" _PyExecutorObject *executor = (_PyExecutorObject *)frame->f_code->co_executors->executors[oparg]; Py_INCREF(executor); frame = executor->execute(executor, frame, stack_pointer); @@ -3101,7 +3101,7 @@ TARGET(POP_JUMP_IF_FALSE) { PyObject *cond = stack_pointer[-1]; - #line 2157 "Python/bytecodes.c" + #line 2156 "Python/bytecodes.c" if (Py_IsFalse(cond)) { JUMPBY(oparg); } @@ -3109,7 +3109,7 @@ int err = PyObject_IsTrue(cond); #line 3111 "Python/generated_cases.c.h" Py_DECREF(cond); - #line 2163 "Python/bytecodes.c" + #line 2162 "Python/bytecodes.c" if (err == 0) { JUMPBY(oparg); } @@ -3124,7 +3124,7 @@ TARGET(POP_JUMP_IF_TRUE) { PyObject *cond = stack_pointer[-1]; - #line 2173 "Python/bytecodes.c" + #line 2172 "Python/bytecodes.c" if (Py_IsTrue(cond)) { JUMPBY(oparg); } @@ -3132,7 +3132,7 @@ int err = PyObject_IsTrue(cond); #line 3134 "Python/generated_cases.c.h" Py_DECREF(cond); - #line 2179 "Python/bytecodes.c" + #line 2178 "Python/bytecodes.c" if (err > 0) { JUMPBY(oparg); } @@ -3147,11 +3147,11 @@ TARGET(POP_JUMP_IF_NOT_NONE) { PyObject *value = stack_pointer[-1]; - #line 2189 "Python/bytecodes.c" + #line 2188 "Python/bytecodes.c" if (!Py_IsNone(value)) { #line 3153 "Python/generated_cases.c.h" Py_DECREF(value); - #line 2191 "Python/bytecodes.c" + #line 2190 "Python/bytecodes.c" JUMPBY(oparg); } #line 3158 "Python/generated_cases.c.h" @@ -3161,14 +3161,14 @@ TARGET(POP_JUMP_IF_NONE) { PyObject *value = stack_pointer[-1]; - #line 2196 "Python/bytecodes.c" + #line 2195 "Python/bytecodes.c" if (Py_IsNone(value)) { JUMPBY(oparg); } else { #line 3170 "Python/generated_cases.c.h" Py_DECREF(value); - #line 2201 "Python/bytecodes.c" + #line 2200 "Python/bytecodes.c" } #line 3174 "Python/generated_cases.c.h" STACK_SHRINK(1); @@ -3176,7 +3176,7 @@ } TARGET(JUMP_BACKWARD_NO_INTERRUPT) { - #line 2205 "Python/bytecodes.c" + #line 2204 "Python/bytecodes.c" /* This bytecode is used in the `yield from` or `await` loop. * If there is an interrupt, we want it handled in the innermost * generator or coroutine, so we deliberately do not check it here. @@ -3190,7 +3190,7 @@ TARGET(GET_LEN) { PyObject *obj = stack_pointer[-1]; PyObject *len_o; - #line 2214 "Python/bytecodes.c" + #line 2213 "Python/bytecodes.c" // PUSH(len(TOS)) Py_ssize_t len_i = PyObject_Length(obj); if (len_i < 0) goto error; @@ -3207,7 +3207,7 @@ PyObject *type = stack_pointer[-2]; PyObject *subject = stack_pointer[-3]; PyObject *attrs; - #line 2222 "Python/bytecodes.c" + #line 2221 "Python/bytecodes.c" // Pop TOS and TOS1. Set TOS to a tuple of attributes on success, or // None on failure. assert(PyTuple_CheckExact(names)); @@ -3216,7 +3216,7 @@ Py_DECREF(subject); Py_DECREF(type); Py_DECREF(names); - #line 2227 "Python/bytecodes.c" + #line 2226 "Python/bytecodes.c" if (attrs) { assert(PyTuple_CheckExact(attrs)); // Success! } @@ -3233,7 +3233,7 @@ TARGET(MATCH_MAPPING) { PyObject *subject = stack_pointer[-1]; PyObject *res; - #line 2237 "Python/bytecodes.c" + #line 2236 "Python/bytecodes.c" int match = Py_TYPE(subject)->tp_flags & Py_TPFLAGS_MAPPING; res = match ? Py_True : Py_False; #line 3240 "Python/generated_cases.c.h" @@ -3245,7 +3245,7 @@ TARGET(MATCH_SEQUENCE) { PyObject *subject = stack_pointer[-1]; PyObject *res; - #line 2242 "Python/bytecodes.c" + #line 2241 "Python/bytecodes.c" int match = Py_TYPE(subject)->tp_flags & Py_TPFLAGS_SEQUENCE; res = match ? Py_True : Py_False; #line 3252 "Python/generated_cases.c.h" @@ -3258,7 +3258,7 @@ PyObject *keys = stack_pointer[-1]; PyObject *subject = stack_pointer[-2]; PyObject *values_or_none; - #line 2247 "Python/bytecodes.c" + #line 2246 "Python/bytecodes.c" // On successful match, PUSH(values). Otherwise, PUSH(None). values_or_none = match_keys(tstate, subject, keys); if (values_or_none == NULL) goto error; @@ -3271,12 +3271,12 @@ TARGET(GET_ITER) { PyObject *iterable = stack_pointer[-1]; PyObject *iter; - #line 2253 "Python/bytecodes.c" + #line 2252 "Python/bytecodes.c" /* before: [obj]; after [getiter(obj)] */ iter = PyObject_GetIter(iterable); #line 3278 "Python/generated_cases.c.h" Py_DECREF(iterable); - #line 2256 "Python/bytecodes.c" + #line 2255 "Python/bytecodes.c" if (iter == NULL) goto pop_1_error; #line 3282 "Python/generated_cases.c.h" stack_pointer[-1] = iter; @@ -3286,7 +3286,7 @@ TARGET(GET_YIELD_FROM_ITER) { PyObject *iterable = stack_pointer[-1]; PyObject *iter; - #line 2260 "Python/bytecodes.c" + #line 2259 "Python/bytecodes.c" /* before: [obj]; after [getiter(obj)] */ if (PyCoro_CheckExact(iterable)) { /* `iterable` is a coroutine */ @@ -3311,7 +3311,7 @@ } #line 3313 "Python/generated_cases.c.h" Py_DECREF(iterable); - #line 2283 "Python/bytecodes.c" + #line 2282 "Python/bytecodes.c" } #line 3317 "Python/generated_cases.c.h" stack_pointer[-1] = iter; @@ -3323,7 +3323,7 @@ static_assert(INLINE_CACHE_ENTRIES_FOR_ITER == 1, "incorrect cache size"); PyObject *iter = stack_pointer[-1]; PyObject *next; - #line 2301 "Python/bytecodes.c" + #line 2300 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyForIterCache *cache = (_PyForIterCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -3362,7 +3362,7 @@ } TARGET(INSTRUMENTED_FOR_ITER) { - #line 2334 "Python/bytecodes.c" + #line 2333 "Python/bytecodes.c" _Py_CODEUNIT *here = next_instr-1; _Py_CODEUNIT *target; PyObject *iter = TOP(); @@ -3395,7 +3395,7 @@ TARGET(FOR_ITER_LIST) { PyObject *iter = stack_pointer[-1]; PyObject *next; - #line 2362 "Python/bytecodes.c" + #line 2361 "Python/bytecodes.c" DEOPT_IF(Py_TYPE(iter) != &PyListIter_Type, FOR_ITER); _PyListIterObject *it = (_PyListIterObject *)iter; STAT_INC(FOR_ITER, hit); @@ -3425,7 +3425,7 @@ TARGET(FOR_ITER_TUPLE) { PyObject *iter = stack_pointer[-1]; PyObject *next; - #line 2384 "Python/bytecodes.c" + #line 2383 "Python/bytecodes.c" _PyTupleIterObject *it = (_PyTupleIterObject *)iter; DEOPT_IF(Py_TYPE(it) != &PyTupleIter_Type, FOR_ITER); STAT_INC(FOR_ITER, hit); @@ -3455,7 +3455,7 @@ TARGET(FOR_ITER_RANGE) { PyObject *iter = stack_pointer[-1]; PyObject *next; - #line 2406 "Python/bytecodes.c" + #line 2405 "Python/bytecodes.c" _PyRangeIterObject *r = (_PyRangeIterObject *)iter; DEOPT_IF(Py_TYPE(r) != &PyRangeIter_Type, FOR_ITER); STAT_INC(FOR_ITER, hit); @@ -3482,7 +3482,7 @@ TARGET(FOR_ITER_GEN) { PyObject *iter = stack_pointer[-1]; - #line 2426 "Python/bytecodes.c" + #line 2425 "Python/bytecodes.c" DEOPT_IF(tstate->interp->eval_frame, FOR_ITER); PyGenObject *gen = (PyGenObject *)iter; DEOPT_IF(Py_TYPE(gen) != &PyGen_Type, FOR_ITER); @@ -3505,7 +3505,7 @@ PyObject *mgr = stack_pointer[-1]; PyObject *exit; PyObject *res; - #line 2444 "Python/bytecodes.c" + #line 2443 "Python/bytecodes.c" PyObject *enter = _PyObject_LookupSpecial(mgr, &_Py_ID(__aenter__)); if (enter == NULL) { if (!_PyErr_Occurred(tstate)) { @@ -3530,7 +3530,7 @@ } #line 3532 "Python/generated_cases.c.h" Py_DECREF(mgr); - #line 2467 "Python/bytecodes.c" + #line 2466 "Python/bytecodes.c" res = _PyObject_CallNoArgs(enter); Py_DECREF(enter); if (res == NULL) { @@ -3548,7 +3548,7 @@ PyObject *mgr = stack_pointer[-1]; PyObject *exit; PyObject *res; - #line 2476 "Python/bytecodes.c" + #line 2475 "Python/bytecodes.c" /* pop the context manager, push its __exit__ and the * value returned from calling its __enter__ */ @@ -3576,7 +3576,7 @@ } #line 3578 "Python/generated_cases.c.h" Py_DECREF(mgr); - #line 2502 "Python/bytecodes.c" + #line 2501 "Python/bytecodes.c" res = _PyObject_CallNoArgs(enter); Py_DECREF(enter); if (res == NULL) { @@ -3595,7 +3595,7 @@ PyObject *lasti = stack_pointer[-3]; PyObject *exit_func = stack_pointer[-4]; PyObject *res; - #line 2511 "Python/bytecodes.c" + #line 2510 "Python/bytecodes.c" /* At the top of the stack are 4 values: - val: TOP = exc_info() - unused: SECOND = previous exception @@ -3625,7 +3625,7 @@ TARGET(PUSH_EXC_INFO) { PyObject *new_exc = stack_pointer[-1]; PyObject *prev_exc; - #line 2534 "Python/bytecodes.c" + #line 2533 "Python/bytecodes.c" _PyErr_StackItem *exc_info = tstate->exc_info; if (exc_info->exc_value != NULL) { prev_exc = exc_info->exc_value; @@ -3649,7 +3649,7 @@ uint32_t type_version = read_u32(&next_instr[1].cache); uint32_t keys_version = read_u32(&next_instr[3].cache); PyObject *descr = read_obj(&next_instr[5].cache); - #line 2546 "Python/bytecodes.c" + #line 2545 "Python/bytecodes.c" /* Cached method object */ PyTypeObject *self_cls = Py_TYPE(self); assert(type_version != 0); @@ -3680,7 +3680,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); PyObject *descr = read_obj(&next_instr[5].cache); - #line 2565 "Python/bytecodes.c" + #line 2564 "Python/bytecodes.c" PyTypeObject *self_cls = Py_TYPE(self); DEOPT_IF(self_cls->tp_version_tag != type_version, LOAD_ATTR); assert(self_cls->tp_dictoffset == 0); @@ -3704,7 +3704,7 @@ PyObject *res; uint32_t type_version = read_u32(&next_instr[1].cache); PyObject *descr = read_obj(&next_instr[5].cache); - #line 2577 "Python/bytecodes.c" + #line 2576 "Python/bytecodes.c" PyTypeObject *self_cls = Py_TYPE(self); DEOPT_IF(self_cls->tp_version_tag != type_version, LOAD_ATTR); Py_ssize_t dictoffset = self_cls->tp_dictoffset; @@ -3726,22 +3726,13 @@ DISPATCH(); } - TARGET(KW_NAMES) { - #line 2593 "Python/bytecodes.c" - assert(kwnames == NULL); - assert(oparg < PyTuple_GET_SIZE(frame->f_code->co_consts)); - kwnames = GETITEM(frame->f_code->co_consts, oparg); - #line 3735 "Python/generated_cases.c.h" - DISPATCH(); - } - TARGET(INSTRUMENTED_CALL) { - #line 2599 "Python/bytecodes.c" - int is_meth = PEEK(oparg+2) != NULL; + #line 2592 "Python/bytecodes.c" + int is_meth = PEEK(oparg + 3) != NULL; int total_args = oparg + is_meth; - PyObject *function = PEEK(total_args + 1); + PyObject *function = PEEK(total_args + 2); PyObject *arg = total_args == 0 ? - &_PyInstrumentation_MISSING : PEEK(total_args); + &_PyInstrumentation_MISSING : PEEK(total_args + 1); int err = _Py_call_instrumentation_2args( tstate, PY_MONITORING_EVENT_CALL, frame, next_instr-1, function, arg); @@ -3749,17 +3740,18 @@ _PyCallCache *cache = (_PyCallCache *)next_instr; INCREMENT_ADAPTIVE_COUNTER(cache->counter); GO_TO_INSTRUCTION(CALL); - #line 3753 "Python/generated_cases.c.h" + #line 3744 "Python/generated_cases.c.h" } TARGET(CALL) { PREDICTED(CALL); static_assert(INLINE_CACHE_ENTRIES_CALL == 3, "incorrect cache size"); - PyObject **args = (stack_pointer - oparg); - PyObject *callable = stack_pointer[-(1 + oparg)]; - PyObject *method = stack_pointer[-(2 + oparg)]; + PyObject *kwnames = stack_pointer[-1]; + PyObject **args = (stack_pointer - (1 + oparg)); + PyObject *callable = stack_pointer[-(2 + oparg)]; + PyObject *method = stack_pointer[-(3 + oparg)]; PyObject *res; - #line 2644 "Python/bytecodes.c" + #line 2636 "Python/bytecodes.c" int is_meth = method != NULL; int total_args = oparg; if (is_meth) { @@ -3800,9 +3792,9 @@ tstate, (PyFunctionObject *)callable, locals, args, positional_args, kwnames ); - kwnames = NULL; + Py_XDECREF(kwnames); // Manipulate stack directly since we leave using DISPATCH_INLINED(). - STACK_SHRINK(oparg + 2); + STACK_SHRINK(oparg + 3); // The frame has stolen all the arguments from the stack, // so there is no need to clean them up. if (new_frame == NULL) { @@ -3819,7 +3811,7 @@ kwnames); if (opcode == INSTRUMENTED_CALL) { PyObject *arg = total_args == 0 ? - &_PyInstrumentation_MISSING : PEEK(total_args); + &_PyInstrumentation_MISSING : PEEK(total_args + 1); if (res == NULL) { _Py_call_instrumentation_exc2( tstate, PY_MONITORING_EVENT_C_RAISE, @@ -3834,16 +3826,16 @@ } } } - kwnames = NULL; + Py_XDECREF(kwnames); assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL)); Py_DECREF(callable); for (int i = 0; i < total_args; i++) { Py_DECREF(args[i]); } - if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 3845 "Python/generated_cases.c.h" + if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } + #line 3837 "Python/generated_cases.c.h" STACK_SHRINK(oparg); - STACK_SHRINK(1); + STACK_SHRINK(2); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -3851,28 +3843,29 @@ } TARGET(CALL_BOUND_METHOD_EXACT_ARGS) { - PyObject *callable = stack_pointer[-(1 + oparg)]; - PyObject *method = stack_pointer[-(2 + oparg)]; - #line 2732 "Python/bytecodes.c" + PyObject *callable = stack_pointer[-(2 + oparg)]; + PyObject *method = stack_pointer[-(3 + oparg)]; + #line 2724 "Python/bytecodes.c" DEOPT_IF(method != NULL, CALL); DEOPT_IF(Py_TYPE(callable) != &PyMethod_Type, CALL); STAT_INC(CALL, hit); PyObject *self = ((PyMethodObject *)callable)->im_self; - PEEK(oparg + 1) = Py_NewRef(self); // callable + PEEK(oparg + 2) = Py_NewRef(self); // callable PyObject *meth = ((PyMethodObject *)callable)->im_func; - PEEK(oparg + 2) = Py_NewRef(meth); // method + PEEK(oparg + 3) = Py_NewRef(meth); // method Py_DECREF(callable); GO_TO_INSTRUCTION(CALL_PY_EXACT_ARGS); - #line 3867 "Python/generated_cases.c.h" + #line 3859 "Python/generated_cases.c.h" } TARGET(CALL_PY_EXACT_ARGS) { PREDICTED(CALL_PY_EXACT_ARGS); - PyObject **args = (stack_pointer - oparg); - PyObject *callable = stack_pointer[-(1 + oparg)]; - PyObject *method = stack_pointer[-(2 + oparg)]; + PyObject *kwnames = stack_pointer[-1]; + PyObject **args = (stack_pointer - (1 + oparg)); + PyObject *callable = stack_pointer[-(2 + oparg)]; + PyObject *method = stack_pointer[-(3 + oparg)]; uint32_t func_version = read_u32(&next_instr[1].cache); - #line 2744 "Python/bytecodes.c" + #line 2736 "Python/bytecodes.c" assert(kwnames == NULL); DEOPT_IF(tstate->interp->eval_frame, CALL); int is_meth = method != NULL; @@ -3894,19 +3887,20 @@ new_frame->localsplus[i] = args[i]; } // Manipulate stack directly since we leave using DISPATCH_INLINED(). - STACK_SHRINK(oparg + 2); + STACK_SHRINK(oparg + 3); JUMPBY(INLINE_CACHE_ENTRIES_CALL); frame->return_offset = 0; DISPATCH_INLINED(new_frame); - #line 3902 "Python/generated_cases.c.h" + #line 3895 "Python/generated_cases.c.h" } TARGET(CALL_PY_WITH_DEFAULTS) { - PyObject **args = (stack_pointer - oparg); - PyObject *callable = stack_pointer[-(1 + oparg)]; - PyObject *method = stack_pointer[-(2 + oparg)]; + PyObject *kwnames = stack_pointer[-1]; + PyObject **args = (stack_pointer - (1 + oparg)); + PyObject *callable = stack_pointer[-(2 + oparg)]; + PyObject *method = stack_pointer[-(3 + oparg)]; uint32_t func_version = read_u32(&next_instr[1].cache); - #line 2772 "Python/bytecodes.c" + #line 2764 "Python/bytecodes.c" assert(kwnames == NULL); DEOPT_IF(tstate->interp->eval_frame, CALL); int is_meth = method != NULL; @@ -3938,19 +3932,20 @@ new_frame->localsplus[i] = Py_NewRef(def); } // Manipulate stack and cache directly since we leave using DISPATCH_INLINED(). - STACK_SHRINK(oparg + 2); + STACK_SHRINK(oparg + 3); JUMPBY(INLINE_CACHE_ENTRIES_CALL); frame->return_offset = 0; DISPATCH_INLINED(new_frame); - #line 3946 "Python/generated_cases.c.h" + #line 3940 "Python/generated_cases.c.h" } TARGET(CALL_NO_KW_TYPE_1) { - PyObject **args = (stack_pointer - oparg); - PyObject *callable = stack_pointer[-(1 + oparg)]; - PyObject *null = stack_pointer[-(2 + oparg)]; + PyObject *kwnames = stack_pointer[-1]; + PyObject **args = (stack_pointer - (1 + oparg)); + PyObject *callable = stack_pointer[-(2 + oparg)]; + PyObject *null = stack_pointer[-(3 + oparg)]; PyObject *res; - #line 2810 "Python/bytecodes.c" + #line 2802 "Python/bytecodes.c" assert(kwnames == NULL); assert(oparg == 1); DEOPT_IF(null != NULL, CALL); @@ -3960,20 +3955,21 @@ res = Py_NewRef(Py_TYPE(obj)); Py_DECREF(obj); Py_DECREF(&PyType_Type); // I.e., callable - #line 3964 "Python/generated_cases.c.h" + #line 3959 "Python/generated_cases.c.h" STACK_SHRINK(oparg); - STACK_SHRINK(1); + STACK_SHRINK(2); stack_pointer[-1] = res; next_instr += 3; DISPATCH(); } TARGET(CALL_NO_KW_STR_1) { - PyObject **args = (stack_pointer - oparg); - PyObject *callable = stack_pointer[-(1 + oparg)]; - PyObject *null = stack_pointer[-(2 + oparg)]; + PyObject *kwnames = stack_pointer[-1]; + PyObject **args = (stack_pointer - (1 + oparg)); + PyObject *callable = stack_pointer[-(2 + oparg)]; + PyObject *null = stack_pointer[-(3 + oparg)]; PyObject *res; - #line 2822 "Python/bytecodes.c" + #line 2814 "Python/bytecodes.c" assert(kwnames == NULL); assert(oparg == 1); DEOPT_IF(null != NULL, CALL); @@ -3983,10 +3979,10 @@ res = PyObject_Str(arg); Py_DECREF(arg); Py_DECREF(&PyUnicode_Type); // I.e., callable - if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 3988 "Python/generated_cases.c.h" + if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } + #line 3984 "Python/generated_cases.c.h" STACK_SHRINK(oparg); - STACK_SHRINK(1); + STACK_SHRINK(2); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -3994,11 +3990,12 @@ } TARGET(CALL_NO_KW_TUPLE_1) { - PyObject **args = (stack_pointer - oparg); - PyObject *callable = stack_pointer[-(1 + oparg)]; - PyObject *null = stack_pointer[-(2 + oparg)]; + PyObject *kwnames = stack_pointer[-1]; + PyObject **args = (stack_pointer - (1 + oparg)); + PyObject *callable = stack_pointer[-(2 + oparg)]; + PyObject *null = stack_pointer[-(3 + oparg)]; PyObject *res; - #line 2836 "Python/bytecodes.c" + #line 2828 "Python/bytecodes.c" assert(kwnames == NULL); assert(oparg == 1); DEOPT_IF(null != NULL, CALL); @@ -4008,10 +4005,10 @@ res = PySequence_Tuple(arg); Py_DECREF(arg); Py_DECREF(&PyTuple_Type); // I.e., tuple - if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4013 "Python/generated_cases.c.h" + if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } + #line 4010 "Python/generated_cases.c.h" STACK_SHRINK(oparg); - STACK_SHRINK(1); + STACK_SHRINK(2); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -4019,11 +4016,12 @@ } TARGET(CALL_BUILTIN_CLASS) { - PyObject **args = (stack_pointer - oparg); - PyObject *callable = stack_pointer[-(1 + oparg)]; - PyObject *method = stack_pointer[-(2 + oparg)]; + PyObject *kwnames = stack_pointer[-1]; + PyObject **args = (stack_pointer - (1 + oparg)); + PyObject *callable = stack_pointer[-(2 + oparg)]; + PyObject *method = stack_pointer[-(3 + oparg)]; PyObject *res; - #line 2850 "Python/bytecodes.c" + #line 2842 "Python/bytecodes.c" int is_meth = method != NULL; int total_args = oparg; if (is_meth) { @@ -4038,16 +4036,16 @@ STAT_INC(CALL, hit); res = tp->tp_vectorcall((PyObject *)tp, args, total_args - kwnames_len, kwnames); - kwnames = NULL; + Py_XDECREF(kwnames); /* Free the arguments. */ for (int i = 0; i < total_args; i++) { Py_DECREF(args[i]); } Py_DECREF(tp); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4049 "Python/generated_cases.c.h" + if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } + #line 4047 "Python/generated_cases.c.h" STACK_SHRINK(oparg); - STACK_SHRINK(1); + STACK_SHRINK(2); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -4055,11 +4053,12 @@ } TARGET(CALL_NO_KW_BUILTIN_O) { - PyObject **args = (stack_pointer - oparg); - PyObject *callable = stack_pointer[-(1 + oparg)]; - PyObject *method = stack_pointer[-(2 + oparg)]; + PyObject *kwnames = stack_pointer[-1]; + PyObject **args = (stack_pointer - (1 + oparg)); + PyObject *callable = stack_pointer[-(2 + oparg)]; + PyObject *method = stack_pointer[-(3 + oparg)]; PyObject *res; - #line 2875 "Python/bytecodes.c" + #line 2867 "Python/bytecodes.c" /* Builtin METH_O functions */ assert(kwnames == NULL); int is_meth = method != NULL; @@ -4086,10 +4085,10 @@ Py_DECREF(arg); Py_DECREF(callable); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4091 "Python/generated_cases.c.h" + if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } + #line 4090 "Python/generated_cases.c.h" STACK_SHRINK(oparg); - STACK_SHRINK(1); + STACK_SHRINK(2); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -4097,11 +4096,12 @@ } TARGET(CALL_NO_KW_BUILTIN_FAST) { - PyObject **args = (stack_pointer - oparg); - PyObject *callable = stack_pointer[-(1 + oparg)]; - PyObject *method = stack_pointer[-(2 + oparg)]; + PyObject *kwnames = stack_pointer[-1]; + PyObject **args = (stack_pointer - (1 + oparg)); + PyObject *callable = stack_pointer[-(2 + oparg)]; + PyObject *method = stack_pointer[-(3 + oparg)]; PyObject *res; - #line 2906 "Python/bytecodes.c" + #line 2898 "Python/bytecodes.c" /* Builtin METH_FASTCALL functions, without keywords */ assert(kwnames == NULL); int is_meth = method != NULL; @@ -4127,7 +4127,7 @@ Py_DECREF(args[i]); } Py_DECREF(callable); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } + if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } /* Not deopting because this doesn't mean our optimization was wrong. `res` can be NULL for valid reasons. Eg. getattr(x, 'invalid'). In those cases an exception is set, so we must @@ -4135,7 +4135,7 @@ */ #line 4137 "Python/generated_cases.c.h" STACK_SHRINK(oparg); - STACK_SHRINK(1); + STACK_SHRINK(2); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -4143,11 +4143,12 @@ } TARGET(CALL_BUILTIN_FAST_WITH_KEYWORDS) { - PyObject **args = (stack_pointer - oparg); - PyObject *callable = stack_pointer[-(1 + oparg)]; - PyObject *method = stack_pointer[-(2 + oparg)]; + PyObject *kwnames = stack_pointer[-1]; + PyObject **args = (stack_pointer - (1 + oparg)); + PyObject *callable = stack_pointer[-(2 + oparg)]; + PyObject *method = stack_pointer[-(3 + oparg)]; PyObject *res; - #line 2941 "Python/bytecodes.c" + #line 2933 "Python/bytecodes.c" /* Builtin METH_FASTCALL | METH_KEYWORDS functions */ int is_meth = method != NULL; int total_args = oparg; @@ -4171,17 +4172,17 @@ kwnames ); assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL)); - kwnames = NULL; + Py_XDECREF(kwnames); /* Free the arguments. */ for (int i = 0; i < total_args; i++) { Py_DECREF(args[i]); } Py_DECREF(callable); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4183 "Python/generated_cases.c.h" + if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } + #line 4184 "Python/generated_cases.c.h" STACK_SHRINK(oparg); - STACK_SHRINK(1); + STACK_SHRINK(2); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -4189,11 +4190,12 @@ } TARGET(CALL_NO_KW_LEN) { - PyObject **args = (stack_pointer - oparg); - PyObject *callable = stack_pointer[-(1 + oparg)]; - PyObject *method = stack_pointer[-(2 + oparg)]; + PyObject *kwnames = stack_pointer[-1]; + PyObject **args = (stack_pointer - (1 + oparg)); + PyObject *callable = stack_pointer[-(2 + oparg)]; + PyObject *method = stack_pointer[-(3 + oparg)]; PyObject *res; - #line 2976 "Python/bytecodes.c" + #line 2968 "Python/bytecodes.c" assert(kwnames == NULL); /* len(o) */ int is_meth = method != NULL; @@ -4217,21 +4219,22 @@ Py_DECREF(callable); Py_DECREF(arg); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4222 "Python/generated_cases.c.h" + if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } + #line 4224 "Python/generated_cases.c.h" STACK_SHRINK(oparg); - STACK_SHRINK(1); + STACK_SHRINK(2); stack_pointer[-1] = res; next_instr += 3; DISPATCH(); } TARGET(CALL_NO_KW_ISINSTANCE) { - PyObject **args = (stack_pointer - oparg); - PyObject *callable = stack_pointer[-(1 + oparg)]; - PyObject *method = stack_pointer[-(2 + oparg)]; + PyObject *kwnames = stack_pointer[-1]; + PyObject **args = (stack_pointer - (1 + oparg)); + PyObject *callable = stack_pointer[-(2 + oparg)]; + PyObject *method = stack_pointer[-(3 + oparg)]; PyObject *res; - #line 3003 "Python/bytecodes.c" + #line 2995 "Python/bytecodes.c" assert(kwnames == NULL); /* isinstance(o, o2) */ int is_meth = method != NULL; @@ -4257,20 +4260,21 @@ Py_DECREF(inst); Py_DECREF(cls); Py_DECREF(callable); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4262 "Python/generated_cases.c.h" + if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } + #line 4265 "Python/generated_cases.c.h" STACK_SHRINK(oparg); - STACK_SHRINK(1); + STACK_SHRINK(2); stack_pointer[-1] = res; next_instr += 3; DISPATCH(); } TARGET(CALL_NO_KW_LIST_APPEND) { - PyObject **args = (stack_pointer - oparg); - PyObject *self = stack_pointer[-(1 + oparg)]; - PyObject *method = stack_pointer[-(2 + oparg)]; - #line 3033 "Python/bytecodes.c" + PyObject *kwnames = stack_pointer[-1]; + PyObject **args = (stack_pointer - (1 + oparg)); + PyObject *self = stack_pointer[-(2 + oparg)]; + PyObject *method = stack_pointer[-(3 + oparg)]; + #line 3025 "Python/bytecodes.c" assert(kwnames == NULL); assert(oparg == 1); assert(method != NULL); @@ -4283,19 +4287,20 @@ } Py_DECREF(self); Py_DECREF(method); - STACK_SHRINK(3); + STACK_SHRINK(4); // CALL + POP_TOP JUMPBY(INLINE_CACHE_ENTRIES_CALL + 1); assert(next_instr[-1].op.code == POP_TOP); DISPATCH(); - #line 4292 "Python/generated_cases.c.h" + #line 4296 "Python/generated_cases.c.h" } TARGET(CALL_NO_KW_METHOD_DESCRIPTOR_O) { - PyObject **args = (stack_pointer - oparg); - PyObject *method = stack_pointer[-(2 + oparg)]; + PyObject *kwnames = stack_pointer[-1]; + PyObject **args = (stack_pointer - (1 + oparg)); + PyObject *method = stack_pointer[-(3 + oparg)]; PyObject *res; - #line 3053 "Python/bytecodes.c" + #line 3045 "Python/bytecodes.c" assert(kwnames == NULL); int is_meth = method != NULL; int total_args = oparg; @@ -4304,7 +4309,7 @@ total_args++; } PyMethodDescrObject *callable = - (PyMethodDescrObject *)PEEK(total_args + 1); + (PyMethodDescrObject *)PEEK(total_args + 2); DEOPT_IF(total_args != 2, CALL); DEOPT_IF(!Py_IS_TYPE(callable, &PyMethodDescr_Type), CALL); PyMethodDef *meth = callable->d_method; @@ -4325,10 +4330,10 @@ Py_DECREF(self); Py_DECREF(arg); Py_DECREF(callable); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4330 "Python/generated_cases.c.h" + if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } + #line 4335 "Python/generated_cases.c.h" STACK_SHRINK(oparg); - STACK_SHRINK(1); + STACK_SHRINK(2); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -4336,10 +4341,11 @@ } TARGET(CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS) { - PyObject **args = (stack_pointer - oparg); - PyObject *method = stack_pointer[-(2 + oparg)]; + PyObject *kwnames = stack_pointer[-1]; + PyObject **args = (stack_pointer - (1 + oparg)); + PyObject *method = stack_pointer[-(3 + oparg)]; PyObject *res; - #line 3087 "Python/bytecodes.c" + #line 3079 "Python/bytecodes.c" int is_meth = method != NULL; int total_args = oparg; if (is_meth) { @@ -4347,7 +4353,7 @@ total_args++; } PyMethodDescrObject *callable = - (PyMethodDescrObject *)PEEK(total_args + 1); + (PyMethodDescrObject *)PEEK(total_args + 2); DEOPT_IF(!Py_IS_TYPE(callable, &PyMethodDescr_Type), CALL); PyMethodDef *meth = callable->d_method; DEOPT_IF(meth->ml_flags != (METH_FASTCALL|METH_KEYWORDS), CALL); @@ -4360,17 +4366,17 @@ (_PyCFunctionFastWithKeywords)(void(*)(void))meth->ml_meth; res = cfunc(self, args + 1, nargs - KWNAMES_LEN(), kwnames); assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL)); - kwnames = NULL; + Py_XDECREF(kwnames); /* Free the arguments. */ for (int i = 0; i < total_args; i++) { Py_DECREF(args[i]); } Py_DECREF(callable); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4372 "Python/generated_cases.c.h" + if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } + #line 4378 "Python/generated_cases.c.h" STACK_SHRINK(oparg); - STACK_SHRINK(1); + STACK_SHRINK(2); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -4378,10 +4384,11 @@ } TARGET(CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS) { - PyObject **args = (stack_pointer - oparg); - PyObject *method = stack_pointer[-(2 + oparg)]; + PyObject *kwnames = stack_pointer[-1]; + PyObject **args = (stack_pointer - (1 + oparg)); + PyObject *method = stack_pointer[-(3 + oparg)]; PyObject *res; - #line 3119 "Python/bytecodes.c" + #line 3111 "Python/bytecodes.c" assert(kwnames == NULL); assert(oparg == 0 || oparg == 1); int is_meth = method != NULL; @@ -4409,10 +4416,10 @@ assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL)); Py_DECREF(self); Py_DECREF(callable); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4414 "Python/generated_cases.c.h" + if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } + #line 4421 "Python/generated_cases.c.h" STACK_SHRINK(oparg); - STACK_SHRINK(1); + STACK_SHRINK(2); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -4420,10 +4427,11 @@ } TARGET(CALL_NO_KW_METHOD_DESCRIPTOR_FAST) { - PyObject **args = (stack_pointer - oparg); - PyObject *method = stack_pointer[-(2 + oparg)]; + PyObject *kwnames = stack_pointer[-1]; + PyObject **args = (stack_pointer - (1 + oparg)); + PyObject *method = stack_pointer[-(3 + oparg)]; PyObject *res; - #line 3151 "Python/bytecodes.c" + #line 3143 "Python/bytecodes.c" assert(kwnames == NULL); int is_meth = method != NULL; int total_args = oparg; @@ -4432,7 +4440,7 @@ total_args++; } PyMethodDescrObject *callable = - (PyMethodDescrObject *)PEEK(total_args + 1); + (PyMethodDescrObject *)PEEK(total_args + 2); /* Builtin METH_FASTCALL methods, without keywords */ DEOPT_IF(!Py_IS_TYPE(callable, &PyMethodDescr_Type), CALL); PyMethodDef *meth = callable->d_method; @@ -4450,10 +4458,10 @@ Py_DECREF(args[i]); } Py_DECREF(callable); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_2_error; } - #line 4455 "Python/generated_cases.c.h" + if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } + #line 4463 "Python/generated_cases.c.h" STACK_SHRINK(oparg); - STACK_SHRINK(1); + STACK_SHRINK(2); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -4461,9 +4469,9 @@ } TARGET(INSTRUMENTED_CALL_FUNCTION_EX) { - #line 3182 "Python/bytecodes.c" + #line 3174 "Python/bytecodes.c" GO_TO_INSTRUCTION(CALL_FUNCTION_EX); - #line 4467 "Python/generated_cases.c.h" + #line 4475 "Python/generated_cases.c.h" } TARGET(CALL_FUNCTION_EX) { @@ -4472,7 +4480,7 @@ PyObject *callargs = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))]; PyObject *func = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0))]; PyObject *result; - #line 3186 "Python/bytecodes.c" + #line 3178 "Python/bytecodes.c" // DICT_MERGE is called before this opcode if there are kwargs. // It converts all dict subtypes in kwargs into regular dicts. assert(kwargs == NULL || PyDict_CheckExact(kwargs)); @@ -4534,14 +4542,14 @@ } result = PyObject_Call(func, callargs, kwargs); } - #line 4538 "Python/generated_cases.c.h" + #line 4546 "Python/generated_cases.c.h" Py_DECREF(func); Py_DECREF(callargs); Py_XDECREF(kwargs); - #line 3248 "Python/bytecodes.c" + #line 3240 "Python/bytecodes.c" assert(PEEK(3 + (oparg & 1)) == NULL); if (result == NULL) { STACK_SHRINK(((oparg & 1) ? 1 : 0)); goto pop_3_error; } - #line 4545 "Python/generated_cases.c.h" + #line 4553 "Python/generated_cases.c.h" STACK_SHRINK(((oparg & 1) ? 1 : 0)); STACK_SHRINK(2); stack_pointer[-1] = result; @@ -4556,7 +4564,7 @@ PyObject *kwdefaults = (oparg & MAKE_FUNCTION_KWDEFAULTS) ? stack_pointer[-(1 + ((oparg & MAKE_FUNCTION_CLOSURE) ? 1 : 0) + ((oparg & MAKE_FUNCTION_ANNOTATIONS) ? 1 : 0) + ((oparg & MAKE_FUNCTION_KWDEFAULTS) ? 1 : 0))] : NULL; PyObject *defaults = (oparg & MAKE_FUNCTION_DEFAULTS) ? stack_pointer[-(1 + ((oparg & MAKE_FUNCTION_CLOSURE) ? 1 : 0) + ((oparg & MAKE_FUNCTION_ANNOTATIONS) ? 1 : 0) + ((oparg & MAKE_FUNCTION_KWDEFAULTS) ? 1 : 0) + ((oparg & MAKE_FUNCTION_DEFAULTS) ? 1 : 0))] : NULL; PyObject *func; - #line 3258 "Python/bytecodes.c" + #line 3250 "Python/bytecodes.c" PyFunctionObject *func_obj = (PyFunctionObject *) PyFunction_New(codeobj, GLOBALS()); @@ -4585,14 +4593,14 @@ func_obj->func_version = ((PyCodeObject *)codeobj)->co_version; func = (PyObject *)func_obj; - #line 4589 "Python/generated_cases.c.h" + #line 4597 "Python/generated_cases.c.h" STACK_SHRINK(((oparg & MAKE_FUNCTION_DEFAULTS) ? 1 : 0) + ((oparg & MAKE_FUNCTION_KWDEFAULTS) ? 1 : 0) + ((oparg & MAKE_FUNCTION_ANNOTATIONS) ? 1 : 0) + ((oparg & MAKE_FUNCTION_CLOSURE) ? 1 : 0)); stack_pointer[-1] = func; DISPATCH(); } TARGET(RETURN_GENERATOR) { - #line 3289 "Python/bytecodes.c" + #line 3281 "Python/bytecodes.c" assert(PyFunction_Check(frame->f_funcobj)); PyFunctionObject *func = (PyFunctionObject *)frame->f_funcobj; PyGenObject *gen = (PyGenObject *)_Py_MakeCoro(func); @@ -4613,7 +4621,7 @@ frame = cframe.current_frame = prev; _PyFrame_StackPush(frame, (PyObject *)gen); goto resume_frame; - #line 4617 "Python/generated_cases.c.h" + #line 4625 "Python/generated_cases.c.h" } TARGET(BUILD_SLICE) { @@ -4621,15 +4629,15 @@ PyObject *stop = stack_pointer[-(1 + ((oparg == 3) ? 1 : 0))]; PyObject *start = stack_pointer[-(2 + ((oparg == 3) ? 1 : 0))]; PyObject *slice; - #line 3312 "Python/bytecodes.c" + #line 3304 "Python/bytecodes.c" slice = PySlice_New(start, stop, step); - #line 4627 "Python/generated_cases.c.h" + #line 4635 "Python/generated_cases.c.h" Py_DECREF(start); Py_DECREF(stop); Py_XDECREF(step); - #line 3314 "Python/bytecodes.c" + #line 3306 "Python/bytecodes.c" if (slice == NULL) { STACK_SHRINK(((oparg == 3) ? 1 : 0)); goto pop_2_error; } - #line 4633 "Python/generated_cases.c.h" + #line 4641 "Python/generated_cases.c.h" STACK_SHRINK(((oparg == 3) ? 1 : 0)); STACK_SHRINK(1); stack_pointer[-1] = slice; @@ -4640,7 +4648,7 @@ PyObject *fmt_spec = ((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? stack_pointer[-((((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0))] : NULL; PyObject *value = stack_pointer[-(1 + (((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0))]; PyObject *result; - #line 3318 "Python/bytecodes.c" + #line 3310 "Python/bytecodes.c" /* Handles f-string value formatting. */ PyObject *(*conv_fn)(PyObject *); int which_conversion = oparg & FVC_MASK; @@ -4675,7 +4683,7 @@ Py_DECREF(value); Py_XDECREF(fmt_spec); if (result == NULL) { STACK_SHRINK((((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0)); goto pop_1_error; } - #line 4679 "Python/generated_cases.c.h" + #line 4687 "Python/generated_cases.c.h" STACK_SHRINK((((oparg & FVS_MASK) == FVS_HAVE_SPEC) ? 1 : 0)); stack_pointer[-1] = result; DISPATCH(); @@ -4684,10 +4692,10 @@ TARGET(COPY) { PyObject *bottom = stack_pointer[-(1 + (oparg-1))]; PyObject *top; - #line 3355 "Python/bytecodes.c" + #line 3347 "Python/bytecodes.c" assert(oparg > 0); top = Py_NewRef(bottom); - #line 4691 "Python/generated_cases.c.h" + #line 4699 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = top; DISPATCH(); @@ -4699,7 +4707,7 @@ PyObject *rhs = stack_pointer[-1]; PyObject *lhs = stack_pointer[-2]; PyObject *res; - #line 3360 "Python/bytecodes.c" + #line 3352 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyBinaryOpCache *cache = (_PyBinaryOpCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -4714,12 +4722,12 @@ assert((unsigned)oparg < Py_ARRAY_LENGTH(binary_ops)); assert(binary_ops[oparg]); res = binary_ops[oparg](lhs, rhs); - #line 4718 "Python/generated_cases.c.h" + #line 4726 "Python/generated_cases.c.h" Py_DECREF(lhs); Py_DECREF(rhs); - #line 3375 "Python/bytecodes.c" + #line 3367 "Python/bytecodes.c" if (res == NULL) goto pop_2_error; - #line 4723 "Python/generated_cases.c.h" + #line 4731 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 1; @@ -4729,16 +4737,16 @@ TARGET(SWAP) { PyObject *top = stack_pointer[-1]; PyObject *bottom = stack_pointer[-(2 + (oparg-2))]; - #line 3380 "Python/bytecodes.c" + #line 3372 "Python/bytecodes.c" assert(oparg >= 2); - #line 4735 "Python/generated_cases.c.h" + #line 4743 "Python/generated_cases.c.h" stack_pointer[-1] = bottom; stack_pointer[-(2 + (oparg-2))] = top; DISPATCH(); } TARGET(INSTRUMENTED_INSTRUCTION) { - #line 3384 "Python/bytecodes.c" + #line 3376 "Python/bytecodes.c" int next_opcode = _Py_call_instrumentation_instruction( tstate, frame, next_instr-1); if (next_opcode < 0) goto error; @@ -4750,26 +4758,26 @@ assert(next_opcode > 0 && next_opcode < 256); opcode = next_opcode; DISPATCH_GOTO(); - #line 4754 "Python/generated_cases.c.h" + #line 4762 "Python/generated_cases.c.h" } TARGET(INSTRUMENTED_JUMP_FORWARD) { - #line 3398 "Python/bytecodes.c" + #line 3390 "Python/bytecodes.c" INSTRUMENTED_JUMP(next_instr-1, next_instr+oparg, PY_MONITORING_EVENT_JUMP); - #line 4760 "Python/generated_cases.c.h" + #line 4768 "Python/generated_cases.c.h" DISPATCH(); } TARGET(INSTRUMENTED_JUMP_BACKWARD) { - #line 3402 "Python/bytecodes.c" + #line 3394 "Python/bytecodes.c" INSTRUMENTED_JUMP(next_instr-1, next_instr+1-oparg, PY_MONITORING_EVENT_JUMP); - #line 4767 "Python/generated_cases.c.h" + #line 4775 "Python/generated_cases.c.h" CHECK_EVAL_BREAKER(); DISPATCH(); } TARGET(INSTRUMENTED_POP_JUMP_IF_TRUE) { - #line 3407 "Python/bytecodes.c" + #line 3399 "Python/bytecodes.c" PyObject *cond = POP(); int err = PyObject_IsTrue(cond); Py_DECREF(cond); @@ -4778,12 +4786,12 @@ assert(err == 0 || err == 1); int offset = err*oparg; INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH); - #line 4782 "Python/generated_cases.c.h" + #line 4790 "Python/generated_cases.c.h" DISPATCH(); } TARGET(INSTRUMENTED_POP_JUMP_IF_FALSE) { - #line 3418 "Python/bytecodes.c" + #line 3410 "Python/bytecodes.c" PyObject *cond = POP(); int err = PyObject_IsTrue(cond); Py_DECREF(cond); @@ -4792,12 +4800,12 @@ assert(err == 0 || err == 1); int offset = (1-err)*oparg; INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH); - #line 4796 "Python/generated_cases.c.h" + #line 4804 "Python/generated_cases.c.h" DISPATCH(); } TARGET(INSTRUMENTED_POP_JUMP_IF_NONE) { - #line 3429 "Python/bytecodes.c" + #line 3421 "Python/bytecodes.c" PyObject *value = POP(); _Py_CODEUNIT *here = next_instr-1; int offset; @@ -4809,12 +4817,12 @@ offset = 0; } INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH); - #line 4813 "Python/generated_cases.c.h" + #line 4821 "Python/generated_cases.c.h" DISPATCH(); } TARGET(INSTRUMENTED_POP_JUMP_IF_NOT_NONE) { - #line 3443 "Python/bytecodes.c" + #line 3435 "Python/bytecodes.c" PyObject *value = POP(); _Py_CODEUNIT *here = next_instr-1; int offset; @@ -4826,30 +4834,30 @@ offset = oparg; } INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH); - #line 4830 "Python/generated_cases.c.h" + #line 4838 "Python/generated_cases.c.h" DISPATCH(); } TARGET(EXTENDED_ARG) { - #line 3457 "Python/bytecodes.c" + #line 3449 "Python/bytecodes.c" assert(oparg); opcode = next_instr->op.code; oparg = oparg << 8 | next_instr->op.arg; PRE_DISPATCH_GOTO(); DISPATCH_GOTO(); - #line 4841 "Python/generated_cases.c.h" + #line 4849 "Python/generated_cases.c.h" } TARGET(CACHE) { - #line 3465 "Python/bytecodes.c" + #line 3457 "Python/bytecodes.c" assert(0 && "Executing a cache."); Py_UNREACHABLE(); - #line 4848 "Python/generated_cases.c.h" + #line 4856 "Python/generated_cases.c.h" } TARGET(RESERVED) { - #line 3470 "Python/bytecodes.c" + #line 3462 "Python/bytecodes.c" assert(0 && "Executing RESERVED instruction."); Py_UNREACHABLE(); - #line 4855 "Python/generated_cases.c.h" + #line 4863 "Python/generated_cases.c.h" } diff --git a/Python/opcode_metadata.h b/Python/opcode_metadata.h index 2c4d1aac115d51..c2138ad709e389 100644 --- a/Python/opcode_metadata.h +++ b/Python/opcode_metadata.h @@ -313,46 +313,44 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) { return 1; case LOAD_ATTR_METHOD_LAZY_DICT: return 1; - case KW_NAMES: - return 0; case INSTRUMENTED_CALL: return 0; case CALL: - return oparg + 2; + return oparg + 3; case CALL_BOUND_METHOD_EXACT_ARGS: - return oparg + 2; + return oparg + 3; case CALL_PY_EXACT_ARGS: - return oparg + 2; + return oparg + 3; case CALL_PY_WITH_DEFAULTS: - return oparg + 2; + return oparg + 3; case CALL_NO_KW_TYPE_1: - return oparg + 2; + return oparg + 3; case CALL_NO_KW_STR_1: - return oparg + 2; + return oparg + 3; case CALL_NO_KW_TUPLE_1: - return oparg + 2; + return oparg + 3; case CALL_BUILTIN_CLASS: - return oparg + 2; + return oparg + 3; case CALL_NO_KW_BUILTIN_O: - return oparg + 2; + return oparg + 3; case CALL_NO_KW_BUILTIN_FAST: - return oparg + 2; + return oparg + 3; case CALL_BUILTIN_FAST_WITH_KEYWORDS: - return oparg + 2; + return oparg + 3; case CALL_NO_KW_LEN: - return oparg + 2; + return oparg + 3; case CALL_NO_KW_ISINSTANCE: - return oparg + 2; + return oparg + 3; case CALL_NO_KW_LIST_APPEND: - return oparg + 2; + return oparg + 3; case CALL_NO_KW_METHOD_DESCRIPTOR_O: - return oparg + 2; + return oparg + 3; case CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS: - return oparg + 2; + return oparg + 3; case CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS: - return oparg + 2; + return oparg + 3; case CALL_NO_KW_METHOD_DESCRIPTOR_FAST: - return oparg + 2; + return oparg + 3; case INSTRUMENTED_CALL_FUNCTION_EX: return 0; case CALL_FUNCTION_EX: @@ -707,8 +705,6 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) { return ((oparg & 1) ? 1 : 0) + 1; case LOAD_ATTR_METHOD_LAZY_DICT: return ((oparg & 1) ? 1 : 0) + 1; - case KW_NAMES: - return 0; case INSTRUMENTED_CALL: return 0; case CALL: @@ -953,7 +949,6 @@ const struct opcode_metadata _PyOpcode_opcode_metadata[256] = { [LOAD_ATTR_METHOD_WITH_VALUES] = { true, INSTR_FMT_IBC00000000 }, [LOAD_ATTR_METHOD_NO_DICT] = { true, INSTR_FMT_IBC00000000 }, [LOAD_ATTR_METHOD_LAZY_DICT] = { true, INSTR_FMT_IBC00000000 }, - [KW_NAMES] = { true, INSTR_FMT_IB }, [INSTRUMENTED_CALL] = { true, INSTR_FMT_IB }, [CALL] = { true, INSTR_FMT_IBC00 }, [CALL_BOUND_METHOD_EXACT_ARGS] = { true, INSTR_FMT_IBC00 }, diff --git a/Python/opcode_targets.h b/Python/opcode_targets.h index 02e6033867d661..e86939ad2605ed 100644 --- a/Python/opcode_targets.h +++ b/Python/opcode_targets.h @@ -171,7 +171,7 @@ static void *opcode_targets[256] = { &&TARGET_STORE_FAST_LOAD_FAST, &&TARGET_STORE_FAST_STORE_FAST, &&TARGET_CALL, - &&TARGET_KW_NAMES, + &&_unknown_opcode, &&TARGET_CALL_INTRINSIC_1, &&TARGET_CALL_INTRINSIC_2, &&TARGET_LOAD_FROM_DICT_OR_GLOBALS, From fc8176ead5ef2af31496cf6aa8d9a9f9c2c1a692 Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Thu, 15 Jun 2023 22:38:12 -0700 Subject: [PATCH 02/10] Bump magic number --- Lib/importlib/_bootstrap_external.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index cf68c448a6e4ec..74d6bd9a2d0797 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -450,6 +450,7 @@ def _write_atomic(path, data, mode=0o666): # Python 3.13a1 3552 (Remove LOAD_FAST__LOAD_CONST and LOAD_CONST__LOAD_FAST) # Python 3.13a1 3553 (Add SET_FUNCTION_ATTRIBUTE) # Python 3.13a1 3554 (more efficient bytecodes for f-strings) +# Python 3.13a1 3555 (Remove KW_NAMES) # Python 3.14 will start with 3600 @@ -466,7 +467,7 @@ def _write_atomic(path, data, mode=0o666): # Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array # in PC/launcher.c must also be updated. -MAGIC_NUMBER = (3554).to_bytes(2, 'little') + b'\r\n' +MAGIC_NUMBER = (3555).to_bytes(2, 'little') + b'\r\n' _RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c From dbda92328b2f7ae3bb0f642b8d5ac53b914dad21 Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Thu, 15 Jun 2023 22:57:29 -0700 Subject: [PATCH 03/10] blurb add --- .../2023-06-15-22-57-23.gh-issue-105848._gxL3O.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2023-06-15-22-57-23.gh-issue-105848._gxL3O.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-06-15-22-57-23.gh-issue-105848._gxL3O.rst b/Misc/NEWS.d/next/Core and Builtins/2023-06-15-22-57-23.gh-issue-105848._gxL3O.rst new file mode 100644 index 00000000000000..337fb821da60df --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2023-06-15-22-57-23.gh-issue-105848._gxL3O.rst @@ -0,0 +1,2 @@ +Replace the ``KW_NAMES`` opcode with either a :opcode:`PUSH_NULL` or a +:opcode:`LOAD_CONST` immediately before all :opcode:`CALL` instructions. From 8c414e5eb8ae0b94919edd1c362d4d2fed3679c5 Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Thu, 15 Jun 2023 23:05:12 -0700 Subject: [PATCH 04/10] Fix up the dis docs for CALL --- Doc/library/dis.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 8628815a5fb3c8..25c19aaf41de97 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1362,14 +1362,14 @@ iterations of the loop. .. opcode:: CALL (argc) Calls a callable object with the number of arguments specified by ``argc``, - including the named arguments specified by the preceding - :opcode:`KW_NAMES`, if any. + including the named arguments, if any. On the stack are (in ascending order), either: * NULL * The callable * The positional arguments * The named arguments + * A tuple of keyword names (or ``NULL``) or: @@ -1377,6 +1377,7 @@ iterations of the loop. * ``self`` * The remaining positional arguments * The named arguments + * A tuple of keyword names (or ``NULL``) ``argc`` is the total of the positional and named arguments, excluding ``self`` when a ``NULL`` is not present. @@ -1386,6 +1387,10 @@ iterations of the loop. returned by the callable object. .. versionadded:: 3.11 + + .. versionchanged:: 3.12 + Keyword names are now pushed to the stack instead of being indicated by + a preceding ``KW_NAMES`` instruction. .. opcode:: CALL_FUNCTION_EX (flags) From 538633f2aef4b19af342cc6ce7a1c24203966ce7 Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Thu, 15 Jun 2023 23:10:18 -0700 Subject: [PATCH 05/10] make patchcheck --- Doc/library/dis.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index e911ac36c67ced..8ce347abac4a04 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1387,7 +1387,7 @@ iterations of the loop. returned by the callable object. .. versionadded:: 3.11 - + .. versionchanged:: 3.12 Keyword names are now pushed to the stack instead of being indicated by a preceding ``KW_NAMES`` instruction. From f9a9aab093f0b3b0e2a32898fdf13c3f3cc17e87 Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Thu, 15 Jun 2023 23:30:04 -0700 Subject: [PATCH 06/10] Fix doctests --- Doc/library/dis.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 8ce347abac4a04..407e7c5f9a47c6 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -58,8 +58,9 @@ the following command can be used to display the disassembly of 3 2 LOAD_GLOBAL 1 (NULL + len) 12 LOAD_FAST 0 (alist) - 14 CALL 1 - 22 RETURN_VALUE + 14 PUSH_NULL + 16 CALL 1 + 24 RETURN_VALUE (The "2" is a line number). @@ -138,6 +139,7 @@ Example: RESUME LOAD_GLOBAL LOAD_FAST + PUSH_NULL CALL RETURN_VALUE From 8da9d1468a71ceb530d76050e988a09e377da0c5 Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Fri, 16 Jun 2023 02:52:49 -0700 Subject: [PATCH 07/10] Use the low bit of CALL for kwnames --- Doc/library/dis.rst | 25 +- Lib/dis.py | 7 + Lib/test/test_compiler_codegen.py | 3 +- Lib/test/test_dis.py | 331 ++++++++++----------- Lib/test/test_monitoring.py | 13 +- Lib/test/test_sys.py | 2 +- Objects/frameobject.c | 5 +- Programs/test_frozenmain.h | 66 ++--- Python/bytecodes.c | 133 ++++----- Python/compile.c | 34 +-- Python/generated_cases.c.h | 458 +++++++++++++++--------------- Python/opcode_metadata.h | 36 +-- Python/specialize.c | 4 +- 13 files changed, 533 insertions(+), 584 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 3385aa0f44c151..8cca8ab43b8028 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -58,9 +58,8 @@ the following command can be used to display the disassembly of 3 2 LOAD_GLOBAL 1 (NULL + len) 12 LOAD_FAST 0 (alist) - 14 PUSH_NULL - 16 CALL 1 - 24 RETURN_VALUE + 14 CALL 2 (1) + 22 RETURN_VALUE (The "2" is a line number). @@ -139,7 +138,6 @@ Example: RESUME LOAD_GLOBAL LOAD_FAST - PUSH_NULL CALL RETURN_VALUE @@ -1363,23 +1361,23 @@ iterations of the loop. .. opcode:: CALL (argc) - Calls a callable object with the number of arguments specified by ``argc``, - including the named arguments, if any. + Calls a callable object with the number of arguments specified by ``argc >> 1``, + including the named arguments, if ``argc & 1``. On the stack are (in ascending order), either: * NULL * The callable * The positional arguments - * The named arguments - * A tuple of keyword names (or ``NULL``) + * The named arguments (if ``argc & 1``) + * A tuple of keyword names (if ``argc & 1``) or: * The callable * ``self`` * The remaining positional arguments - * The named arguments - * A tuple of keyword names (or ``NULL``) + * The named arguments (if ``argc & 1``) + * A tuple of keyword names (if ``argc & 1``) ``argc`` is the total of the positional and named arguments, excluding ``self`` when a ``NULL`` is not present. @@ -1390,9 +1388,10 @@ iterations of the loop. .. versionadded:: 3.11 - .. versionchanged:: 3.12 - Keyword names are now pushed to the stack instead of being indicated by - a preceding ``KW_NAMES`` instruction. + .. versionchanged:: 3.13 + Keyword names are now found to the stack, and the presence of keyword + arguments is indicated by the low bit of the oparg (rather than a separate + ``KW_NAMES`` instruction). .. opcode:: CALL_FUNCTION_EX (flags) diff --git a/Lib/dis.py b/Lib/dis.py index f135a0bc9b4d98..2cff3559381f7a 100644 --- a/Lib/dis.py +++ b/Lib/dis.py @@ -44,6 +44,7 @@ LOAD_FAST_LOAD_FAST = opmap['LOAD_FAST_LOAD_FAST'] STORE_FAST_LOAD_FAST = opmap['STORE_FAST_LOAD_FAST'] STORE_FAST_STORE_FAST = opmap['STORE_FAST_STORE_FAST'] +CALL = opmap['CALL'] CACHE = opmap["CACHE"] @@ -586,6 +587,12 @@ def _get_instructions_bytes(code, varname_from_oparg=None, argrepr = _intrinsic_1_descs[arg] elif deop == CALL_INTRINSIC_2: argrepr = _intrinsic_2_descs[arg] + elif deop == CALL: + argval = arg >> 1 + if arg & 1: + argrepr = f"{argval} + keywords" + else: + argrepr = repr(argval) yield Instruction(_all_opname[op], op, arg, argval, argrepr, offset, start_offset, starts_line, is_jump_target, positions) diff --git a/Lib/test/test_compiler_codegen.py b/Lib/test/test_compiler_codegen.py index 400aadcf937430..e606d68582aba3 100644 --- a/Lib/test/test_compiler_codegen.py +++ b/Lib/test/test_compiler_codegen.py @@ -43,8 +43,7 @@ def test_for_loop(self): ('PUSH_NULL', None, 2), ('LOAD_NAME', 2, 2), ('LOAD_NAME', 1, 2), - ('PUSH_NULL', None, 2), - ('CALL', 1, 2), + ('CALL', (1 << 1) | 0, 2), ('POP_TOP', None), ('JUMP', loop_lbl), exit_lbl, diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index 5fb14c402eb7e4..47b79a0dc2b381 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -104,8 +104,7 @@ def _f(a): %3d LOAD_GLOBAL 1 (NULL + print) LOAD_FAST 0 (a) - PUSH_NULL - CALL 1 + CALL 2 (1) POP_TOP %3d RETURN_CONST 1 (1) @@ -118,8 +117,7 @@ def _f(a): RESUME 0 LOAD_GLOBAL 1 LOAD_FAST 0 - PUSH_NULL - CALL 1 + CALL 2 (1) POP_TOP RETURN_CONST 1 """ @@ -138,13 +136,12 @@ def bug708901(): %3d LOAD_CONST 2 (10) -%3d PUSH_NULL - CALL 2 +%3d CALL 4 (2) GET_ITER - >> FOR_ITER 3 (to 38) + >> FOR_ITER 3 (to 36) STORE_FAST 0 (res) -%3d JUMP_BACKWARD 5 (to 28) +%3d JUMP_BACKWARD 5 (to 26) %3d >> END_FOR RETURN_CONST 0 (None) @@ -169,14 +166,12 @@ def bug1333982(x=[]): MAKE_FUNCTION LOAD_FAST 0 (x) GET_ITER - PUSH_NULL - CALL 0 + CALL 0 (0) %3d LOAD_CONST 2 (1) %3d BINARY_OP 0 (+) - PUSH_NULL - CALL 0 + CALL 0 (0) RAISE_VARARGS 1 """ % (bug1333982.__code__.co_firstlineno, bug1333982.__code__.co_firstlineno + 1, @@ -246,7 +241,7 @@ def wrap_func_w_kwargs(): LOAD_CONST 2 (2) LOAD_CONST 3 (5) LOAD_CONST 4 (('c',)) - CALL 3 + CALL 7 (3 + keywords) POP_TOP RETURN_CONST 0 (None) """ % (wrap_func_w_kwargs.__code__.co_firstlineno, @@ -353,8 +348,7 @@ def wrap_func_w_kwargs(): 3 PUSH_NULL LOAD_NAME 3 (fun) LOAD_CONST 0 (1) - PUSH_NULL - CALL 1 + CALL 2 (1) LOAD_NAME 2 (__annotations__) LOAD_CONST 2 ('y') STORE_SUBSCR @@ -364,8 +358,7 @@ def wrap_func_w_kwargs(): PUSH_NULL LOAD_NAME 3 (fun) LOAD_CONST 3 (0) - PUSH_NULL - CALL 1 + CALL 2 (1) STORE_SUBSCR LOAD_NAME 1 (int) POP_TOP @@ -486,8 +479,7 @@ def _with(c): %3d LOAD_CONST 0 (None) LOAD_CONST 0 (None) LOAD_CONST 0 (None) - PUSH_NULL - CALL 2 + CALL 4 (2) POP_TOP %3d LOAD_CONST 2 (2) @@ -496,7 +488,7 @@ def _with(c): %3d >> PUSH_EXC_INFO WITH_EXCEPT_START - POP_JUMP_IF_TRUE 1 (to 44) + POP_JUMP_IF_TRUE 1 (to 42) RERAISE 2 >> POP_TOP POP_EXCEPT @@ -547,14 +539,13 @@ async def _asyncwith(c): %3d LOAD_CONST 0 (None) LOAD_CONST 0 (None) LOAD_CONST 0 (None) - PUSH_NULL - CALL 2 + CALL 4 (2) GET_AWAITABLE 2 LOAD_CONST 0 (None) - >> SEND 3 (to 62) + >> SEND 3 (to 60) YIELD_VALUE 2 RESUME 3 - JUMP_BACKWARD_NO_INTERRUPT 5 (to 52) + JUMP_BACKWARD_NO_INTERRUPT 5 (to 50) >> END_SEND POP_TOP @@ -563,20 +554,20 @@ async def _asyncwith(c): RETURN_CONST 0 (None) %3d >> CLEANUP_THROW - JUMP_BACKWARD 27 (to 24) + JUMP_BACKWARD 26 (to 24) >> CLEANUP_THROW - JUMP_BACKWARD 11 (to 62) + JUMP_BACKWARD 11 (to 60) >> PUSH_EXC_INFO WITH_EXCEPT_START GET_AWAITABLE 2 LOAD_CONST 0 (None) - >> SEND 4 (to 104) + >> SEND 4 (to 102) YIELD_VALUE 3 RESUME 3 - JUMP_BACKWARD_NO_INTERRUPT 5 (to 92) + JUMP_BACKWARD_NO_INTERRUPT 5 (to 90) >> CLEANUP_THROW >> END_SEND - POP_JUMP_IF_TRUE 1 (to 110) + POP_JUMP_IF_TRUE 1 (to 108) RERAISE 2 >> POP_TOP POP_EXCEPT @@ -624,15 +615,13 @@ def _tryfinallyconst(b): %3d PUSH_NULL LOAD_FAST 1 (b) - PUSH_NULL - CALL 0 + CALL 0 (0) POP_TOP RETURN_VALUE >> PUSH_EXC_INFO PUSH_NULL LOAD_FAST 1 (b) - PUSH_NULL - CALL 0 + CALL 0 (0) POP_TOP RERAISE 0 >> COPY 3 @@ -655,15 +644,13 @@ def _tryfinallyconst(b): %3d PUSH_NULL LOAD_FAST 0 (b) - PUSH_NULL - CALL 0 + CALL 0 (0) POP_TOP RETURN_CONST 1 (1) PUSH_EXC_INFO PUSH_NULL LOAD_FAST 0 (b) - PUSH_NULL - CALL 0 + CALL 0 (0) POP_TOP RERAISE 0 >> COPY 3 @@ -729,10 +716,8 @@ def foo(x): SET_FUNCTION_ATTRIBUTE 8 (closure) LOAD_DEREF 1 (y) GET_ITER - PUSH_NULL - CALL 0 - PUSH_NULL - CALL 1 + CALL 0 (0) + CALL 2 (1) RETURN_VALUE """ % (dis_nested_0, __file__, @@ -802,15 +787,14 @@ def loop_test(): LOAD_CONST 2 (3) BINARY_OP 5 (*) GET_ITER - >> FOR_ITER_LIST 15 (to 50) + >> FOR_ITER_LIST 14 (to 48) STORE_FAST 0 (i) %3d LOAD_GLOBAL_MODULE 1 (NULL + load_test) LOAD_FAST 0 (i) - PUSH_NULL - CALL_PY_WITH_DEFAULTS 1 + CALL_PY_WITH_DEFAULTS 2 (1) POP_TOP - JUMP_BACKWARD 17 (to 16) + JUMP_BACKWARD 16 (to 16) %3d >> END_FOR RETURN_CONST 0 (None) @@ -1247,8 +1231,7 @@ def test_call_specialize(self): 1 PUSH_NULL LOAD_NAME 0 (str) LOAD_CONST 0 (1) - PUSH_NULL - CALL_NO_KW_STR_1 1 + CALL_NO_KW_STR_1 2 (1) RETURN_VALUE """ co = compile("str(1)", "", "eval") @@ -1648,11 +1631,10 @@ def _prepare_test_cases(): Instruction(opname='BUILD_LIST', opcode=103, arg=0, argval=0, argrepr='', offset=42, start_offset=42, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='BUILD_MAP', opcode=105, arg=0, argval=0, argrepr='', offset=44, start_offset=44, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='Hello world!', argrepr="'Hello world!'", offset=46, start_offset=46, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=48, start_offset=48, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=7, argval=7, argrepr='', offset=50, start_offset=50, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=58, start_offset=58, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='f', argrepr='f', offset=60, start_offset=60, starts_line=8, is_jump_target=False, positions=None), - Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=62, start_offset=62, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=14, argval=7, argrepr='7', offset=48, start_offset=48, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=56, start_offset=56, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='f', argrepr='f', offset=58, start_offset=58, starts_line=8, is_jump_target=False, positions=None), + Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=60, start_offset=60, starts_line=None, is_jump_target=False, positions=None), ] expected_opinfo_f = [ @@ -1676,11 +1658,10 @@ def _prepare_test_cases(): Instruction(opname='LOAD_DEREF', opcode=137, arg=4, argval='b', argrepr='b', offset=42, start_offset=42, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_DEREF', opcode=137, arg=0, argval='c', argrepr='c', offset=44, start_offset=44, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_DEREF', opcode=137, arg=1, argval='d', argrepr='d', offset=46, start_offset=46, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=48, start_offset=48, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=4, argval=4, argrepr='', offset=50, start_offset=50, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=58, start_offset=58, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='inner', argrepr='inner', offset=60, start_offset=60, starts_line=6, is_jump_target=False, positions=None), - Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=62, start_offset=62, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=8, argval=4, argrepr='4', offset=48, start_offset=48, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=56, start_offset=56, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=2, argval='inner', argrepr='inner', offset=58, start_offset=58, starts_line=6, is_jump_target=False, positions=None), + Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=60, start_offset=60, starts_line=None, is_jump_target=False, positions=None), ] expected_opinfo_inner = [ @@ -1692,136 +1673,125 @@ def _prepare_test_cases(): Instruction(opname='LOAD_DEREF', opcode=137, arg=4, argval='c', argrepr='c', offset=18, start_offset=18, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_DEREF', opcode=137, arg=5, argval='d', argrepr='d', offset=20, start_offset=20, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_FAST_LOAD_FAST', opcode=168, arg=1, argval=('e', 'f'), argrepr='e, f', offset=22, start_offset=22, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=24, start_offset=24, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=6, argval=6, argrepr='', offset=26, start_offset=26, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=34, start_offset=34, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='RETURN_CONST', opcode=121, arg=0, argval=None, argrepr='None', offset=36, start_offset=36, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=12, argval=6, argrepr='6', offset=24, start_offset=24, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=32, start_offset=32, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='RETURN_CONST', opcode=121, arg=0, argval=None, argrepr='None', offset=34, start_offset=34, starts_line=None, is_jump_target=False, positions=None), ] expected_opinfo_jumpy = [ Instruction(opname='RESUME', opcode=151, arg=0, argval=0, argrepr='', offset=0, start_offset=0, starts_line=1, is_jump_target=False, positions=None), Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='range', argrepr='NULL + range', offset=2, start_offset=2, starts_line=3, is_jump_target=False, positions=None), Instruction(opname='LOAD_CONST', opcode=100, arg=1, argval=10, argrepr='10', offset=12, start_offset=12, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=14, start_offset=14, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=16, start_offset=16, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='GET_ITER', opcode=68, arg=None, argval=None, argrepr='', offset=24, start_offset=24, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='FOR_ITER', opcode=93, arg=29, argval=88, argrepr='to 88', offset=26, start_offset=26, starts_line=None, is_jump_target=True, positions=None), - Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', argrepr='i', offset=30, start_offset=30, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=32, start_offset=32, starts_line=4, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=42, start_offset=42, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=44, start_offset=44, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=46, start_offset=46, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=54, start_offset=54, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=56, start_offset=56, starts_line=5, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=58, start_offset=58, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='COMPARE_OP', opcode=107, arg=2, argval='<', argrepr='<', offset=60, start_offset=60, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=2, argval=70, argrepr='to 70', offset=64, start_offset=64, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='JUMP_BACKWARD', opcode=140, arg=22, argval=26, argrepr='to 26', offset=66, start_offset=66, starts_line=6, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=70, start_offset=70, starts_line=7, is_jump_target=True, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, argrepr='6', offset=72, start_offset=72, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='COMPARE_OP', opcode=107, arg=68, argval='>', argrepr='>', offset=74, start_offset=74, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_JUMP_IF_TRUE', opcode=115, arg=2, argval=84, argrepr='to 84', offset=78, start_offset=78, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='JUMP_BACKWARD', opcode=140, arg=29, argval=26, argrepr='to 26', offset=80, start_offset=80, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=84, start_offset=84, starts_line=8, is_jump_target=True, positions=None), - Instruction(opname='JUMP_FORWARD', opcode=110, arg=13, argval=114, argrepr='to 114', offset=86, start_offset=86, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='END_FOR', opcode=4, arg=None, argval=None, argrepr='', offset=88, start_offset=88, starts_line=3, is_jump_target=True, positions=None), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=90, start_offset=90, starts_line=10, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='I can haz else clause?', argrepr="'I can haz else clause?'", offset=100, start_offset=100, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=102, start_offset=102, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=104, start_offset=104, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=112, start_offset=112, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST_CHECK', opcode=127, arg=0, argval='i', argrepr='i', offset=114, start_offset=114, starts_line=11, is_jump_target=True, positions=None), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=34, argval=186, argrepr='to 186', offset=116, start_offset=116, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=118, start_offset=118, starts_line=12, is_jump_target=True, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=128, start_offset=128, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=130, start_offset=130, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=132, start_offset=132, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=140, start_offset=140, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=142, start_offset=142, starts_line=13, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, argrepr='1', offset=144, start_offset=144, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='BINARY_OP', opcode=122, arg=23, argval=23, argrepr='-=', offset=146, start_offset=146, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', argrepr='i', offset=150, start_offset=150, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=152, start_offset=152, starts_line=14, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, argrepr='6', offset=154, start_offset=154, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='COMPARE_OP', opcode=107, arg=68, argval='>', argrepr='>', offset=156, start_offset=156, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=2, argval=166, argrepr='to 166', offset=160, start_offset=160, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='JUMP_BACKWARD', opcode=140, arg=26, argval=114, argrepr='to 114', offset=162, start_offset=162, starts_line=15, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=166, start_offset=166, starts_line=16, is_jump_target=True, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=168, start_offset=168, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='COMPARE_OP', opcode=107, arg=2, argval='<', argrepr='<', offset=170, start_offset=170, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=1, argval=178, argrepr='to 178', offset=174, start_offset=174, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='JUMP_FORWARD', opcode=110, arg=16, argval=210, argrepr='to 210', offset=176, start_offset=176, starts_line=17, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=178, start_offset=178, starts_line=11, is_jump_target=True, positions=None), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=2, argval=186, argrepr='to 186', offset=180, start_offset=180, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='JUMP_BACKWARD', opcode=140, arg=34, argval=118, argrepr='to 118', offset=182, start_offset=182, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=186, start_offset=186, starts_line=19, is_jump_target=True, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=6, argval='Who let lolcatz into this test suite?', argrepr="'Who let lolcatz into this test suite?'", offset=196, start_offset=196, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=198, start_offset=198, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=200, start_offset=200, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=208, start_offset=208, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='NOP', opcode=9, arg=None, argval=None, argrepr='', offset=210, start_offset=210, starts_line=20, is_jump_target=True, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, argrepr='1', offset=212, start_offset=212, starts_line=21, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=7, argval=0, argrepr='0', offset=214, start_offset=214, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='BINARY_OP', opcode=122, arg=11, argval=11, argrepr='/', offset=216, start_offset=216, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=220, start_offset=220, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=222, start_offset=222, starts_line=25, is_jump_target=False, positions=None), - Instruction(opname='BEFORE_WITH', opcode=53, arg=None, argval=None, argrepr='', offset=224, start_offset=224, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='STORE_FAST', opcode=125, arg=1, argval='dodgy', argrepr='dodgy', offset=226, start_offset=226, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=228, start_offset=228, starts_line=26, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=8, argval='Never reach this', argrepr="'Never reach this'", offset=238, start_offset=238, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=240, start_offset=240, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=242, start_offset=242, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=250, start_offset=250, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=252, start_offset=252, starts_line=25, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=254, start_offset=254, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=256, start_offset=256, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=258, start_offset=258, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=2, argval=2, argrepr='', offset=260, start_offset=260, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=268, start_offset=268, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=270, start_offset=270, starts_line=28, is_jump_target=True, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=280, start_offset=280, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=282, start_offset=282, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=284, start_offset=284, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=2, argval=1, argrepr='1', offset=14, start_offset=14, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='GET_ITER', opcode=68, arg=None, argval=None, argrepr='', offset=22, start_offset=22, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='FOR_ITER', opcode=93, arg=28, argval=84, argrepr='to 84', offset=24, start_offset=24, starts_line=None, is_jump_target=True, positions=None), + Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', argrepr='i', offset=28, start_offset=28, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=30, start_offset=30, starts_line=4, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=40, start_offset=40, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=2, argval=1, argrepr='1', offset=42, start_offset=42, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=50, start_offset=50, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=52, start_offset=52, starts_line=5, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=54, start_offset=54, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='COMPARE_OP', opcode=107, arg=2, argval='<', argrepr='<', offset=56, start_offset=56, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=2, argval=66, argrepr='to 66', offset=60, start_offset=60, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='JUMP_BACKWARD', opcode=140, arg=21, argval=24, argrepr='to 24', offset=62, start_offset=62, starts_line=6, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=66, start_offset=66, starts_line=7, is_jump_target=True, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, argrepr='6', offset=68, start_offset=68, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='COMPARE_OP', opcode=107, arg=68, argval='>', argrepr='>', offset=70, start_offset=70, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_JUMP_IF_TRUE', opcode=115, arg=2, argval=80, argrepr='to 80', offset=74, start_offset=74, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='JUMP_BACKWARD', opcode=140, arg=28, argval=24, argrepr='to 24', offset=76, start_offset=76, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=80, start_offset=80, starts_line=8, is_jump_target=True, positions=None), + Instruction(opname='JUMP_FORWARD', opcode=110, arg=12, argval=108, argrepr='to 108', offset=82, start_offset=82, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='END_FOR', opcode=4, arg=None, argval=None, argrepr='', offset=84, start_offset=84, starts_line=3, is_jump_target=True, positions=None), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=86, start_offset=86, starts_line=10, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='I can haz else clause?', argrepr="'I can haz else clause?'", offset=96, start_offset=96, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=2, argval=1, argrepr='1', offset=98, start_offset=98, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=106, start_offset=106, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST_CHECK', opcode=127, arg=0, argval='i', argrepr='i', offset=108, start_offset=108, starts_line=11, is_jump_target=True, positions=None), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=33, argval=178, argrepr='to 178', offset=110, start_offset=110, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=112, start_offset=112, starts_line=12, is_jump_target=True, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=122, start_offset=122, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=2, argval=1, argrepr='1', offset=124, start_offset=124, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=132, start_offset=132, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=134, start_offset=134, starts_line=13, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, argrepr='1', offset=136, start_offset=136, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='BINARY_OP', opcode=122, arg=23, argval=23, argrepr='-=', offset=138, start_offset=138, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', argrepr='i', offset=142, start_offset=142, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=144, start_offset=144, starts_line=14, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, argrepr='6', offset=146, start_offset=146, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='COMPARE_OP', opcode=107, arg=68, argval='>', argrepr='>', offset=148, start_offset=148, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=2, argval=158, argrepr='to 158', offset=152, start_offset=152, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='JUMP_BACKWARD', opcode=140, arg=25, argval=108, argrepr='to 108', offset=154, start_offset=154, starts_line=15, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=158, start_offset=158, starts_line=16, is_jump_target=True, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=160, start_offset=160, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='COMPARE_OP', opcode=107, arg=2, argval='<', argrepr='<', offset=162, start_offset=162, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=1, argval=170, argrepr='to 170', offset=166, start_offset=166, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='JUMP_FORWARD', opcode=110, arg=15, argval=200, argrepr='to 200', offset=168, start_offset=168, starts_line=17, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=170, start_offset=170, starts_line=11, is_jump_target=True, positions=None), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=2, argval=178, argrepr='to 178', offset=172, start_offset=172, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='JUMP_BACKWARD', opcode=140, arg=33, argval=112, argrepr='to 112', offset=174, start_offset=174, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=178, start_offset=178, starts_line=19, is_jump_target=True, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=6, argval='Who let lolcatz into this test suite?', argrepr="'Who let lolcatz into this test suite?'", offset=188, start_offset=188, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=2, argval=1, argrepr='1', offset=190, start_offset=190, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=198, start_offset=198, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='NOP', opcode=9, arg=None, argval=None, argrepr='', offset=200, start_offset=200, starts_line=20, is_jump_target=True, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, argrepr='1', offset=202, start_offset=202, starts_line=21, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=7, argval=0, argrepr='0', offset=204, start_offset=204, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='BINARY_OP', opcode=122, arg=11, argval=11, argrepr='/', offset=206, start_offset=206, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=210, start_offset=210, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=212, start_offset=212, starts_line=25, is_jump_target=False, positions=None), + Instruction(opname='BEFORE_WITH', opcode=53, arg=None, argval=None, argrepr='', offset=214, start_offset=214, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='STORE_FAST', opcode=125, arg=1, argval='dodgy', argrepr='dodgy', offset=216, start_offset=216, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=218, start_offset=218, starts_line=26, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=8, argval='Never reach this', argrepr="'Never reach this'", offset=228, start_offset=228, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=2, argval=1, argrepr='1', offset=230, start_offset=230, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=238, start_offset=238, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=240, start_offset=240, starts_line=25, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=242, start_offset=242, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=244, start_offset=244, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=4, argval=2, argrepr='2', offset=246, start_offset=246, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=254, start_offset=254, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=256, start_offset=256, starts_line=28, is_jump_target=True, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=266, start_offset=266, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=2, argval=1, argrepr='1', offset=268, start_offset=268, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=276, start_offset=276, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='RETURN_CONST', opcode=121, arg=0, argval=None, argrepr='None', offset=278, start_offset=278, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='PUSH_EXC_INFO', opcode=35, arg=None, argval=None, argrepr='', offset=280, start_offset=280, starts_line=25, is_jump_target=False, positions=None), + Instruction(opname='WITH_EXCEPT_START', opcode=49, arg=None, argval=None, argrepr='', offset=282, start_offset=282, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_JUMP_IF_TRUE', opcode=115, arg=1, argval=288, argrepr='to 288', offset=284, start_offset=284, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='RERAISE', opcode=119, arg=2, argval=2, argrepr='', offset=286, start_offset=286, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=288, start_offset=288, starts_line=None, is_jump_target=True, positions=None), + Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=290, start_offset=290, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=292, start_offset=292, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='RETURN_CONST', opcode=121, arg=0, argval=None, argrepr='None', offset=294, start_offset=294, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='PUSH_EXC_INFO', opcode=35, arg=None, argval=None, argrepr='', offset=296, start_offset=296, starts_line=25, is_jump_target=False, positions=None), - Instruction(opname='WITH_EXCEPT_START', opcode=49, arg=None, argval=None, argrepr='', offset=298, start_offset=298, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_JUMP_IF_TRUE', opcode=115, arg=1, argval=304, argrepr='to 304', offset=300, start_offset=300, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='RERAISE', opcode=119, arg=2, argval=2, argrepr='', offset=302, start_offset=302, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=304, start_offset=304, starts_line=None, is_jump_target=True, positions=None), - Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=306, start_offset=306, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=308, start_offset=308, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=310, start_offset=310, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='JUMP_BACKWARD', opcode=140, arg=23, argval=270, argrepr='to 270', offset=312, start_offset=312, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=316, start_offset=316, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=318, start_offset=318, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=320, start_offset=320, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='PUSH_EXC_INFO', opcode=35, arg=None, argval=None, argrepr='', offset=322, start_offset=322, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=4, argval='ZeroDivisionError', argrepr='ZeroDivisionError', offset=324, start_offset=324, starts_line=22, is_jump_target=False, positions=None), - Instruction(opname='CHECK_EXC_MATCH', opcode=36, arg=None, argval=None, argrepr='', offset=334, start_offset=334, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=16, argval=370, argrepr='to 370', offset=336, start_offset=336, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=338, start_offset=338, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=340, start_offset=340, starts_line=23, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=9, argval='Here we go, here we go, here we go...', argrepr="'Here we go, here we go, here we go...'", offset=350, start_offset=350, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=352, start_offset=352, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=354, start_offset=354, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=362, start_offset=362, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=364, start_offset=364, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='JUMP_BACKWARD', opcode=140, arg=50, argval=270, argrepr='to 270', offset=366, start_offset=366, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='RERAISE', opcode=119, arg=0, argval=0, argrepr='', offset=370, start_offset=370, starts_line=22, is_jump_target=True, positions=None), - Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=372, start_offset=372, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=374, start_offset=374, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=376, start_offset=376, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='PUSH_EXC_INFO', opcode=35, arg=None, argval=None, argrepr='', offset=378, start_offset=378, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=380, start_offset=380, starts_line=28, is_jump_target=False, positions=None), - Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=390, start_offset=390, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='PUSH_NULL', opcode=2, arg=None, argval=None, argrepr='', offset=392, start_offset=392, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=394, start_offset=394, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=402, start_offset=402, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='RERAISE', opcode=119, arg=0, argval=0, argrepr='', offset=404, start_offset=404, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=406, start_offset=406, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=408, start_offset=408, starts_line=None, is_jump_target=False, positions=None), - Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=410, start_offset=410, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=294, start_offset=294, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='JUMP_BACKWARD', opcode=140, arg=22, argval=256, argrepr='to 256', offset=296, start_offset=296, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=300, start_offset=300, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=302, start_offset=302, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=304, start_offset=304, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='PUSH_EXC_INFO', opcode=35, arg=None, argval=None, argrepr='', offset=306, start_offset=306, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=4, argval='ZeroDivisionError', argrepr='ZeroDivisionError', offset=308, start_offset=308, starts_line=22, is_jump_target=False, positions=None), + Instruction(opname='CHECK_EXC_MATCH', opcode=36, arg=None, argval=None, argrepr='', offset=318, start_offset=318, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=15, argval=352, argrepr='to 352', offset=320, start_offset=320, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=322, start_offset=322, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=324, start_offset=324, starts_line=23, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=9, argval='Here we go, here we go, here we go...', argrepr="'Here we go, here we go, here we go...'", offset=334, start_offset=334, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=2, argval=1, argrepr='1', offset=336, start_offset=336, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=344, start_offset=344, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=346, start_offset=346, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='JUMP_BACKWARD', opcode=140, arg=48, argval=256, argrepr='to 256', offset=348, start_offset=348, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='RERAISE', opcode=119, arg=0, argval=0, argrepr='', offset=352, start_offset=352, starts_line=22, is_jump_target=True, positions=None), + Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=354, start_offset=354, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=356, start_offset=356, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=358, start_offset=358, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='PUSH_EXC_INFO', opcode=35, arg=None, argval=None, argrepr='', offset=360, start_offset=360, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=362, start_offset=362, starts_line=28, is_jump_target=False, positions=None), + Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=372, start_offset=372, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='CALL', opcode=171, arg=2, argval=1, argrepr='1', offset=374, start_offset=374, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=382, start_offset=382, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='RERAISE', opcode=119, arg=0, argval=0, argrepr='', offset=384, start_offset=384, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=386, start_offset=386, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=388, start_offset=388, starts_line=None, is_jump_target=False, positions=None), + Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=390, start_offset=390, starts_line=None, is_jump_target=False, positions=None), ] # One last piece of inspect fodder to check the default line number handling @@ -1889,7 +1859,6 @@ def test_co_positions(self): (2, 2, 8, 9), (1, 3, 0, 1), (1, 3, 0, 1), - (1, 3, 0, 1), (1, 3, 0, 1) ] self.assertEqual(positions, expected) diff --git a/Lib/test/test_monitoring.py b/Lib/test/test_monitoring.py index 6f843462bb6e0f..f854c582846660 100644 --- a/Lib/test/test_monitoring.py +++ b/Lib/test/test_monitoring.py @@ -838,12 +838,11 @@ def func2(): ('instruction', 'func2', 8), ('instruction', 'func2', 28), ('instruction', 'func2', 30), - ('instruction', 'func2', 32), - ('instruction', 'func2', 40), + ('instruction', 'func2', 38), ('line', 'func2', 3), + ('instruction', 'func2', 40), ('instruction', 'func2', 42), ('instruction', 'func2', 44), - ('instruction', 'func2', 46), ('line', 'check_events', 11)]) def test_try_except(self): @@ -1159,8 +1158,8 @@ def func(): ('line', 'func', 5), ('line', 'meth', 1), ('jump', 'func', 5, 5), - ('jump', 'func', 5, '[offset=116]'), - ('branch', 'func', '[offset=122]', '[offset=124]'), + ('jump', 'func', 5, '[offset=112]'), + ('branch', 'func', '[offset=118]', '[offset=120]'), ('line', 'check_events', 11)]) self.check_events(func, recorders = FLOW_AND_LINE_RECORDERS, expected = [ @@ -1175,8 +1174,8 @@ def func(): ('line', 'meth', 1), ('return', None), ('jump', 'func', 5, 5), - ('jump', 'func', 5, '[offset=116]'), - ('branch', 'func', '[offset=122]', '[offset=124]'), + ('jump', 'func', 5, '[offset=112]'), + ('branch', 'func', '[offset=118]', '[offset=120]'), ('return', None), ('line', 'check_events', 11)]) diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index ae1c8000921ca5..d81501f6f1df6a 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -1446,7 +1446,7 @@ class C(object): pass def func(): return sys._getframe() x = func() - check(x, size('3Pi3c7P2ic??3P')) + check(x, size('3Pi3c7P2ic??2P')) # function def func(): pass check(func, size('15Pi')) diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 954292c1f30111..e1b29b9ab21e3a 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -425,8 +425,9 @@ mark_stacks(PyCodeObject *code_obj, int len) } case CALL: { - int args = oparg; - for (int j = 0; j < args+3; j++) { + int args = oparg >> 1; + bool kwnames = oparg & 1; + for (int j = 0; j < 2 + args + kwnames; j++) { next_stack = pop_value(next_stack); } next_stack = push_value(next_stack, Object); diff --git a/Programs/test_frozenmain.h b/Programs/test_frozenmain.h index 6aa184e8f4ff89..5f5ba7663e83b1 100644 --- a/Programs/test_frozenmain.h +++ b/Programs/test_frozenmain.h @@ -1,38 +1,38 @@ // Auto-generated by Programs/freeze_test_frozenmain.py unsigned char M_test_frozenmain[] = { 227,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0, - 0,0,0,0,0,243,172,0,0,0,151,0,100,0,100,1, + 0,0,0,0,0,243,164,0,0,0,151,0,100,0,100,1, 108,0,90,0,100,0,100,1,108,1,90,1,2,0,101,2, - 100,2,2,0,171,1,0,0,0,0,0,0,1,0,2,0, - 101,2,100,3,101,0,106,6,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,2,0,171,2,0,0, - 0,0,0,0,1,0,2,0,101,1,106,8,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0, - 171,0,0,0,0,0,0,0,100,4,25,0,0,0,90,5, - 100,5,68,0,93,21,0,0,90,6,2,0,101,2,100,6, - 101,6,40,0,100,7,101,5,101,6,25,0,0,0,40,0, - 157,4,2,0,171,1,0,0,0,0,0,0,1,0,140,23, - 0,0,4,0,121,1,41,8,233,0,0,0,0,78,122,18, - 70,114,111,122,101,110,32,72,101,108,108,111,32,87,111,114, - 108,100,122,8,115,121,115,46,97,114,103,118,218,6,99,111, - 110,102,105,103,41,5,218,12,112,114,111,103,114,97,109,95, - 110,97,109,101,218,10,101,120,101,99,117,116,97,98,108,101, - 218,15,117,115,101,95,101,110,118,105,114,111,110,109,101,110, - 116,218,17,99,111,110,102,105,103,117,114,101,95,99,95,115, - 116,100,105,111,218,14,98,117,102,102,101,114,101,100,95,115, - 116,100,105,111,122,7,99,111,110,102,105,103,32,122,2,58, - 32,41,7,218,3,115,121,115,218,17,95,116,101,115,116,105, - 110,116,101,114,110,97,108,99,97,112,105,218,5,112,114,105, - 110,116,218,4,97,114,103,118,218,11,103,101,116,95,99,111, - 110,102,105,103,115,114,3,0,0,0,218,3,107,101,121,169, - 0,243,0,0,0,0,250,18,116,101,115,116,95,102,114,111, - 122,101,110,109,97,105,110,46,112,121,250,8,60,109,111,100, - 117,108,101,62,114,18,0,0,0,1,0,0,0,115,102,0, - 0,0,240,3,1,1,1,243,8,0,1,11,219,0,24,225, - 0,5,208,6,26,213,0,27,217,0,5,128,106,144,35,151, - 40,145,40,213,0,27,216,9,38,208,9,26,215,9,38,209, - 9,38,212,9,40,168,24,209,9,50,128,6,240,2,6,12, - 2,242,0,7,1,42,128,67,241,14,0,5,10,136,71,144, - 67,144,53,152,2,152,54,160,35,153,59,152,45,208,10,40, - 215,4,41,241,15,7,1,42,114,16,0,0,0, + 100,2,171,2,0,0,0,0,0,0,1,0,2,0,101,2, + 100,3,101,0,106,6,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,171,4,0,0,0,0,0,0, + 1,0,2,0,101,1,106,8,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,171,0,0,0,0,0, + 0,0,100,4,25,0,0,0,90,5,100,5,68,0,93,20, + 0,0,90,6,2,0,101,2,100,6,101,6,40,0,100,7, + 101,5,101,6,25,0,0,0,40,0,157,4,171,2,0,0, + 0,0,0,0,1,0,140,22,0,0,4,0,121,1,41,8, + 233,0,0,0,0,78,122,18,70,114,111,122,101,110,32,72, + 101,108,108,111,32,87,111,114,108,100,122,8,115,121,115,46, + 97,114,103,118,218,6,99,111,110,102,105,103,41,5,218,12, + 112,114,111,103,114,97,109,95,110,97,109,101,218,10,101,120, + 101,99,117,116,97,98,108,101,218,15,117,115,101,95,101,110, + 118,105,114,111,110,109,101,110,116,218,17,99,111,110,102,105, + 103,117,114,101,95,99,95,115,116,100,105,111,218,14,98,117, + 102,102,101,114,101,100,95,115,116,100,105,111,122,7,99,111, + 110,102,105,103,32,122,2,58,32,41,7,218,3,115,121,115, + 218,17,95,116,101,115,116,105,110,116,101,114,110,97,108,99, + 97,112,105,218,5,112,114,105,110,116,218,4,97,114,103,118, + 218,11,103,101,116,95,99,111,110,102,105,103,115,114,3,0, + 0,0,218,3,107,101,121,169,0,243,0,0,0,0,250,18, + 116,101,115,116,95,102,114,111,122,101,110,109,97,105,110,46, + 112,121,250,8,60,109,111,100,117,108,101,62,114,18,0,0, + 0,1,0,0,0,115,102,0,0,0,240,3,1,1,1,243, + 8,0,1,11,219,0,24,225,0,5,208,6,26,212,0,27, + 217,0,5,128,106,144,35,151,40,145,40,212,0,27,216,9, + 38,208,9,26,215,9,38,209,9,38,211,9,40,168,24,209, + 9,50,128,6,240,2,6,12,2,242,0,7,1,42,128,67, + 241,14,0,5,10,136,71,144,67,144,53,152,2,152,54,160, + 35,153,59,152,45,208,10,40,214,4,41,241,15,7,1,42, + 114,16,0,0,0, }; diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 618d26f4b54f54..e6758dc21b2a05 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -2642,11 +2642,11 @@ dummy_func( } inst(INSTRUMENTED_CALL, ( -- )) { - int is_meth = PEEK(oparg + 3) != NULL; - int total_args = oparg + is_meth; - PyObject *function = PEEK(total_args + 2); + int is_meth = PEEK((oparg >> 1) + 2 + (oparg & 1)) != NULL; + int total_args = (oparg >> 1) + is_meth; + PyObject *function = PEEK(total_args + 1 + (oparg & 1)); PyObject *arg = total_args == 0 ? - &_PyInstrumentation_MISSING : PEEK(total_args + 1); + &_PyInstrumentation_MISSING : PEEK(total_args + (oparg & 1)); int err = _Py_call_instrumentation_2args( tstate, PY_MONITORING_EVENT_CALL, frame, next_instr-1, function, arg); @@ -2680,14 +2680,14 @@ dummy_func( }; // On entry, the stack is either - // [NULL, callable, arg1, arg2, ..., kwnames] + // [NULL, callable, arg1, arg2, ..., (kwnames)] // or - // [method, self, arg1, arg2, ..., kwnames] + // [method, self, arg1, arg2, ..., (kwnames)] // On exit, the stack is [result]. // When calling Python, inline the call using DISPATCH_INLINED(). - inst(CALL, (unused/1, unused/2, method, callable, args[oparg], kwnames -- res)) { + inst(CALL, (unused/1, unused/2, method, callable, args[oparg >> 1], kwnames if (oparg & 1) -- res)) { int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { callable = method; args--; @@ -2704,7 +2704,7 @@ dummy_func( DECREMENT_ADAPTIVE_COUNTER(cache->counter); #endif /* ENABLE_SPECIALIZATION */ if (!is_meth && Py_TYPE(callable) == &PyMethod_Type) { - is_meth = 1; // For consistenct; it's dead, though + is_meth = 1; // For consistency; it's dead, though args--; total_args++; PyObject *self = ((PyMethodObject *)callable)->im_self; @@ -2728,7 +2728,7 @@ dummy_func( ); Py_XDECREF(kwnames); // Manipulate stack directly since we leave using DISPATCH_INLINED(). - STACK_SHRINK(oparg + 3); + STACK_SHRINK((oparg >> 1) + 2 + (oparg & 1)); // The frame has stolen all the arguments from the stack, // so there is no need to clean them up. if (new_frame == NULL) { @@ -2745,7 +2745,7 @@ dummy_func( kwnames); if (opcode == INSTRUMENTED_CALL) { PyObject *arg = total_args == 0 ? - &_PyInstrumentation_MISSING : PEEK(total_args + 1); + &_PyInstrumentation_MISSING : PEEK(total_args + (oparg & 1)); if (res == NULL) { _Py_call_instrumentation_exc2( tstate, PY_MONITORING_EVENT_C_RAISE, @@ -2773,23 +2773,24 @@ dummy_func( // Start out with [NULL, bound_method, arg1, arg2, ...] // Transform to [callable, self, arg1, arg2, ...] // Then fall through to CALL_PY_EXACT_ARGS - inst(CALL_BOUND_METHOD_EXACT_ARGS, (unused/1, unused/2, method, callable, unused[oparg], unused -- unused)) { + inst(CALL_BOUND_METHOD_EXACT_ARGS, (unused/1, unused/2, method, callable, unused[oparg >> 1], unused if (oparg & 1) -- unused)) { + assert((oparg & 1) == 0); DEOPT_IF(method != NULL, CALL); DEOPT_IF(Py_TYPE(callable) != &PyMethod_Type, CALL); STAT_INC(CALL, hit); PyObject *self = ((PyMethodObject *)callable)->im_self; - PEEK(oparg + 2) = Py_NewRef(self); // callable + PEEK((oparg >> 1) + 1) = Py_NewRef(self); // callable PyObject *meth = ((PyMethodObject *)callable)->im_func; - PEEK(oparg + 3) = Py_NewRef(meth); // method + PEEK((oparg >> 1) + 2) = Py_NewRef(meth); // method Py_DECREF(callable); GO_TO_INSTRUCTION(CALL_PY_EXACT_ARGS); } - inst(CALL_PY_EXACT_ARGS, (unused/1, func_version/2, method, callable, args[oparg], kwnames -- unused)) { - assert(kwnames == NULL); + inst(CALL_PY_EXACT_ARGS, (unused/1, func_version/2, method, callable, args[oparg >> 1], unused if (oparg & 1) -- unused)) { + assert((oparg & 1) == 0); DEOPT_IF(tstate->interp->eval_frame, CALL); int is_meth = method != NULL; - int argcount = oparg; + int argcount = oparg >> 1; if (is_meth) { callable = method; args--; @@ -2807,17 +2808,17 @@ dummy_func( new_frame->localsplus[i] = args[i]; } // Manipulate stack directly since we leave using DISPATCH_INLINED(). - STACK_SHRINK(oparg + 3); + STACK_SHRINK((oparg >> 1) + 2); SKIP_OVER(INLINE_CACHE_ENTRIES_CALL); frame->return_offset = 0; DISPATCH_INLINED(new_frame); } - inst(CALL_PY_WITH_DEFAULTS, (unused/1, func_version/2, method, callable, args[oparg], kwnames -- unused)) { - assert(kwnames == NULL); + inst(CALL_PY_WITH_DEFAULTS, (unused/1, func_version/2, method, callable, args[oparg >> 1], unused if (oparg & 1) -- unused)) { + assert((oparg & 1) == 0); DEOPT_IF(tstate->interp->eval_frame, CALL); int is_meth = method != NULL; - int argcount = oparg; + int argcount = oparg >> 1; if (is_meth) { callable = method; args--; @@ -2845,15 +2846,15 @@ dummy_func( new_frame->localsplus[i] = Py_NewRef(def); } // Manipulate stack and cache directly since we leave using DISPATCH_INLINED(). - STACK_SHRINK(oparg + 3); + STACK_SHRINK((oparg >> 1) + 2); SKIP_OVER(INLINE_CACHE_ENTRIES_CALL); frame->return_offset = 0; DISPATCH_INLINED(new_frame); } - inst(CALL_NO_KW_TYPE_1, (unused/1, unused/2, null, callable, args[oparg], kwnames -- res)) { - assert(kwnames == NULL); - assert(oparg == 1); + inst(CALL_NO_KW_TYPE_1, (unused/1, unused/2, null, callable, args[oparg >> 1], unused if (oparg & 1) -- res)) { + assert((oparg & 1) == 0); + assert(oparg >> 1 == 1); DEOPT_IF(null != NULL, CALL); PyObject *obj = args[0]; DEOPT_IF(callable != (PyObject *)&PyType_Type, CALL); @@ -2863,9 +2864,9 @@ dummy_func( Py_DECREF(&PyType_Type); // I.e., callable } - inst(CALL_NO_KW_STR_1, (unused/1, unused/2, null, callable, args[oparg], kwnames -- res)) { - assert(kwnames == NULL); - assert(oparg == 1); + inst(CALL_NO_KW_STR_1, (unused/1, unused/2, null, callable, args[oparg >> 1], unused if (oparg & 1) -- res)) { + assert((oparg & 1) == 0); + assert(oparg >> 1 == 1); DEOPT_IF(null != NULL, CALL); DEOPT_IF(callable != (PyObject *)&PyUnicode_Type, CALL); STAT_INC(CALL, hit); @@ -2877,9 +2878,9 @@ dummy_func( CHECK_EVAL_BREAKER(); } - inst(CALL_NO_KW_TUPLE_1, (unused/1, unused/2, null, callable, args[oparg], kwnames -- res)) { - assert(kwnames == NULL); - assert(oparg == 1); + inst(CALL_NO_KW_TUPLE_1, (unused/1, unused/2, null, callable, args[oparg >> 1], unused if (oparg & 1) -- res)) { + assert((oparg & 1) == 0); + assert(oparg >> 1 == 1); DEOPT_IF(null != NULL, CALL); DEOPT_IF(callable != (PyObject *)&PyTuple_Type, CALL); STAT_INC(CALL, hit); @@ -2891,9 +2892,9 @@ dummy_func( CHECK_EVAL_BREAKER(); } - inst(CALL_BUILTIN_CLASS, (unused/1, unused/2, method, callable, args[oparg], kwnames -- res)) { + inst(CALL_BUILTIN_CLASS, (unused/1, unused/2, method, callable, args[oparg >> 1], kwnames if (oparg & 1) -- res)) { int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { callable = method; args--; @@ -2916,11 +2917,11 @@ dummy_func( CHECK_EVAL_BREAKER(); } - inst(CALL_NO_KW_BUILTIN_O, (unused/1, unused/2, method, callable, args[oparg], kwnames -- res)) { + inst(CALL_NO_KW_BUILTIN_O, (unused/1, unused/2, method, callable, args[oparg >> 1], unused if (oparg & 1) -- res)) { /* Builtin METH_O functions */ - assert(kwnames == NULL); + assert((oparg & 1) == 0); int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { callable = method; args--; @@ -2947,11 +2948,11 @@ dummy_func( CHECK_EVAL_BREAKER(); } - inst(CALL_NO_KW_BUILTIN_FAST, (unused/1, unused/2, method, callable, args[oparg], kwnames -- res)) { + inst(CALL_NO_KW_BUILTIN_FAST, (unused/1, unused/2, method, callable, args[oparg >> 1], unused if (oparg & 1) -- res)) { /* Builtin METH_FASTCALL functions, without keywords */ - assert(kwnames == NULL); + assert((oparg & 1) == 0); int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { callable = method; args--; @@ -2982,10 +2983,10 @@ dummy_func( CHECK_EVAL_BREAKER(); } - inst(CALL_BUILTIN_FAST_WITH_KEYWORDS, (unused/1, unused/2, method, callable, args[oparg], kwnames -- res)) { + inst(CALL_BUILTIN_FAST_WITH_KEYWORDS, (unused/1, unused/2, method, callable, args[oparg >> 1], kwnames if (oparg & 1) -- res)) { /* Builtin METH_FASTCALL | METH_KEYWORDS functions */ int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { callable = method; args--; @@ -3017,11 +3018,11 @@ dummy_func( CHECK_EVAL_BREAKER(); } - inst(CALL_NO_KW_LEN, (unused/1, unused/2, method, callable, args[oparg], kwnames -- res)) { - assert(kwnames == NULL); + inst(CALL_NO_KW_LEN, (unused/1, unused/2, method, callable, args[oparg >> 1], unused if (oparg & 1) -- res)) { + assert((oparg & 1) == 0); /* len(o) */ int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { callable = method; args--; @@ -3044,11 +3045,11 @@ dummy_func( ERROR_IF(res == NULL, error); } - inst(CALL_NO_KW_ISINSTANCE, (unused/1, unused/2, method, callable, args[oparg], kwnames -- res)) { - assert(kwnames == NULL); + inst(CALL_NO_KW_ISINSTANCE, (unused/1, unused/2, method, callable, args[oparg >> 1], unused if (oparg & 1) -- res)) { + assert((oparg & 1) == 0); /* isinstance(o, o2) */ int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { callable = method; args--; @@ -3074,9 +3075,9 @@ dummy_func( } // This is secretly a super-instruction - inst(CALL_NO_KW_LIST_APPEND, (unused/1, unused/2, method, self, args[oparg], kwnames -- unused)) { - assert(kwnames == NULL); - assert(oparg == 1); + inst(CALL_NO_KW_LIST_APPEND, (unused/1, unused/2, method, self, args[oparg >> 1], unused if (oparg & 1) -- unused)) { + assert((oparg & 1) == 0); + assert(oparg >> 1 == 1); assert(method != NULL); PyInterpreterState *interp = _PyInterpreterState_GET(); DEOPT_IF(method != interp->callable_cache.list_append, CALL); @@ -3087,23 +3088,23 @@ dummy_func( } Py_DECREF(self); Py_DECREF(method); - STACK_SHRINK(4); + STACK_SHRINK(3); // CALL + POP_TOP SKIP_OVER(INLINE_CACHE_ENTRIES_CALL + 1); assert(next_instr[-1].op.code == POP_TOP); DISPATCH(); } - inst(CALL_NO_KW_METHOD_DESCRIPTOR_O, (unused/1, unused/2, method, unused, args[oparg], kwnames -- res)) { - assert(kwnames == NULL); + inst(CALL_NO_KW_METHOD_DESCRIPTOR_O, (unused/1, unused/2, method, unused, args[oparg >> 1], unused if (oparg & 1) -- res)) { + assert((oparg & 1) == 0); int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { args--; total_args++; } PyMethodDescrObject *callable = - (PyMethodDescrObject *)PEEK(total_args + 2); + (PyMethodDescrObject *)PEEK(total_args + 1); DEOPT_IF(total_args != 2, CALL); DEOPT_IF(!Py_IS_TYPE(callable, &PyMethodDescr_Type), CALL); PyMethodDef *meth = callable->d_method; @@ -3128,15 +3129,15 @@ dummy_func( CHECK_EVAL_BREAKER(); } - inst(CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS, (unused/1, unused/2, method, unused, args[oparg], kwnames -- res)) { + inst(CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS, (unused/1, unused/2, method, unused, args[oparg >> 1], kwnames if (oparg & 1) -- res)) { int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { args--; total_args++; } PyMethodDescrObject *callable = - (PyMethodDescrObject *)PEEK(total_args + 2); + (PyMethodDescrObject *)PEEK(total_args + 1 + (oparg & 1)); DEOPT_IF(!Py_IS_TYPE(callable, &PyMethodDescr_Type), CALL); PyMethodDef *meth = callable->d_method; DEOPT_IF(meth->ml_flags != (METH_FASTCALL|METH_KEYWORDS), CALL); @@ -3160,11 +3161,11 @@ dummy_func( CHECK_EVAL_BREAKER(); } - inst(CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS, (unused/1, unused/2, method, unused, args[oparg], kwnames -- res)) { - assert(kwnames == NULL); - assert(oparg == 0 || oparg == 1); + inst(CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS, (unused/1, unused/2, method, unused, args[oparg >> 1], unused if (oparg & 1) -- res)) { + assert((oparg & 1) == 0); + assert(oparg >> 1 == 0 || oparg >> 1 == 1); int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { args--; total_args++; @@ -3192,16 +3193,16 @@ dummy_func( CHECK_EVAL_BREAKER(); } - inst(CALL_NO_KW_METHOD_DESCRIPTOR_FAST, (unused/1, unused/2, method, unused, args[oparg], kwnames -- res)) { - assert(kwnames == NULL); + inst(CALL_NO_KW_METHOD_DESCRIPTOR_FAST, (unused/1, unused/2, method, unused, args[oparg >> 1], unused if (oparg & 1) -- res)) { + assert((oparg & 1) == 0); int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { args--; total_args++; } PyMethodDescrObject *callable = - (PyMethodDescrObject *)PEEK(total_args + 2); + (PyMethodDescrObject *)PEEK(total_args + 1); /* Builtin METH_FASTCALL methods, without keywords */ DEOPT_IF(!Py_IS_TYPE(callable, &PyMethodDescr_Type), CALL); PyMethodDef *meth = callable->d_method; diff --git a/Python/compile.c b/Python/compile.c index 73353dc9d10aa5..363c17bd860066 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1474,8 +1474,7 @@ compiler_call_exit_with_nones(struct compiler *c, location loc) ADDOP_LOAD_CONST(c, loc, Py_None); ADDOP_LOAD_CONST(c, loc, Py_None); ADDOP_LOAD_CONST(c, loc, Py_None); - ADDOP(c, loc, PUSH_NULL); - ADDOP_I(c, loc, CALL, 2); + ADDOP_I(c, loc, CALL, (2 << 1) | 0); return SUCCESS; } @@ -1869,8 +1868,7 @@ compiler_apply_decorators(struct compiler *c, asdl_expr_seq* decos) for (Py_ssize_t i = asdl_seq_LEN(decos) - 1; i > -1; i--) { location loc = LOC((expr_ty)asdl_seq_GET(decos, i)); - ADDOP(c, loc, PUSH_NULL); - ADDOP_I(c, loc, CALL, 0); + ADDOP_I(c, loc, CALL, (0 << 1) | 0); } return SUCCESS; } @@ -2380,8 +2378,7 @@ compiler_function(struct compiler *c, stmt_ty s, int is_async) if (num_typeparam_args > 0) { ADDOP_I(c, loc, SWAP, num_typeparam_args + 1); } - ADDOP(c, loc, PUSH_NULL); - ADDOP_I(c, loc, CALL, num_typeparam_args); + ADDOP_I(c, loc, CALL, (num_typeparam_args << 1) | 0); } RETURN_IF_ERROR(compiler_apply_decorators(c, decos)); @@ -2610,8 +2607,7 @@ compiler_class(struct compiler *c, stmt_ty s) return ERROR; } Py_DECREF(co); - ADDOP(c, loc, PUSH_NULL); - ADDOP_I(c, loc, CALL, 0); + ADDOP_I(c, loc, CALL, (0 << 1) | 0); } else { RETURN_IF_ERROR(compiler_call_helper(c, loc, 2, s->v.ClassDef.bases, @@ -2701,8 +2697,7 @@ compiler_typealias(struct compiler *c, stmt_ty s) return ERROR; } Py_DECREF(co); - ADDOP(c, loc, PUSH_NULL); - ADDOP_I(c, loc, CALL, 0); + ADDOP_I(c, loc, CALL, (0 << 1) | 0); } RETURN_IF_ERROR(compiler_nameop(c, loc, name, Store)); return SUCCESS; @@ -3896,8 +3891,7 @@ compiler_assert(struct compiler *c, stmt_ty s) ADDOP(c, LOC(s), LOAD_ASSERTION_ERROR); if (s->v.Assert.msg) { VISIT(c, expr, s->v.Assert.msg); - ADDOP(c, LOC(s), PUSH_NULL); - ADDOP_I(c, LOC(s), CALL, 0); + ADDOP_I(c, LOC(s), CALL, (0 << 1) | 0); } ADDOP_I(c, LOC(s), RAISE_VARARGS, 1); @@ -4895,11 +4889,8 @@ maybe_optimize_method_call(struct compiler *c, expr_ty e) RETURN_IF_ERROR( compiler_call_simple_kw_helper(c, loc, kwds, kwdsl)); } - else { - ADDOP(c, loc, PUSH_NULL); - } loc = update_start_location_to_match_attr(c, LOC(e), meth); - ADDOP_I(c, loc, CALL, argsl + kwdsl); + ADDOP_I(c, loc, CALL, ((argsl + kwdsl) << 1) | !!kwdsl); return 1; } @@ -4962,8 +4953,7 @@ compiler_joined_str(struct compiler *c, expr_ty e) VISIT(c, expr, asdl_seq_GET(e->v.JoinedStr.values, i)); ADDOP_I(c, loc, LIST_APPEND, 1); } - ADDOP(c, loc, PUSH_NULL); - ADDOP_I(c, loc, CALL, 1); + ADDOP_I(c, loc, CALL, (1 << 1) | 0); } else { VISIT_SEQ(c, expr, e->v.JoinedStr.values); @@ -5127,10 +5117,7 @@ compiler_call_helper(struct compiler *c, location loc, RETURN_IF_ERROR( compiler_call_simple_kw_helper(c, loc, keywords, nkwelts)); } - else { - ADDOP(c, loc, PUSH_NULL); - } - ADDOP_I(c, loc, CALL, n + nelts + nkwelts); + ADDOP_I(c, loc, CALL, ((n + nelts + nkwelts) << 1) | !!nkwelts); return SUCCESS; ex_call: @@ -5730,8 +5717,7 @@ compiler_comprehension(struct compiler *c, expr_ty e, int type, goto error; } - ADDOP(c, loc, PUSH_NULL); - ADDOP_I(c, loc, CALL, 0); + ADDOP_I(c, loc, CALL, (0 << 1) | 0); if (is_async_generator && type != COMP_GENEXP) { ADDOP_I(c, loc, GET_AWAITABLE, 0); diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 9052499ddf30bd..7da14988101e15 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -3733,11 +3733,11 @@ TARGET(INSTRUMENTED_CALL) { #line 2645 "Python/bytecodes.c" - int is_meth = PEEK(oparg + 3) != NULL; - int total_args = oparg + is_meth; - PyObject *function = PEEK(total_args + 2); + int is_meth = PEEK((oparg >> 1) + 2 + (oparg & 1)) != NULL; + int total_args = (oparg >> 1) + is_meth; + PyObject *function = PEEK(total_args + 1 + (oparg & 1)); PyObject *arg = total_args == 0 ? - &_PyInstrumentation_MISSING : PEEK(total_args + 1); + &_PyInstrumentation_MISSING : PEEK(total_args + (oparg & 1)); int err = _Py_call_instrumentation_2args( tstate, PY_MONITORING_EVENT_CALL, frame, next_instr-1, function, arg); @@ -3751,14 +3751,14 @@ TARGET(CALL) { PREDICTED(CALL); static_assert(INLINE_CACHE_ENTRIES_CALL == 3, "incorrect cache size"); - PyObject *kwnames = stack_pointer[-1]; - PyObject **args = (stack_pointer - (1 + oparg)); - PyObject *callable = stack_pointer[-(2 + oparg)]; - PyObject *method = stack_pointer[-(3 + oparg)]; + PyObject *kwnames = (oparg & 1) ? stack_pointer[-(((oparg & 1) ? 1 : 0))] : NULL; + PyObject **args = (stack_pointer - (((oparg & 1) ? 1 : 0) + (oparg >> 1))); + PyObject *callable = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; + PyObject *method = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; PyObject *res; #line 2689 "Python/bytecodes.c" int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { callable = method; args--; @@ -3775,7 +3775,7 @@ DECREMENT_ADAPTIVE_COUNTER(cache->counter); #endif /* ENABLE_SPECIALIZATION */ if (!is_meth && Py_TYPE(callable) == &PyMethod_Type) { - is_meth = 1; // For consistenct; it's dead, though + is_meth = 1; // For consistency; it's dead, though args--; total_args++; PyObject *self = ((PyMethodObject *)callable)->im_self; @@ -3799,7 +3799,7 @@ ); Py_XDECREF(kwnames); // Manipulate stack directly since we leave using DISPATCH_INLINED(). - STACK_SHRINK(oparg + 3); + STACK_SHRINK((oparg >> 1) + 2 + (oparg & 1)); // The frame has stolen all the arguments from the stack, // so there is no need to clean them up. if (new_frame == NULL) { @@ -3816,7 +3816,7 @@ kwnames); if (opcode == INSTRUMENTED_CALL) { PyObject *arg = total_args == 0 ? - &_PyInstrumentation_MISSING : PEEK(total_args + 1); + &_PyInstrumentation_MISSING : PEEK(total_args + (oparg & 1)); if (res == NULL) { _Py_call_instrumentation_exc2( tstate, PY_MONITORING_EVENT_C_RAISE, @@ -3837,10 +3837,10 @@ for (int i = 0; i < total_args; i++) { Py_DECREF(args[i]); } - if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } + if (res == NULL) { STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); goto pop_2_error; } #line 3842 "Python/generated_cases.c.h" - STACK_SHRINK(oparg); - STACK_SHRINK(2); + STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); + STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -3848,33 +3848,33 @@ } TARGET(CALL_BOUND_METHOD_EXACT_ARGS) { - PyObject *callable = stack_pointer[-(2 + oparg)]; - PyObject *method = stack_pointer[-(3 + oparg)]; + PyObject *callable = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; + PyObject *method = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; #line 2777 "Python/bytecodes.c" + assert((oparg & 1) == 0); DEOPT_IF(method != NULL, CALL); DEOPT_IF(Py_TYPE(callable) != &PyMethod_Type, CALL); STAT_INC(CALL, hit); PyObject *self = ((PyMethodObject *)callable)->im_self; - PEEK(oparg + 2) = Py_NewRef(self); // callable + PEEK((oparg >> 1) + 1) = Py_NewRef(self); // callable PyObject *meth = ((PyMethodObject *)callable)->im_func; - PEEK(oparg + 3) = Py_NewRef(meth); // method + PEEK((oparg >> 1) + 2) = Py_NewRef(meth); // method Py_DECREF(callable); GO_TO_INSTRUCTION(CALL_PY_EXACT_ARGS); - #line 3864 "Python/generated_cases.c.h" + #line 3865 "Python/generated_cases.c.h" } TARGET(CALL_PY_EXACT_ARGS) { PREDICTED(CALL_PY_EXACT_ARGS); - PyObject *kwnames = stack_pointer[-1]; - PyObject **args = (stack_pointer - (1 + oparg)); - PyObject *callable = stack_pointer[-(2 + oparg)]; - PyObject *method = stack_pointer[-(3 + oparg)]; + PyObject **args = (stack_pointer - (((oparg & 1) ? 1 : 0) + (oparg >> 1))); + PyObject *callable = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; + PyObject *method = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; uint32_t func_version = read_u32(&next_instr[1].cache); - #line 2789 "Python/bytecodes.c" - assert(kwnames == NULL); + #line 2790 "Python/bytecodes.c" + assert((oparg & 1) == 0); DEOPT_IF(tstate->interp->eval_frame, CALL); int is_meth = method != NULL; - int argcount = oparg; + int argcount = oparg >> 1; if (is_meth) { callable = method; args--; @@ -3892,7 +3892,7 @@ new_frame->localsplus[i] = args[i]; } // Manipulate stack directly since we leave using DISPATCH_INLINED(). - STACK_SHRINK(oparg + 3); + STACK_SHRINK((oparg >> 1) + 2); SKIP_OVER(INLINE_CACHE_ENTRIES_CALL); frame->return_offset = 0; DISPATCH_INLINED(new_frame); @@ -3900,16 +3900,15 @@ } TARGET(CALL_PY_WITH_DEFAULTS) { - PyObject *kwnames = stack_pointer[-1]; - PyObject **args = (stack_pointer - (1 + oparg)); - PyObject *callable = stack_pointer[-(2 + oparg)]; - PyObject *method = stack_pointer[-(3 + oparg)]; + PyObject **args = (stack_pointer - (((oparg & 1) ? 1 : 0) + (oparg >> 1))); + PyObject *callable = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; + PyObject *method = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; uint32_t func_version = read_u32(&next_instr[1].cache); - #line 2817 "Python/bytecodes.c" - assert(kwnames == NULL); + #line 2818 "Python/bytecodes.c" + assert((oparg & 1) == 0); DEOPT_IF(tstate->interp->eval_frame, CALL); int is_meth = method != NULL; - int argcount = oparg; + int argcount = oparg >> 1; if (is_meth) { callable = method; args--; @@ -3937,22 +3936,21 @@ new_frame->localsplus[i] = Py_NewRef(def); } // Manipulate stack and cache directly since we leave using DISPATCH_INLINED(). - STACK_SHRINK(oparg + 3); + STACK_SHRINK((oparg >> 1) + 2); SKIP_OVER(INLINE_CACHE_ENTRIES_CALL); frame->return_offset = 0; DISPATCH_INLINED(new_frame); - #line 3945 "Python/generated_cases.c.h" + #line 3944 "Python/generated_cases.c.h" } TARGET(CALL_NO_KW_TYPE_1) { - PyObject *kwnames = stack_pointer[-1]; - PyObject **args = (stack_pointer - (1 + oparg)); - PyObject *callable = stack_pointer[-(2 + oparg)]; - PyObject *null = stack_pointer[-(3 + oparg)]; + PyObject **args = (stack_pointer - (((oparg & 1) ? 1 : 0) + (oparg >> 1))); + PyObject *callable = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; + PyObject *null = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; PyObject *res; - #line 2855 "Python/bytecodes.c" - assert(kwnames == NULL); - assert(oparg == 1); + #line 2856 "Python/bytecodes.c" + assert((oparg & 1) == 0); + assert(oparg >> 1 == 1); DEOPT_IF(null != NULL, CALL); PyObject *obj = args[0]; DEOPT_IF(callable != (PyObject *)&PyType_Type, CALL); @@ -3960,23 +3958,22 @@ res = Py_NewRef(Py_TYPE(obj)); Py_DECREF(obj); Py_DECREF(&PyType_Type); // I.e., callable - #line 3964 "Python/generated_cases.c.h" - STACK_SHRINK(oparg); - STACK_SHRINK(2); + #line 3962 "Python/generated_cases.c.h" + STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); + STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 3; DISPATCH(); } TARGET(CALL_NO_KW_STR_1) { - PyObject *kwnames = stack_pointer[-1]; - PyObject **args = (stack_pointer - (1 + oparg)); - PyObject *callable = stack_pointer[-(2 + oparg)]; - PyObject *null = stack_pointer[-(3 + oparg)]; + PyObject **args = (stack_pointer - (((oparg & 1) ? 1 : 0) + (oparg >> 1))); + PyObject *callable = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; + PyObject *null = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; PyObject *res; - #line 2867 "Python/bytecodes.c" - assert(kwnames == NULL); - assert(oparg == 1); + #line 2868 "Python/bytecodes.c" + assert((oparg & 1) == 0); + assert(oparg >> 1 == 1); DEOPT_IF(null != NULL, CALL); DEOPT_IF(callable != (PyObject *)&PyUnicode_Type, CALL); STAT_INC(CALL, hit); @@ -3984,10 +3981,10 @@ res = PyObject_Str(arg); Py_DECREF(arg); Py_DECREF(&PyUnicode_Type); // I.e., callable - if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } - #line 3989 "Python/generated_cases.c.h" - STACK_SHRINK(oparg); - STACK_SHRINK(2); + if (res == NULL) { STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); goto pop_2_error; } + #line 3986 "Python/generated_cases.c.h" + STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); + STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -3995,14 +3992,13 @@ } TARGET(CALL_NO_KW_TUPLE_1) { - PyObject *kwnames = stack_pointer[-1]; - PyObject **args = (stack_pointer - (1 + oparg)); - PyObject *callable = stack_pointer[-(2 + oparg)]; - PyObject *null = stack_pointer[-(3 + oparg)]; + PyObject **args = (stack_pointer - (((oparg & 1) ? 1 : 0) + (oparg >> 1))); + PyObject *callable = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; + PyObject *null = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; PyObject *res; - #line 2881 "Python/bytecodes.c" - assert(kwnames == NULL); - assert(oparg == 1); + #line 2882 "Python/bytecodes.c" + assert((oparg & 1) == 0); + assert(oparg >> 1 == 1); DEOPT_IF(null != NULL, CALL); DEOPT_IF(callable != (PyObject *)&PyTuple_Type, CALL); STAT_INC(CALL, hit); @@ -4010,10 +4006,10 @@ res = PySequence_Tuple(arg); Py_DECREF(arg); Py_DECREF(&PyTuple_Type); // I.e., tuple - if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } - #line 4015 "Python/generated_cases.c.h" - STACK_SHRINK(oparg); - STACK_SHRINK(2); + if (res == NULL) { STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); goto pop_2_error; } + #line 4011 "Python/generated_cases.c.h" + STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); + STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -4021,14 +4017,14 @@ } TARGET(CALL_BUILTIN_CLASS) { - PyObject *kwnames = stack_pointer[-1]; - PyObject **args = (stack_pointer - (1 + oparg)); - PyObject *callable = stack_pointer[-(2 + oparg)]; - PyObject *method = stack_pointer[-(3 + oparg)]; + PyObject *kwnames = (oparg & 1) ? stack_pointer[-(((oparg & 1) ? 1 : 0))] : NULL; + PyObject **args = (stack_pointer - (((oparg & 1) ? 1 : 0) + (oparg >> 1))); + PyObject *callable = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; + PyObject *method = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; PyObject *res; - #line 2895 "Python/bytecodes.c" + #line 2896 "Python/bytecodes.c" int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { callable = method; args--; @@ -4047,10 +4043,10 @@ Py_DECREF(args[i]); } Py_DECREF(tp); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } - #line 4052 "Python/generated_cases.c.h" - STACK_SHRINK(oparg); - STACK_SHRINK(2); + if (res == NULL) { STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); goto pop_2_error; } + #line 4048 "Python/generated_cases.c.h" + STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); + STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -4058,16 +4054,15 @@ } TARGET(CALL_NO_KW_BUILTIN_O) { - PyObject *kwnames = stack_pointer[-1]; - PyObject **args = (stack_pointer - (1 + oparg)); - PyObject *callable = stack_pointer[-(2 + oparg)]; - PyObject *method = stack_pointer[-(3 + oparg)]; + PyObject **args = (stack_pointer - (((oparg & 1) ? 1 : 0) + (oparg >> 1))); + PyObject *callable = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; + PyObject *method = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; PyObject *res; - #line 2920 "Python/bytecodes.c" + #line 2921 "Python/bytecodes.c" /* Builtin METH_O functions */ - assert(kwnames == NULL); + assert((oparg & 1) == 0); int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { callable = method; args--; @@ -4090,10 +4085,10 @@ Py_DECREF(arg); Py_DECREF(callable); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } - #line 4095 "Python/generated_cases.c.h" - STACK_SHRINK(oparg); - STACK_SHRINK(2); + if (res == NULL) { STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); goto pop_2_error; } + #line 4090 "Python/generated_cases.c.h" + STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); + STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -4101,16 +4096,15 @@ } TARGET(CALL_NO_KW_BUILTIN_FAST) { - PyObject *kwnames = stack_pointer[-1]; - PyObject **args = (stack_pointer - (1 + oparg)); - PyObject *callable = stack_pointer[-(2 + oparg)]; - PyObject *method = stack_pointer[-(3 + oparg)]; + PyObject **args = (stack_pointer - (((oparg & 1) ? 1 : 0) + (oparg >> 1))); + PyObject *callable = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; + PyObject *method = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; PyObject *res; - #line 2951 "Python/bytecodes.c" + #line 2952 "Python/bytecodes.c" /* Builtin METH_FASTCALL functions, without keywords */ - assert(kwnames == NULL); + assert((oparg & 1) == 0); int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { callable = method; args--; @@ -4132,15 +4126,15 @@ Py_DECREF(args[i]); } Py_DECREF(callable); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } + if (res == NULL) { STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); goto pop_2_error; } /* Not deopting because this doesn't mean our optimization was wrong. `res` can be NULL for valid reasons. Eg. getattr(x, 'invalid'). In those cases an exception is set, so we must handle it. */ - #line 4142 "Python/generated_cases.c.h" - STACK_SHRINK(oparg); - STACK_SHRINK(2); + #line 4136 "Python/generated_cases.c.h" + STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); + STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -4148,15 +4142,15 @@ } TARGET(CALL_BUILTIN_FAST_WITH_KEYWORDS) { - PyObject *kwnames = stack_pointer[-1]; - PyObject **args = (stack_pointer - (1 + oparg)); - PyObject *callable = stack_pointer[-(2 + oparg)]; - PyObject *method = stack_pointer[-(3 + oparg)]; + PyObject *kwnames = (oparg & 1) ? stack_pointer[-(((oparg & 1) ? 1 : 0))] : NULL; + PyObject **args = (stack_pointer - (((oparg & 1) ? 1 : 0) + (oparg >> 1))); + PyObject *callable = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; + PyObject *method = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; PyObject *res; - #line 2986 "Python/bytecodes.c" + #line 2987 "Python/bytecodes.c" /* Builtin METH_FASTCALL | METH_KEYWORDS functions */ int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { callable = method; args--; @@ -4184,10 +4178,10 @@ Py_DECREF(args[i]); } Py_DECREF(callable); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } - #line 4189 "Python/generated_cases.c.h" - STACK_SHRINK(oparg); - STACK_SHRINK(2); + if (res == NULL) { STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); goto pop_2_error; } + #line 4183 "Python/generated_cases.c.h" + STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); + STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -4195,16 +4189,15 @@ } TARGET(CALL_NO_KW_LEN) { - PyObject *kwnames = stack_pointer[-1]; - PyObject **args = (stack_pointer - (1 + oparg)); - PyObject *callable = stack_pointer[-(2 + oparg)]; - PyObject *method = stack_pointer[-(3 + oparg)]; + PyObject **args = (stack_pointer - (((oparg & 1) ? 1 : 0) + (oparg >> 1))); + PyObject *callable = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; + PyObject *method = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; PyObject *res; - #line 3021 "Python/bytecodes.c" - assert(kwnames == NULL); + #line 3022 "Python/bytecodes.c" + assert((oparg & 1) == 0); /* len(o) */ int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { callable = method; args--; @@ -4224,26 +4217,25 @@ Py_DECREF(callable); Py_DECREF(arg); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } - #line 4229 "Python/generated_cases.c.h" - STACK_SHRINK(oparg); - STACK_SHRINK(2); + if (res == NULL) { STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); goto pop_2_error; } + #line 4222 "Python/generated_cases.c.h" + STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); + STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 3; DISPATCH(); } TARGET(CALL_NO_KW_ISINSTANCE) { - PyObject *kwnames = stack_pointer[-1]; - PyObject **args = (stack_pointer - (1 + oparg)); - PyObject *callable = stack_pointer[-(2 + oparg)]; - PyObject *method = stack_pointer[-(3 + oparg)]; + PyObject **args = (stack_pointer - (((oparg & 1) ? 1 : 0) + (oparg >> 1))); + PyObject *callable = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; + PyObject *method = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; PyObject *res; - #line 3048 "Python/bytecodes.c" - assert(kwnames == NULL); + #line 3049 "Python/bytecodes.c" + assert((oparg & 1) == 0); /* isinstance(o, o2) */ int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { callable = method; args--; @@ -4265,23 +4257,22 @@ Py_DECREF(inst); Py_DECREF(cls); Py_DECREF(callable); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } - #line 4270 "Python/generated_cases.c.h" - STACK_SHRINK(oparg); - STACK_SHRINK(2); + if (res == NULL) { STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); goto pop_2_error; } + #line 4262 "Python/generated_cases.c.h" + STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); + STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 3; DISPATCH(); } TARGET(CALL_NO_KW_LIST_APPEND) { - PyObject *kwnames = stack_pointer[-1]; - PyObject **args = (stack_pointer - (1 + oparg)); - PyObject *self = stack_pointer[-(2 + oparg)]; - PyObject *method = stack_pointer[-(3 + oparg)]; - #line 3078 "Python/bytecodes.c" - assert(kwnames == NULL); - assert(oparg == 1); + PyObject **args = (stack_pointer - (((oparg & 1) ? 1 : 0) + (oparg >> 1))); + PyObject *self = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; + PyObject *method = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; + #line 3079 "Python/bytecodes.c" + assert((oparg & 1) == 0); + assert(oparg >> 1 == 1); assert(method != NULL); PyInterpreterState *interp = _PyInterpreterState_GET(); DEOPT_IF(method != interp->callable_cache.list_append, CALL); @@ -4292,29 +4283,28 @@ } Py_DECREF(self); Py_DECREF(method); - STACK_SHRINK(4); + STACK_SHRINK(3); // CALL + POP_TOP SKIP_OVER(INLINE_CACHE_ENTRIES_CALL + 1); assert(next_instr[-1].op.code == POP_TOP); DISPATCH(); - #line 4301 "Python/generated_cases.c.h" + #line 4292 "Python/generated_cases.c.h" } TARGET(CALL_NO_KW_METHOD_DESCRIPTOR_O) { - PyObject *kwnames = stack_pointer[-1]; - PyObject **args = (stack_pointer - (1 + oparg)); - PyObject *method = stack_pointer[-(3 + oparg)]; + PyObject **args = (stack_pointer - (((oparg & 1) ? 1 : 0) + (oparg >> 1))); + PyObject *method = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; PyObject *res; - #line 3098 "Python/bytecodes.c" - assert(kwnames == NULL); + #line 3099 "Python/bytecodes.c" + assert((oparg & 1) == 0); int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { args--; total_args++; } PyMethodDescrObject *callable = - (PyMethodDescrObject *)PEEK(total_args + 2); + (PyMethodDescrObject *)PEEK(total_args + 1); DEOPT_IF(total_args != 2, CALL); DEOPT_IF(!Py_IS_TYPE(callable, &PyMethodDescr_Type), CALL); PyMethodDef *meth = callable->d_method; @@ -4335,10 +4325,10 @@ Py_DECREF(self); Py_DECREF(arg); Py_DECREF(callable); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } - #line 4340 "Python/generated_cases.c.h" - STACK_SHRINK(oparg); - STACK_SHRINK(2); + if (res == NULL) { STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); goto pop_2_error; } + #line 4330 "Python/generated_cases.c.h" + STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); + STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -4346,19 +4336,19 @@ } TARGET(CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS) { - PyObject *kwnames = stack_pointer[-1]; - PyObject **args = (stack_pointer - (1 + oparg)); - PyObject *method = stack_pointer[-(3 + oparg)]; + PyObject *kwnames = (oparg & 1) ? stack_pointer[-(((oparg & 1) ? 1 : 0))] : NULL; + PyObject **args = (stack_pointer - (((oparg & 1) ? 1 : 0) + (oparg >> 1))); + PyObject *method = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; PyObject *res; - #line 3132 "Python/bytecodes.c" + #line 3133 "Python/bytecodes.c" int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { args--; total_args++; } PyMethodDescrObject *callable = - (PyMethodDescrObject *)PEEK(total_args + 2); + (PyMethodDescrObject *)PEEK(total_args + 1 + (oparg & 1)); DEOPT_IF(!Py_IS_TYPE(callable, &PyMethodDescr_Type), CALL); PyMethodDef *meth = callable->d_method; DEOPT_IF(meth->ml_flags != (METH_FASTCALL|METH_KEYWORDS), CALL); @@ -4378,10 +4368,10 @@ Py_DECREF(args[i]); } Py_DECREF(callable); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } - #line 4383 "Python/generated_cases.c.h" - STACK_SHRINK(oparg); - STACK_SHRINK(2); + if (res == NULL) { STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); goto pop_2_error; } + #line 4373 "Python/generated_cases.c.h" + STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); + STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -4389,15 +4379,14 @@ } TARGET(CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS) { - PyObject *kwnames = stack_pointer[-1]; - PyObject **args = (stack_pointer - (1 + oparg)); - PyObject *method = stack_pointer[-(3 + oparg)]; + PyObject **args = (stack_pointer - (((oparg & 1) ? 1 : 0) + (oparg >> 1))); + PyObject *method = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; PyObject *res; - #line 3164 "Python/bytecodes.c" - assert(kwnames == NULL); - assert(oparg == 0 || oparg == 1); + #line 3165 "Python/bytecodes.c" + assert((oparg & 1) == 0); + assert(oparg >> 1 == 0 || oparg >> 1 == 1); int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { args--; total_args++; @@ -4421,10 +4410,10 @@ assert((res != NULL) ^ (_PyErr_Occurred(tstate) != NULL)); Py_DECREF(self); Py_DECREF(callable); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } - #line 4426 "Python/generated_cases.c.h" - STACK_SHRINK(oparg); - STACK_SHRINK(2); + if (res == NULL) { STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); goto pop_2_error; } + #line 4415 "Python/generated_cases.c.h" + STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); + STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -4432,20 +4421,19 @@ } TARGET(CALL_NO_KW_METHOD_DESCRIPTOR_FAST) { - PyObject *kwnames = stack_pointer[-1]; - PyObject **args = (stack_pointer - (1 + oparg)); - PyObject *method = stack_pointer[-(3 + oparg)]; + PyObject **args = (stack_pointer - (((oparg & 1) ? 1 : 0) + (oparg >> 1))); + PyObject *method = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0) + (oparg >> 1))]; PyObject *res; - #line 3196 "Python/bytecodes.c" - assert(kwnames == NULL); + #line 3197 "Python/bytecodes.c" + assert((oparg & 1) == 0); int is_meth = method != NULL; - int total_args = oparg; + int total_args = oparg >> 1; if (is_meth) { args--; total_args++; } PyMethodDescrObject *callable = - (PyMethodDescrObject *)PEEK(total_args + 2); + (PyMethodDescrObject *)PEEK(total_args + 1); /* Builtin METH_FASTCALL methods, without keywords */ DEOPT_IF(!Py_IS_TYPE(callable, &PyMethodDescr_Type), CALL); PyMethodDef *meth = callable->d_method; @@ -4463,10 +4451,10 @@ Py_DECREF(args[i]); } Py_DECREF(callable); - if (res == NULL) { STACK_SHRINK(oparg); goto pop_3_error; } - #line 4468 "Python/generated_cases.c.h" - STACK_SHRINK(oparg); - STACK_SHRINK(2); + if (res == NULL) { STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); goto pop_2_error; } + #line 4456 "Python/generated_cases.c.h" + STACK_SHRINK((oparg >> 1) + ((oparg & 1) ? 1 : 0)); + STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 3; CHECK_EVAL_BREAKER(); @@ -4474,9 +4462,9 @@ } TARGET(INSTRUMENTED_CALL_FUNCTION_EX) { - #line 3227 "Python/bytecodes.c" + #line 3228 "Python/bytecodes.c" GO_TO_INSTRUCTION(CALL_FUNCTION_EX); - #line 4480 "Python/generated_cases.c.h" + #line 4468 "Python/generated_cases.c.h" } TARGET(CALL_FUNCTION_EX) { @@ -4485,7 +4473,7 @@ PyObject *callargs = stack_pointer[-(1 + ((oparg & 1) ? 1 : 0))]; PyObject *func = stack_pointer[-(2 + ((oparg & 1) ? 1 : 0))]; PyObject *result; - #line 3231 "Python/bytecodes.c" + #line 3232 "Python/bytecodes.c" // DICT_MERGE is called before this opcode if there are kwargs. // It converts all dict subtypes in kwargs into regular dicts. assert(kwargs == NULL || PyDict_CheckExact(kwargs)); @@ -4547,14 +4535,14 @@ } result = PyObject_Call(func, callargs, kwargs); } - #line 4551 "Python/generated_cases.c.h" + #line 4539 "Python/generated_cases.c.h" Py_DECREF(func); Py_DECREF(callargs); Py_XDECREF(kwargs); - #line 3293 "Python/bytecodes.c" + #line 3294 "Python/bytecodes.c" assert(PEEK(3 + (oparg & 1)) == NULL); if (result == NULL) { STACK_SHRINK(((oparg & 1) ? 1 : 0)); goto pop_3_error; } - #line 4558 "Python/generated_cases.c.h" + #line 4546 "Python/generated_cases.c.h" STACK_SHRINK(((oparg & 1) ? 1 : 0)); STACK_SHRINK(2); stack_pointer[-1] = result; @@ -4565,7 +4553,7 @@ TARGET(MAKE_FUNCTION) { PyObject *codeobj = stack_pointer[-1]; PyObject *func; - #line 3299 "Python/bytecodes.c" + #line 3300 "Python/bytecodes.c" PyFunctionObject *func_obj = (PyFunctionObject *) PyFunction_New(codeobj, GLOBALS()); @@ -4577,7 +4565,7 @@ func_obj->func_version = ((PyCodeObject *)codeobj)->co_version; func = (PyObject *)func_obj; - #line 4581 "Python/generated_cases.c.h" + #line 4569 "Python/generated_cases.c.h" stack_pointer[-1] = func; DISPATCH(); } @@ -4585,7 +4573,7 @@ TARGET(SET_FUNCTION_ATTRIBUTE) { PyObject *func = stack_pointer[-1]; PyObject *attr = stack_pointer[-2]; - #line 3313 "Python/bytecodes.c" + #line 3314 "Python/bytecodes.c" assert(PyFunction_Check(func)); PyFunctionObject *func_obj = (PyFunctionObject *)func; switch(oparg) { @@ -4610,14 +4598,14 @@ default: Py_UNREACHABLE(); } - #line 4614 "Python/generated_cases.c.h" + #line 4602 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = func; DISPATCH(); } TARGET(RETURN_GENERATOR) { - #line 3340 "Python/bytecodes.c" + #line 3341 "Python/bytecodes.c" assert(PyFunction_Check(frame->f_funcobj)); PyFunctionObject *func = (PyFunctionObject *)frame->f_funcobj; PyGenObject *gen = (PyGenObject *)_Py_MakeCoro(func); @@ -4638,7 +4626,7 @@ frame = cframe.current_frame = prev; _PyFrame_StackPush(frame, (PyObject *)gen); goto resume_frame; - #line 4642 "Python/generated_cases.c.h" + #line 4630 "Python/generated_cases.c.h" } TARGET(BUILD_SLICE) { @@ -4646,15 +4634,15 @@ PyObject *stop = stack_pointer[-(1 + ((oparg == 3) ? 1 : 0))]; PyObject *start = stack_pointer[-(2 + ((oparg == 3) ? 1 : 0))]; PyObject *slice; - #line 3363 "Python/bytecodes.c" + #line 3364 "Python/bytecodes.c" slice = PySlice_New(start, stop, step); - #line 4652 "Python/generated_cases.c.h" + #line 4640 "Python/generated_cases.c.h" Py_DECREF(start); Py_DECREF(stop); Py_XDECREF(step); - #line 3365 "Python/bytecodes.c" + #line 3366 "Python/bytecodes.c" if (slice == NULL) { STACK_SHRINK(((oparg == 3) ? 1 : 0)); goto pop_2_error; } - #line 4658 "Python/generated_cases.c.h" + #line 4646 "Python/generated_cases.c.h" STACK_SHRINK(((oparg == 3) ? 1 : 0)); STACK_SHRINK(1); stack_pointer[-1] = slice; @@ -4664,14 +4652,14 @@ TARGET(CONVERT_VALUE) { PyObject *value = stack_pointer[-1]; PyObject *result; - #line 3369 "Python/bytecodes.c" + #line 3370 "Python/bytecodes.c" convertion_func_ptr conv_fn; assert(oparg >= FVC_STR && oparg <= FVC_ASCII); conv_fn = CONVERSION_FUNCTIONS[oparg]; result = conv_fn(value); Py_DECREF(value); if (result == NULL) goto pop_1_error; - #line 4675 "Python/generated_cases.c.h" + #line 4663 "Python/generated_cases.c.h" stack_pointer[-1] = result; DISPATCH(); } @@ -4679,7 +4667,7 @@ TARGET(FORMAT_SIMPLE) { PyObject *value = stack_pointer[-1]; PyObject *res; - #line 3378 "Python/bytecodes.c" + #line 3379 "Python/bytecodes.c" /* If value is a unicode object, then we know the result * of format(value) is value itself. */ if (!PyUnicode_CheckExact(value)) { @@ -4690,7 +4678,7 @@ else { res = value; } - #line 4694 "Python/generated_cases.c.h" + #line 4682 "Python/generated_cases.c.h" stack_pointer[-1] = res; DISPATCH(); } @@ -4699,12 +4687,12 @@ PyObject *fmt_spec = stack_pointer[-1]; PyObject *value = stack_pointer[-2]; PyObject *res; - #line 3391 "Python/bytecodes.c" + #line 3392 "Python/bytecodes.c" res = PyObject_Format(value, fmt_spec); Py_DECREF(value); Py_DECREF(fmt_spec); if (res == NULL) goto pop_2_error; - #line 4708 "Python/generated_cases.c.h" + #line 4696 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; DISPATCH(); @@ -4713,10 +4701,10 @@ TARGET(COPY) { PyObject *bottom = stack_pointer[-(1 + (oparg-1))]; PyObject *top; - #line 3398 "Python/bytecodes.c" + #line 3399 "Python/bytecodes.c" assert(oparg > 0); top = Py_NewRef(bottom); - #line 4720 "Python/generated_cases.c.h" + #line 4708 "Python/generated_cases.c.h" STACK_GROW(1); stack_pointer[-1] = top; DISPATCH(); @@ -4728,7 +4716,7 @@ PyObject *rhs = stack_pointer[-1]; PyObject *lhs = stack_pointer[-2]; PyObject *res; - #line 3403 "Python/bytecodes.c" + #line 3404 "Python/bytecodes.c" #if ENABLE_SPECIALIZATION _PyBinaryOpCache *cache = (_PyBinaryOpCache *)next_instr; if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) { @@ -4743,12 +4731,12 @@ assert((unsigned)oparg < Py_ARRAY_LENGTH(binary_ops)); assert(binary_ops[oparg]); res = binary_ops[oparg](lhs, rhs); - #line 4747 "Python/generated_cases.c.h" + #line 4735 "Python/generated_cases.c.h" Py_DECREF(lhs); Py_DECREF(rhs); - #line 3418 "Python/bytecodes.c" + #line 3419 "Python/bytecodes.c" if (res == NULL) goto pop_2_error; - #line 4752 "Python/generated_cases.c.h" + #line 4740 "Python/generated_cases.c.h" STACK_SHRINK(1); stack_pointer[-1] = res; next_instr += 1; @@ -4758,16 +4746,16 @@ TARGET(SWAP) { PyObject *top = stack_pointer[-1]; PyObject *bottom = stack_pointer[-(2 + (oparg-2))]; - #line 3423 "Python/bytecodes.c" + #line 3424 "Python/bytecodes.c" assert(oparg >= 2); - #line 4764 "Python/generated_cases.c.h" + #line 4752 "Python/generated_cases.c.h" stack_pointer[-1] = bottom; stack_pointer[-(2 + (oparg-2))] = top; DISPATCH(); } TARGET(INSTRUMENTED_INSTRUCTION) { - #line 3427 "Python/bytecodes.c" + #line 3428 "Python/bytecodes.c" int next_opcode = _Py_call_instrumentation_instruction( tstate, frame, next_instr-1); if (next_opcode < 0) goto error; @@ -4779,26 +4767,26 @@ assert(next_opcode > 0 && next_opcode < 256); opcode = next_opcode; DISPATCH_GOTO(); - #line 4783 "Python/generated_cases.c.h" + #line 4771 "Python/generated_cases.c.h" } TARGET(INSTRUMENTED_JUMP_FORWARD) { - #line 3441 "Python/bytecodes.c" + #line 3442 "Python/bytecodes.c" INSTRUMENTED_JUMP(next_instr-1, next_instr+oparg, PY_MONITORING_EVENT_JUMP); - #line 4789 "Python/generated_cases.c.h" + #line 4777 "Python/generated_cases.c.h" DISPATCH(); } TARGET(INSTRUMENTED_JUMP_BACKWARD) { - #line 3445 "Python/bytecodes.c" + #line 3446 "Python/bytecodes.c" INSTRUMENTED_JUMP(next_instr-1, next_instr+1-oparg, PY_MONITORING_EVENT_JUMP); - #line 4796 "Python/generated_cases.c.h" + #line 4784 "Python/generated_cases.c.h" CHECK_EVAL_BREAKER(); DISPATCH(); } TARGET(INSTRUMENTED_POP_JUMP_IF_TRUE) { - #line 3450 "Python/bytecodes.c" + #line 3451 "Python/bytecodes.c" PyObject *cond = POP(); int err = PyObject_IsTrue(cond); Py_DECREF(cond); @@ -4807,12 +4795,12 @@ assert(err == 0 || err == 1); int offset = err*oparg; INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH); - #line 4811 "Python/generated_cases.c.h" + #line 4799 "Python/generated_cases.c.h" DISPATCH(); } TARGET(INSTRUMENTED_POP_JUMP_IF_FALSE) { - #line 3461 "Python/bytecodes.c" + #line 3462 "Python/bytecodes.c" PyObject *cond = POP(); int err = PyObject_IsTrue(cond); Py_DECREF(cond); @@ -4821,12 +4809,12 @@ assert(err == 0 || err == 1); int offset = (1-err)*oparg; INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH); - #line 4825 "Python/generated_cases.c.h" + #line 4813 "Python/generated_cases.c.h" DISPATCH(); } TARGET(INSTRUMENTED_POP_JUMP_IF_NONE) { - #line 3472 "Python/bytecodes.c" + #line 3473 "Python/bytecodes.c" PyObject *value = POP(); _Py_CODEUNIT *here = next_instr-1; int offset; @@ -4838,12 +4826,12 @@ offset = 0; } INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH); - #line 4842 "Python/generated_cases.c.h" + #line 4830 "Python/generated_cases.c.h" DISPATCH(); } TARGET(INSTRUMENTED_POP_JUMP_IF_NOT_NONE) { - #line 3486 "Python/bytecodes.c" + #line 3487 "Python/bytecodes.c" PyObject *value = POP(); _Py_CODEUNIT *here = next_instr-1; int offset; @@ -4855,30 +4843,30 @@ offset = oparg; } INSTRUMENTED_JUMP(here, next_instr + offset, PY_MONITORING_EVENT_BRANCH); - #line 4859 "Python/generated_cases.c.h" + #line 4847 "Python/generated_cases.c.h" DISPATCH(); } TARGET(EXTENDED_ARG) { - #line 3500 "Python/bytecodes.c" + #line 3501 "Python/bytecodes.c" assert(oparg); opcode = next_instr->op.code; oparg = oparg << 8 | next_instr->op.arg; PRE_DISPATCH_GOTO(); DISPATCH_GOTO(); - #line 4870 "Python/generated_cases.c.h" + #line 4858 "Python/generated_cases.c.h" } TARGET(CACHE) { - #line 3508 "Python/bytecodes.c" + #line 3509 "Python/bytecodes.c" assert(0 && "Executing a cache."); Py_UNREACHABLE(); - #line 4877 "Python/generated_cases.c.h" + #line 4865 "Python/generated_cases.c.h" } TARGET(RESERVED) { - #line 3513 "Python/bytecodes.c" + #line 3514 "Python/bytecodes.c" assert(0 && "Executing RESERVED instruction."); Py_UNREACHABLE(); - #line 4884 "Python/generated_cases.c.h" + #line 4872 "Python/generated_cases.c.h" } diff --git a/Python/opcode_metadata.h b/Python/opcode_metadata.h index c7de65f981bdc2..f297e3b19ed043 100644 --- a/Python/opcode_metadata.h +++ b/Python/opcode_metadata.h @@ -353,41 +353,41 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) { case INSTRUMENTED_CALL: return 0; case CALL: - return oparg + 3; + return (oparg >> 1) + ((oparg & 1) ? 1 : 0) + 2; case CALL_BOUND_METHOD_EXACT_ARGS: - return oparg + 3; + return (oparg >> 1) + ((oparg & 1) ? 1 : 0) + 2; case CALL_PY_EXACT_ARGS: - return oparg + 3; + return (oparg >> 1) + ((oparg & 1) ? 1 : 0) + 2; case CALL_PY_WITH_DEFAULTS: - return oparg + 3; + return (oparg >> 1) + ((oparg & 1) ? 1 : 0) + 2; case CALL_NO_KW_TYPE_1: - return oparg + 3; + return (oparg >> 1) + ((oparg & 1) ? 1 : 0) + 2; case CALL_NO_KW_STR_1: - return oparg + 3; + return (oparg >> 1) + ((oparg & 1) ? 1 : 0) + 2; case CALL_NO_KW_TUPLE_1: - return oparg + 3; + return (oparg >> 1) + ((oparg & 1) ? 1 : 0) + 2; case CALL_BUILTIN_CLASS: - return oparg + 3; + return (oparg >> 1) + ((oparg & 1) ? 1 : 0) + 2; case CALL_NO_KW_BUILTIN_O: - return oparg + 3; + return (oparg >> 1) + ((oparg & 1) ? 1 : 0) + 2; case CALL_NO_KW_BUILTIN_FAST: - return oparg + 3; + return (oparg >> 1) + ((oparg & 1) ? 1 : 0) + 2; case CALL_BUILTIN_FAST_WITH_KEYWORDS: - return oparg + 3; + return (oparg >> 1) + ((oparg & 1) ? 1 : 0) + 2; case CALL_NO_KW_LEN: - return oparg + 3; + return (oparg >> 1) + ((oparg & 1) ? 1 : 0) + 2; case CALL_NO_KW_ISINSTANCE: - return oparg + 3; + return (oparg >> 1) + ((oparg & 1) ? 1 : 0) + 2; case CALL_NO_KW_LIST_APPEND: - return oparg + 3; + return (oparg >> 1) + ((oparg & 1) ? 1 : 0) + 2; case CALL_NO_KW_METHOD_DESCRIPTOR_O: - return oparg + 3; + return (oparg >> 1) + ((oparg & 1) ? 1 : 0) + 2; case CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS: - return oparg + 3; + return (oparg >> 1) + ((oparg & 1) ? 1 : 0) + 2; case CALL_NO_KW_METHOD_DESCRIPTOR_NOARGS: - return oparg + 3; + return (oparg >> 1) + ((oparg & 1) ? 1 : 0) + 2; case CALL_NO_KW_METHOD_DESCRIPTOR_FAST: - return oparg + 3; + return (oparg >> 1) + ((oparg & 1) ? 1 : 0) + 2; case INSTRUMENTED_CALL_FUNCTION_EX: return 0; case CALL_FUNCTION_EX: diff --git a/Python/specialize.c b/Python/specialize.c index 44b14c5952315f..4eb08c63adb1a7 100644 --- a/Python/specialize.c +++ b/Python/specialize.c @@ -1502,7 +1502,7 @@ specialize_class_call(PyObject *callable, _Py_CODEUNIT *instr, int nargs, } if (tp->tp_flags & Py_TPFLAGS_IMMUTABLETYPE) { int oparg = instr->op.arg; - if (nargs == 1 && kwnames == NULL && oparg == 1) { + if (nargs == 1 && kwnames == NULL && (oparg >> 1) == 1) { if (tp == &PyUnicode_Type) { instr->op.code = CALL_NO_KW_STR_1; return 0; @@ -1605,7 +1605,7 @@ specialize_method_descriptor(PyMethodDescrObject *descr, _Py_CODEUNIT *instr, _Py_CODEUNIT next = instr[INLINE_CACHE_ENTRIES_CALL + 1]; bool pop = (next.op.code == POP_TOP); int oparg = instr->op.arg; - if ((PyObject *)descr == list_append && oparg == 1 && pop) { + if ((PyObject *)descr == list_append && (oparg >> 1) == 1 && pop) { instr->op.code = CALL_NO_KW_LIST_APPEND; return 0; } From b02283782f7c8a77f51067727b3e84a2b5732f4d Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Fri, 16 Jun 2023 03:03:55 -0700 Subject: [PATCH 08/10] Fix blurb --- .../2023-06-15-22-57-23.gh-issue-105848._gxL3O.rst | 3 +-- .../2023-06-16-03-03-39.gh-issue-105848.g0uVaB.rst | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2023-06-16-03-03-39.gh-issue-105848.g0uVaB.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-06-15-22-57-23.gh-issue-105848._gxL3O.rst b/Misc/NEWS.d/next/Core and Builtins/2023-06-15-22-57-23.gh-issue-105848._gxL3O.rst index 337fb821da60df..bcf426e77f7a16 100644 --- a/Misc/NEWS.d/next/Core and Builtins/2023-06-15-22-57-23.gh-issue-105848._gxL3O.rst +++ b/Misc/NEWS.d/next/Core and Builtins/2023-06-15-22-57-23.gh-issue-105848._gxL3O.rst @@ -1,2 +1 @@ -Replace the ``KW_NAMES`` opcode with either a :opcode:`PUSH_NULL` or a -:opcode:`LOAD_CONST` immediately before all :opcode:`CALL` instructions. +Replace the ``KW_NAMES`` opcode with a flag on the low bit of :opcode:`CALL` instructions indicating the presence of keyword names on the stack. diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-06-16-03-03-39.gh-issue-105848.g0uVaB.rst b/Misc/NEWS.d/next/Core and Builtins/2023-06-16-03-03-39.gh-issue-105848.g0uVaB.rst new file mode 100644 index 00000000000000..41f443d98036b6 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2023-06-16-03-03-39.gh-issue-105848.g0uVaB.rst @@ -0,0 +1,2 @@ +Replace the ``KW_NAMES`` opcode with a flag on the low bit of :opcode:`CALL` +instructions indicating the presence of keyword names on the stack. From 408c615c9f853b8dfd1b16d6f5ee8ea2cf20a4fd Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Fri, 16 Jun 2023 03:04:02 -0700 Subject: [PATCH 09/10] fixup --- Objects/frameobject.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Objects/frameobject.c b/Objects/frameobject.c index e1b29b9ab21e3a..939bb14fa1c1fa 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -425,9 +425,8 @@ mark_stacks(PyCodeObject *code_obj, int len) } case CALL: { - int args = oparg >> 1; - bool kwnames = oparg & 1; - for (int j = 0; j < 2 + args + kwnames; j++) { + int args = (oparg >> 1) + (oparg & 1); + for (int j = 0; j < args+2; j++) { next_stack = pop_value(next_stack); } next_stack = push_value(next_stack, Object); From 47205b232c9fc0b5ef17d6b2ec89c18cce0319c5 Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Fri, 16 Jun 2023 03:08:49 -0700 Subject: [PATCH 10/10] Remove bad blurb --- .../2023-06-15-22-57-23.gh-issue-105848._gxL3O.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Misc/NEWS.d/next/Core and Builtins/2023-06-15-22-57-23.gh-issue-105848._gxL3O.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-06-15-22-57-23.gh-issue-105848._gxL3O.rst b/Misc/NEWS.d/next/Core and Builtins/2023-06-15-22-57-23.gh-issue-105848._gxL3O.rst deleted file mode 100644 index bcf426e77f7a16..00000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2023-06-15-22-57-23.gh-issue-105848._gxL3O.rst +++ /dev/null @@ -1 +0,0 @@ -Replace the ``KW_NAMES`` opcode with a flag on the low bit of :opcode:`CALL` instructions indicating the presence of keyword names on the stack.