From 85ab4058a923b49fdb4894e21f48cffecc279cf8 Mon Sep 17 00:00:00 2001 From: Tomas Roun Date: Mon, 23 Jun 2025 20:19:03 +0200 Subject: [PATCH 01/10] Eliminate redundant refcounting from _CALL_TYPE_1 --- Include/internal/pycore_opcode_metadata.h | 2 +- Include/internal/pycore_uop_metadata.h | 2 +- Lib/test/test_capi/test_opt.py | 15 +++++++++++++++ Python/bytecodes.c | 12 +++++------- Python/executor_cases.c.h | 14 ++++---------- Python/generated_cases.c.h | 11 ++++++++--- Python/optimizer_bytecodes.c | 3 ++- Python/optimizer_cases.c.h | 5 ++++- 8 files changed, 40 insertions(+), 24 deletions(-) diff --git a/Include/internal/pycore_opcode_metadata.h b/Include/internal/pycore_opcode_metadata.h index dd1bf2d1d2b51a..0c9c2c0ef7264a 100644 --- a/Include/internal/pycore_opcode_metadata.h +++ b/Include/internal/pycore_opcode_metadata.h @@ -1368,7 +1368,7 @@ _PyOpcode_macro_expansion[256] = { [CALL_PY_GENERAL] = { .nuops = 6, .uops = { { _CHECK_PEP_523, OPARG_SIMPLE, 1 }, { _CHECK_FUNCTION_VERSION, 2, 1 }, { _CHECK_RECURSION_REMAINING, OPARG_SIMPLE, 3 }, { _PY_FRAME_GENERAL, OPARG_SIMPLE, 3 }, { _SAVE_RETURN_OFFSET, OPARG_SAVE_RETURN_OFFSET, 3 }, { _PUSH_FRAME, OPARG_SIMPLE, 3 } } }, [CALL_STR_1] = { .nuops = 4, .uops = { { _GUARD_NOS_NULL, OPARG_SIMPLE, 3 }, { _GUARD_CALLABLE_STR_1, OPARG_SIMPLE, 3 }, { _CALL_STR_1, OPARG_SIMPLE, 3 }, { _CHECK_PERIODIC, OPARG_SIMPLE, 3 } } }, [CALL_TUPLE_1] = { .nuops = 4, .uops = { { _GUARD_NOS_NULL, OPARG_SIMPLE, 3 }, { _GUARD_CALLABLE_TUPLE_1, OPARG_SIMPLE, 3 }, { _CALL_TUPLE_1, OPARG_SIMPLE, 3 }, { _CHECK_PERIODIC, OPARG_SIMPLE, 3 } } }, - [CALL_TYPE_1] = { .nuops = 3, .uops = { { _GUARD_NOS_NULL, OPARG_SIMPLE, 3 }, { _GUARD_CALLABLE_TYPE_1, OPARG_SIMPLE, 3 }, { _CALL_TYPE_1, OPARG_SIMPLE, 3 } } }, + [CALL_TYPE_1] = { .nuops = 4, .uops = { { _GUARD_NOS_NULL, OPARG_SIMPLE, 3 }, { _GUARD_CALLABLE_TYPE_1, OPARG_SIMPLE, 3 }, { _CALL_TYPE_1, OPARG_SIMPLE, 3 }, { _POP_TOP, OPARG_SIMPLE, 3 } } }, [CHECK_EG_MATCH] = { .nuops = 1, .uops = { { _CHECK_EG_MATCH, OPARG_SIMPLE, 0 } } }, [CHECK_EXC_MATCH] = { .nuops = 1, .uops = { { _CHECK_EXC_MATCH, OPARG_SIMPLE, 0 } } }, [COMPARE_OP] = { .nuops = 1, .uops = { { _COMPARE_OP, OPARG_SIMPLE, 0 } } }, diff --git a/Include/internal/pycore_uop_metadata.h b/Include/internal/pycore_uop_metadata.h index 52cbc2fffe484e..f0c1545a7456ae 100644 --- a/Include/internal/pycore_uop_metadata.h +++ b/Include/internal/pycore_uop_metadata.h @@ -261,7 +261,7 @@ const uint16_t _PyUop_Flags[MAX_UOP_ID+1] = { [_GUARD_NOS_NOT_NULL] = HAS_EXIT_FLAG, [_GUARD_THIRD_NULL] = HAS_DEOPT_FLAG, [_GUARD_CALLABLE_TYPE_1] = HAS_DEOPT_FLAG, - [_CALL_TYPE_1] = HAS_ARG_FLAG | HAS_ESCAPES_FLAG, + [_CALL_TYPE_1] = HAS_ARG_FLAG, [_GUARD_CALLABLE_STR_1] = HAS_DEOPT_FLAG, [_CALL_STR_1] = HAS_ARG_FLAG | HAS_ERROR_FLAG | HAS_ESCAPES_FLAG, [_GUARD_CALLABLE_TUPLE_1] = HAS_DEOPT_FLAG, diff --git a/Lib/test/test_capi/test_opt.py b/Lib/test/test_capi/test_opt.py index 0a85b19e06f158..a45d04a196244d 100644 --- a/Lib/test/test_capi/test_opt.py +++ b/Lib/test/test_capi/test_opt.py @@ -1841,6 +1841,21 @@ def testfunc(n): uops = get_opnames(ex) self.assertNotIn("_GUARD_IS_NOT_NONE_POP", uops) + def test_call_type_1_pop_top(self): + def testfunc(n): + x = 0 + for _ in range(n): + foo = eval('42') + x += type(foo) is int + return x + + res, ex = self._run_with_optimizer(testfunc, TIER2_THRESHOLD) + self.assertEqual(res, TIER2_THRESHOLD) + self.assertIsNotNone(ex) + uops = get_opnames(ex) + self.assertIn("_CALL_TYPE_1", uops) + self.assertIn("_POP_TOP_NOP", uops) + def test_call_str_1(self): def testfunc(n): x = 0 diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 535e552e047475..7ad9215210c710 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -4030,17 +4030,14 @@ dummy_func( DEOPT_IF(callable_o != (PyObject *)&PyType_Type); } - op(_CALL_TYPE_1, (callable, null, arg -- res)) { + op(_CALL_TYPE_1, (callable, null, arg -- res, a)) { PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg); assert(oparg == 1); - DEAD(null); - DEAD(callable); - (void)callable; // Silence compiler warnings about unused variables - (void)null; STAT_INC(CALL, hit); + INPUTS_DEAD(); res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o)); - PyStackRef_CLOSE(arg); + a = arg; } macro(CALL_TYPE_1) = @@ -4048,7 +4045,8 @@ dummy_func( unused/2 + _GUARD_NOS_NULL + _GUARD_CALLABLE_TYPE_1 + - _CALL_TYPE_1; + _CALL_TYPE_1 + + POP_TOP; op(_GUARD_CALLABLE_STR_1, (callable, unused, unused -- callable, unused, unused)) { PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable); diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index 46fc164a5b3bc2..f723546dfa5067 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -5408,25 +5408,19 @@ case _CALL_TYPE_1: { _PyStackRef arg; - _PyStackRef null; - _PyStackRef callable; _PyStackRef res; + _PyStackRef a; oparg = CURRENT_OPARG(); arg = stack_pointer[-1]; - null = stack_pointer[-2]; - callable = stack_pointer[-3]; PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg); assert(oparg == 1); - (void)callable; - (void)null; STAT_INC(CALL, hit); res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o)); + a = arg; stack_pointer[-3] = res; - stack_pointer += -2; + stack_pointer[-2] = a; + stack_pointer += -1; assert(WITHIN_STACK_BOUNDS()); - _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(arg); - stack_pointer = _PyFrame_GetStackPointer(frame); break; } diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 8f7932f0033c6f..bb21a9c6c87d79 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -4539,6 +4539,8 @@ _PyStackRef callable; _PyStackRef arg; _PyStackRef res; + _PyStackRef a; + _PyStackRef value; /* Skip 1 cache entry */ /* Skip 2 cache entries */ // _GUARD_NOS_NULL @@ -4565,15 +4567,18 @@ arg = stack_pointer[-1]; PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg); assert(oparg == 1); - (void)callable; - (void)null; STAT_INC(CALL, hit); res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o)); + a = arg; + } + // _POP_TOP + { + value = a; stack_pointer[-3] = res; stack_pointer += -2; assert(WITHIN_STACK_BOUNDS()); _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(arg); + PyStackRef_XCLOSE(value); stack_pointer = _PyFrame_GetStackPointer(frame); } DISPATCH(); diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c index f8fbaf232ffa2e..808804aeb34b76 100644 --- a/Python/optimizer_bytecodes.c +++ b/Python/optimizer_bytecodes.c @@ -969,7 +969,7 @@ dummy_func(void) { next = sym_new_type(ctx, &PyLong_Type); } - op(_CALL_TYPE_1, (unused, unused, arg -- res)) { + op(_CALL_TYPE_1, (unused, unused, arg -- res, a)) { PyObject* type = (PyObject *)sym_get_type(arg); if (type) { res = sym_new_const(ctx, type); @@ -979,6 +979,7 @@ dummy_func(void) { else { res = sym_new_not_null(ctx); } + a = arg; } op(_CALL_STR_1, (unused, unused, arg -- res)) { diff --git a/Python/optimizer_cases.c.h b/Python/optimizer_cases.c.h index 1e581afadc9569..37ebddd3dcc9a4 100644 --- a/Python/optimizer_cases.c.h +++ b/Python/optimizer_cases.c.h @@ -2133,6 +2133,7 @@ case _CALL_TYPE_1: { JitOptRef arg; JitOptRef res; + JitOptRef a; arg = stack_pointer[-1]; PyObject* type = (PyObject *)sym_get_type(arg); if (type) { @@ -2143,8 +2144,10 @@ else { res = sym_new_not_null(ctx); } + a = arg; stack_pointer[-3] = res; - stack_pointer += -2; + stack_pointer[-2] = a; + stack_pointer += -1; assert(WITHIN_STACK_BOUNDS()); break; } From f927209daae742ed0f2da2e34353fa35577014c7 Mon Sep 17 00:00:00 2001 From: Tomas Roun Date: Mon, 23 Jun 2025 20:51:52 +0200 Subject: [PATCH 02/10] Add a new uop --- Include/internal/pycore_uop_ids.h | 19 ++++++++-------- Include/internal/pycore_uop_metadata.h | 4 ++++ Python/bytecodes.c | 9 ++++++++ Python/executor_cases.c.h | 30 ++++++++++++++++++++++++++ Python/optimizer_bytecodes.c | 7 +++++- Python/optimizer_cases.c.h | 17 ++++++++++++++- 6 files changed, 75 insertions(+), 11 deletions(-) diff --git a/Include/internal/pycore_uop_ids.h b/Include/internal/pycore_uop_ids.h index a9432401525ebb..f2cf4668e2f3da 100644 --- a/Include/internal/pycore_uop_ids.h +++ b/Include/internal/pycore_uop_ids.h @@ -336,24 +336,25 @@ extern "C" { #define _SWAP 537 #define _SWAP_2 538 #define _SWAP_3 539 -#define _TIER2_RESUME_CHECK 540 -#define _TO_BOOL 541 +#define _SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW 540 +#define _TIER2_RESUME_CHECK 541 +#define _TO_BOOL 542 #define _TO_BOOL_BOOL TO_BOOL_BOOL #define _TO_BOOL_INT TO_BOOL_INT -#define _TO_BOOL_LIST 542 +#define _TO_BOOL_LIST 543 #define _TO_BOOL_NONE TO_BOOL_NONE -#define _TO_BOOL_STR 543 +#define _TO_BOOL_STR 544 #define _UNARY_INVERT UNARY_INVERT #define _UNARY_NEGATIVE UNARY_NEGATIVE #define _UNARY_NOT UNARY_NOT #define _UNPACK_EX UNPACK_EX -#define _UNPACK_SEQUENCE 544 -#define _UNPACK_SEQUENCE_LIST 545 -#define _UNPACK_SEQUENCE_TUPLE 546 -#define _UNPACK_SEQUENCE_TWO_TUPLE 547 +#define _UNPACK_SEQUENCE 545 +#define _UNPACK_SEQUENCE_LIST 546 +#define _UNPACK_SEQUENCE_TUPLE 547 +#define _UNPACK_SEQUENCE_TWO_TUPLE 548 #define _WITH_EXCEPT_START WITH_EXCEPT_START #define _YIELD_VALUE YIELD_VALUE -#define MAX_UOP_ID 547 +#define MAX_UOP_ID 548 #ifdef __cplusplus } diff --git a/Include/internal/pycore_uop_metadata.h b/Include/internal/pycore_uop_metadata.h index f0c1545a7456ae..05844715d72c9f 100644 --- a/Include/internal/pycore_uop_metadata.h +++ b/Include/internal/pycore_uop_metadata.h @@ -327,6 +327,7 @@ const uint16_t _PyUop_Flags[MAX_UOP_ID+1] = { [_POP_CALL_LOAD_CONST_INLINE_BORROW] = HAS_ESCAPES_FLAG, [_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW] = HAS_ESCAPES_FLAG, [_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW] = HAS_ESCAPES_FLAG, + [_SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW] = HAS_ESCAPES_FLAG, [_LOAD_CONST_UNDER_INLINE] = 0, [_LOAD_CONST_UNDER_INLINE_BORROW] = 0, [_CHECK_FUNCTION] = HAS_DEOPT_FLAG, @@ -648,6 +649,7 @@ const char *const _PyOpcode_uop_name[MAX_UOP_ID+1] = { [_SWAP] = "_SWAP", [_SWAP_2] = "_SWAP_2", [_SWAP_3] = "_SWAP_3", + [_SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW] = "_SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW", [_TIER2_RESUME_CHECK] = "_TIER2_RESUME_CHECK", [_TO_BOOL] = "_TO_BOOL", [_TO_BOOL_BOOL] = "_TO_BOOL_BOOL", @@ -1283,6 +1285,8 @@ int _PyUop_num_popped(int opcode, int oparg) return 3; case _POP_CALL_TWO_LOAD_CONST_INLINE_BORROW: return 4; + case _SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW: + return 3; case _LOAD_CONST_UNDER_INLINE: return 1; case _LOAD_CONST_UNDER_INLINE_BORROW: diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 7ad9215210c710..d834015d614606 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -5358,6 +5358,15 @@ dummy_func( value = PyStackRef_FromPyObjectBorrow(ptr); } + tier2 op(_SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW, (ptr/4, callable, null, arg -- value, a)) { + PyStackRef_CLOSE(arg); + (void)null; // Silence compiler warnings about unused variables + DEAD(null); + PyStackRef_CLOSE(callable); + value = PyStackRef_FromPyObjectBorrow(ptr); + a = arg; + } + tier2 op(_LOAD_CONST_UNDER_INLINE, (ptr/4, old -- value, new)) { new = old; DEAD(old); diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index f723546dfa5067..50d68a532d6495 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -7396,6 +7396,36 @@ break; } + case _SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW: { + _PyStackRef arg; + _PyStackRef null; + _PyStackRef callable; + _PyStackRef value; + _PyStackRef a; + arg = stack_pointer[-1]; + null = stack_pointer[-2]; + callable = stack_pointer[-3]; + PyObject *ptr = (PyObject *)CURRENT_OPERAND0(); + stack_pointer += -1; + assert(WITHIN_STACK_BOUNDS()); + _PyFrame_SetStackPointer(frame, stack_pointer); + PyStackRef_CLOSE(arg); + stack_pointer = _PyFrame_GetStackPointer(frame); + (void)null; + stack_pointer += -2; + assert(WITHIN_STACK_BOUNDS()); + _PyFrame_SetStackPointer(frame, stack_pointer); + PyStackRef_CLOSE(callable); + stack_pointer = _PyFrame_GetStackPointer(frame); + value = PyStackRef_FromPyObjectBorrow(ptr); + a = arg; + stack_pointer[0] = value; + stack_pointer[1] = a; + stack_pointer += 2; + assert(WITHIN_STACK_BOUNDS()); + break; + } + case _LOAD_CONST_UNDER_INLINE: { _PyStackRef old; _PyStackRef value; diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c index 808804aeb34b76..87ec40ad56d45d 100644 --- a/Python/optimizer_bytecodes.c +++ b/Python/optimizer_bytecodes.c @@ -561,6 +561,11 @@ dummy_func(void) { value = PyJitRef_Borrow(sym_new_const(ctx, ptr)); } + op(_SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW, (ptr/4, unused, unused, arg -- value, a)) { + value = PyJitRef_Borrow(sym_new_const(ctx, ptr)); + a = arg; + } + op(_POP_TOP, (value -- )) { PyTypeObject *typ = sym_get_type(value); if (PyJitRef_IsBorrowed(value) || @@ -973,7 +978,7 @@ dummy_func(void) { PyObject* type = (PyObject *)sym_get_type(arg); if (type) { res = sym_new_const(ctx, type); - REPLACE_OP(this_instr, _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW, 0, + REPLACE_OP(this_instr, _SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)type); } else { diff --git a/Python/optimizer_cases.c.h b/Python/optimizer_cases.c.h index 37ebddd3dcc9a4..8753d89633ba75 100644 --- a/Python/optimizer_cases.c.h +++ b/Python/optimizer_cases.c.h @@ -2138,7 +2138,7 @@ PyObject* type = (PyObject *)sym_get_type(arg); if (type) { res = sym_new_const(ctx, type); - REPLACE_OP(this_instr, _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW, 0, + REPLACE_OP(this_instr, _SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)type); } else { @@ -2794,6 +2794,21 @@ break; } + case _SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW: { + JitOptRef arg; + JitOptRef value; + JitOptRef a; + arg = stack_pointer[-1]; + PyObject *ptr = (PyObject *)this_instr->operand0; + value = PyJitRef_Borrow(sym_new_const(ctx, ptr)); + a = arg; + stack_pointer[-3] = value; + stack_pointer[-2] = a; + stack_pointer += -1; + assert(WITHIN_STACK_BOUNDS()); + break; + } + case _LOAD_CONST_UNDER_INLINE: { JitOptRef value; JitOptRef new; From bbf1c9d8222e373819eced19ab740041952a24bd Mon Sep 17 00:00:00 2001 From: Tomas Roun Date: Mon, 23 Jun 2025 20:54:20 +0200 Subject: [PATCH 03/10] Add news entry --- .../2025-06-23-20-54-15.gh-issue-134584.ZNcziF.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2025-06-23-20-54-15.gh-issue-134584.ZNcziF.rst diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-06-23-20-54-15.gh-issue-134584.ZNcziF.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-06-23-20-54-15.gh-issue-134584.ZNcziF.rst new file mode 100644 index 00000000000000..520690bc25c4cf --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2025-06-23-20-54-15.gh-issue-134584.ZNcziF.rst @@ -0,0 +1 @@ +Eliminate redundant refcounting from ``_CALL_TYPE_1``. Patch by Tomas Roun From 81f9b443c833845fbf3c31f6a4bef413b8163a18 Mon Sep 17 00:00:00 2001 From: Tomas Roun Date: Mon, 23 Jun 2025 21:10:11 +0200 Subject: [PATCH 04/10] Do not close callable stackref --- Python/bytecodes.c | 4 +++- Python/executor_cases.c.h | 13 ++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Python/bytecodes.c b/Python/bytecodes.c index d834015d614606..54ac0cce9a980d 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -5361,8 +5361,10 @@ dummy_func( tier2 op(_SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW, (ptr/4, callable, null, arg -- value, a)) { PyStackRef_CLOSE(arg); (void)null; // Silence compiler warnings about unused variables + (void)callable; DEAD(null); - PyStackRef_CLOSE(callable); + DEAD(callable); + assert(_Py_IsImmortal(PyStackRef_AsPyObjectBorrow(callable))); value = PyStackRef_FromPyObjectBorrow(ptr); a = arg; } diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index 50d68a532d6495..5617cbc4b6b750 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -7412,17 +7412,12 @@ PyStackRef_CLOSE(arg); stack_pointer = _PyFrame_GetStackPointer(frame); (void)null; - stack_pointer += -2; - assert(WITHIN_STACK_BOUNDS()); - _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(callable); - stack_pointer = _PyFrame_GetStackPointer(frame); + (void)callable; + assert(_Py_IsImmortal(PyStackRef_AsPyObjectBorrow(callable))); value = PyStackRef_FromPyObjectBorrow(ptr); a = arg; - stack_pointer[0] = value; - stack_pointer[1] = a; - stack_pointer += 2; - assert(WITHIN_STACK_BOUNDS()); + stack_pointer[-2] = value; + stack_pointer[-1] = a; break; } From 6934f633a41378d010b4236f64a2535c9ebeafb9 Mon Sep 17 00:00:00 2001 From: Tomas Roun Date: Mon, 23 Jun 2025 21:14:54 +0200 Subject: [PATCH 05/10] Update remove_unneeded_uops with new uops --- Lib/test/test_capi/test_opt.py | 3 ++- Python/optimizer_analysis.c | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_capi/test_opt.py b/Lib/test/test_capi/test_opt.py index a45d04a196244d..4831206cecdfd1 100644 --- a/Lib/test/test_capi/test_opt.py +++ b/Lib/test/test_capi/test_opt.py @@ -1819,9 +1819,10 @@ def testfunc(n): self.assertIsNotNone(ex) uops = get_opnames(ex) # When the result of type(...) is known, _CALL_TYPE_1 is replaced with - # _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW which is optimized away in + # _SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW which is optimized away in # remove_unneeded_uops. self.assertNotIn("_CALL_TYPE_1", uops) + self.assertNotIn("_SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW", uops) self.assertNotIn("_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW", uops) self.assertNotIn("_POP_CALL_LOAD_CONST_INLINE_BORROW", uops) self.assertNotIn("_POP_TOP_LOAD_CONST_INLINE_BORROW", uops) diff --git a/Python/optimizer_analysis.c b/Python/optimizer_analysis.c index 145a8c118d3612..fab6ad9486903c 100644 --- a/Python/optimizer_analysis.c +++ b/Python/optimizer_analysis.c @@ -566,7 +566,9 @@ const uint16_t op_without_push[MAX_UOP_ID + 1] = { [_POP_TOP_LOAD_CONST_INLINE] = _POP_TOP, [_POP_TOP_LOAD_CONST_INLINE_BORROW] = _POP_TOP, [_POP_TWO_LOAD_CONST_INLINE_BORROW] = _POP_TWO, + [_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW] = _POP_CALL_ONE, [_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW] = _POP_CALL_TWO, + [_SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW] = _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW, }; const bool op_skip[MAX_UOP_ID + 1] = { @@ -578,6 +580,10 @@ const bool op_skip[MAX_UOP_ID + 1] = { const uint16_t op_without_pop[MAX_UOP_ID + 1] = { [_POP_TOP] = _NOP, + [_POP_TOP_NOP] = _NOP, + [_POP_TOP_INT] = _NOP, + [_POP_TOP_FLOAT] = _NOP, + [_POP_TOP_UNICODE] = _NOP, [_POP_TOP_LOAD_CONST_INLINE] = _LOAD_CONST_INLINE, [_POP_TOP_LOAD_CONST_INLINE_BORROW] = _LOAD_CONST_INLINE_BORROW, [_POP_TWO] = _POP_TOP, From e86897af9270c6d88b91e2a8cc43ed89795134d1 Mon Sep 17 00:00:00 2001 From: Tomas Roun Date: Mon, 22 Dec 2025 22:31:26 +0100 Subject: [PATCH 06/10] Do not close arg --- Python/bytecodes.c | 1 - 1 file changed, 1 deletion(-) diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 54ac0cce9a980d..bd89009a74ec10 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -5359,7 +5359,6 @@ dummy_func( } tier2 op(_SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW, (ptr/4, callable, null, arg -- value, a)) { - PyStackRef_CLOSE(arg); (void)null; // Silence compiler warnings about unused variables (void)callable; DEAD(null); From ca15e78024aa11f06e19da08169f3d2407a85247 Mon Sep 17 00:00:00 2001 From: Tomas Roun Date: Mon, 22 Dec 2025 23:12:22 +0100 Subject: [PATCH 07/10] Update test --- Lib/test/test_capi/test_opt.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/test/test_capi/test_opt.py b/Lib/test/test_capi/test_opt.py index 88eefd48353088..338af22a90704c 100644 --- a/Lib/test/test_capi/test_opt.py +++ b/Lib/test/test_capi/test_opt.py @@ -1961,6 +1961,7 @@ def testfunc(n): self.assertIsNotNone(ex) uops = get_opnames(ex) self.assertIn("_CALL_TYPE_1", uops) + self.assertIn("_POP_TOP_NOP", uops) def test_call_tuple_1_pop_top(self): def testfunc(n): From bcb805d4d8a53dc767c1d86446429734f65eb49a Mon Sep 17 00:00:00 2001 From: Tomas Roun Date: Mon, 22 Dec 2025 23:21:02 +0100 Subject: [PATCH 08/10] Rename _SWAP_.. to _SHUFFLE_2_.. --- Include/internal/pycore_opcode_metadata.h | 4 +- Include/internal/pycore_uop_ids.h | 818 +++++++++++++++++++++- Include/internal/pycore_uop_metadata.h | 49 +- Lib/test/test_capi/test_opt.py | 4 +- Python/bytecodes.c | 16 +- Python/executor_cases.c.h | 449 +++++------- Python/optimizer_analysis.c | 2 +- Python/optimizer_bytecodes.c | 6 +- Python/optimizer_cases.c.h | 36 +- 9 files changed, 1018 insertions(+), 366 deletions(-) diff --git a/Include/internal/pycore_opcode_metadata.h b/Include/internal/pycore_opcode_metadata.h index 6f69dc8b1d96a4..923afe8436038c 100644 --- a/Include/internal/pycore_opcode_metadata.h +++ b/Include/internal/pycore_opcode_metadata.h @@ -1375,8 +1375,8 @@ _PyOpcode_macro_expansion[256] = { [CALL_NON_PY_GENERAL] = { .nuops = 3, .uops = { { _CHECK_IS_NOT_PY_CALLABLE, OPARG_SIMPLE, 3 }, { _CALL_NON_PY_GENERAL, OPARG_SIMPLE, 3 }, { _CHECK_PERIODIC_AT_END, OPARG_REPLACED, 3 } } }, [CALL_PY_EXACT_ARGS] = { .nuops = 8, .uops = { { _CHECK_PEP_523, OPARG_SIMPLE, 1 }, { _CHECK_FUNCTION_VERSION, 2, 1 }, { _CHECK_FUNCTION_EXACT_ARGS, OPARG_SIMPLE, 3 }, { _CHECK_STACK_SPACE, OPARG_SIMPLE, 3 }, { _CHECK_RECURSION_REMAINING, OPARG_SIMPLE, 3 }, { _INIT_CALL_PY_EXACT_ARGS, OPARG_SIMPLE, 3 }, { _SAVE_RETURN_OFFSET, OPARG_SAVE_RETURN_OFFSET, 3 }, { _PUSH_FRAME, OPARG_SIMPLE, 3 } } }, [CALL_PY_GENERAL] = { .nuops = 6, .uops = { { _CHECK_PEP_523, OPARG_SIMPLE, 1 }, { _CHECK_FUNCTION_VERSION, 2, 1 }, { _CHECK_RECURSION_REMAINING, OPARG_SIMPLE, 3 }, { _PY_FRAME_GENERAL, OPARG_SIMPLE, 3 }, { _SAVE_RETURN_OFFSET, OPARG_SAVE_RETURN_OFFSET, 3 }, { _PUSH_FRAME, OPARG_SIMPLE, 3 } } }, - [CALL_STR_1] = { .nuops = 4, .uops = { { _GUARD_NOS_NULL, OPARG_SIMPLE, 3 }, { _GUARD_CALLABLE_STR_1, OPARG_SIMPLE, 3 }, { _CALL_STR_1, OPARG_SIMPLE, 3 }, { _CHECK_PERIODIC, OPARG_SIMPLE, 3 } } }, - [CALL_TUPLE_1] = { .nuops = 4, .uops = { { _GUARD_NOS_NULL, OPARG_SIMPLE, 3 }, { _GUARD_CALLABLE_TUPLE_1, OPARG_SIMPLE, 3 }, { _CALL_TUPLE_1, OPARG_SIMPLE, 3 }, { _CHECK_PERIODIC, OPARG_SIMPLE, 3 } } }, + [CALL_STR_1] = { .nuops = 5, .uops = { { _GUARD_NOS_NULL, OPARG_SIMPLE, 3 }, { _GUARD_CALLABLE_STR_1, OPARG_SIMPLE, 3 }, { _CALL_STR_1, OPARG_SIMPLE, 3 }, { _POP_TOP, OPARG_SIMPLE, 3 }, { _CHECK_PERIODIC_AT_END, OPARG_REPLACED, 3 } } }, + [CALL_TUPLE_1] = { .nuops = 5, .uops = { { _GUARD_NOS_NULL, OPARG_SIMPLE, 3 }, { _GUARD_CALLABLE_TUPLE_1, OPARG_SIMPLE, 3 }, { _CALL_TUPLE_1, OPARG_SIMPLE, 3 }, { _POP_TOP, OPARG_SIMPLE, 3 }, { _CHECK_PERIODIC_AT_END, OPARG_REPLACED, 3 } } }, [CALL_TYPE_1] = { .nuops = 4, .uops = { { _GUARD_NOS_NULL, OPARG_SIMPLE, 3 }, { _GUARD_CALLABLE_TYPE_1, OPARG_SIMPLE, 3 }, { _CALL_TYPE_1, OPARG_SIMPLE, 3 }, { _POP_TOP, OPARG_SIMPLE, 3 } } }, [CHECK_EG_MATCH] = { .nuops = 1, .uops = { { _CHECK_EG_MATCH, OPARG_SIMPLE, 0 } } }, [CHECK_EXC_MATCH] = { .nuops = 1, .uops = { { _CHECK_EXC_MATCH, OPARG_SIMPLE, 0 } } }, diff --git a/Include/internal/pycore_uop_ids.h b/Include/internal/pycore_uop_ids.h index e7104f4b91ac00..7805310fb8eb18 100644 --- a/Include/internal/pycore_uop_ids.h +++ b/Include/internal/pycore_uop_ids.h @@ -314,51 +314,803 @@ extern "C" { #define _SET_ADD SET_ADD #define _SET_FUNCTION_ATTRIBUTE SET_FUNCTION_ATTRIBUTE #define _SET_UPDATE SET_UPDATE -#define _SHUFFLE_3_LOAD_CONST_INLINE_BORROW 524 -#define _SPILL_OR_RELOAD 525 -#define _START_EXECUTOR 526 -#define _STORE_ATTR 527 -#define _STORE_ATTR_INSTANCE_VALUE 528 -#define _STORE_ATTR_SLOT 529 -#define _STORE_ATTR_WITH_HINT 530 +#define _SHUFFLE_2_LOAD_CONST_INLINE_BORROW 524 +#define _SHUFFLE_3_LOAD_CONST_INLINE_BORROW 525 +#define _SPILL_OR_RELOAD 526 +#define _START_EXECUTOR 527 +#define _STORE_ATTR 528 +#define _STORE_ATTR_INSTANCE_VALUE 529 +#define _STORE_ATTR_SLOT 530 +#define _STORE_ATTR_WITH_HINT 531 #define _STORE_DEREF STORE_DEREF -#define _STORE_FAST 531 -#define _STORE_FAST_0 532 -#define _STORE_FAST_1 533 -#define _STORE_FAST_2 534 -#define _STORE_FAST_3 535 -#define _STORE_FAST_4 536 -#define _STORE_FAST_5 537 -#define _STORE_FAST_6 538 -#define _STORE_FAST_7 539 +#define _STORE_FAST 532 +#define _STORE_FAST_0 533 +#define _STORE_FAST_1 534 +#define _STORE_FAST_2 535 +#define _STORE_FAST_3 536 +#define _STORE_FAST_4 537 +#define _STORE_FAST_5 538 +#define _STORE_FAST_6 539 +#define _STORE_FAST_7 540 #define _STORE_GLOBAL STORE_GLOBAL #define _STORE_NAME STORE_NAME -#define _STORE_SLICE 533 -#define _STORE_SUBSCR 534 -#define _STORE_SUBSCR_DICT 535 -#define _STORE_SUBSCR_LIST_INT 536 -#define _SWAP 537 -#define _SWAP_2 538 -#define _SWAP_3 539 -#define _SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW 540 -#define _TIER2_RESUME_CHECK 541 -#define _TO_BOOL 542 +#define _STORE_SLICE 541 +#define _STORE_SUBSCR 542 +#define _STORE_SUBSCR_DICT 543 +#define _STORE_SUBSCR_LIST_INT 544 +#define _SWAP 545 +#define _SWAP_2 546 +#define _SWAP_3 547 +#define _TIER2_RESUME_CHECK 548 +#define _TO_BOOL 549 #define _TO_BOOL_BOOL TO_BOOL_BOOL #define _TO_BOOL_INT TO_BOOL_INT -#define _TO_BOOL_LIST 543 +#define _TO_BOOL_LIST 550 #define _TO_BOOL_NONE TO_BOOL_NONE -#define _TO_BOOL_STR 544 +#define _TO_BOOL_STR 551 +#define _TRACE_RECORD TRACE_RECORD #define _UNARY_INVERT UNARY_INVERT #define _UNARY_NEGATIVE UNARY_NEGATIVE #define _UNARY_NOT UNARY_NOT #define _UNPACK_EX UNPACK_EX -#define _UNPACK_SEQUENCE 545 -#define _UNPACK_SEQUENCE_LIST 546 -#define _UNPACK_SEQUENCE_TUPLE 547 -#define _UNPACK_SEQUENCE_TWO_TUPLE 548 +#define _UNPACK_SEQUENCE 552 +#define _UNPACK_SEQUENCE_LIST 553 +#define _UNPACK_SEQUENCE_TUPLE 554 +#define _UNPACK_SEQUENCE_TWO_TUPLE 555 #define _WITH_EXCEPT_START WITH_EXCEPT_START #define _YIELD_VALUE YIELD_VALUE -#define MAX_UOP_ID 548 +#define MAX_UOP_ID 555 +#define _BINARY_OP_r21 556 +#define _BINARY_OP_ADD_FLOAT_r03 557 +#define _BINARY_OP_ADD_FLOAT_r13 558 +#define _BINARY_OP_ADD_FLOAT_r23 559 +#define _BINARY_OP_ADD_INT_r03 560 +#define _BINARY_OP_ADD_INT_r13 561 +#define _BINARY_OP_ADD_INT_r23 562 +#define _BINARY_OP_ADD_UNICODE_r03 563 +#define _BINARY_OP_ADD_UNICODE_r13 564 +#define _BINARY_OP_ADD_UNICODE_r23 565 +#define _BINARY_OP_EXTEND_r21 566 +#define _BINARY_OP_INPLACE_ADD_UNICODE_r20 567 +#define _BINARY_OP_MULTIPLY_FLOAT_r03 568 +#define _BINARY_OP_MULTIPLY_FLOAT_r13 569 +#define _BINARY_OP_MULTIPLY_FLOAT_r23 570 +#define _BINARY_OP_MULTIPLY_INT_r03 571 +#define _BINARY_OP_MULTIPLY_INT_r13 572 +#define _BINARY_OP_MULTIPLY_INT_r23 573 +#define _BINARY_OP_SUBSCR_CHECK_FUNC_r23 574 +#define _BINARY_OP_SUBSCR_DICT_r21 575 +#define _BINARY_OP_SUBSCR_INIT_CALL_r01 576 +#define _BINARY_OP_SUBSCR_INIT_CALL_r11 577 +#define _BINARY_OP_SUBSCR_INIT_CALL_r21 578 +#define _BINARY_OP_SUBSCR_INIT_CALL_r31 579 +#define _BINARY_OP_SUBSCR_LIST_INT_r23 580 +#define _BINARY_OP_SUBSCR_LIST_SLICE_r21 581 +#define _BINARY_OP_SUBSCR_STR_INT_r23 582 +#define _BINARY_OP_SUBSCR_TUPLE_INT_r21 583 +#define _BINARY_OP_SUBTRACT_FLOAT_r03 584 +#define _BINARY_OP_SUBTRACT_FLOAT_r13 585 +#define _BINARY_OP_SUBTRACT_FLOAT_r23 586 +#define _BINARY_OP_SUBTRACT_INT_r03 587 +#define _BINARY_OP_SUBTRACT_INT_r13 588 +#define _BINARY_OP_SUBTRACT_INT_r23 589 +#define _BINARY_SLICE_r31 590 +#define _BUILD_INTERPOLATION_r01 591 +#define _BUILD_LIST_r01 592 +#define _BUILD_MAP_r01 593 +#define _BUILD_SET_r01 594 +#define _BUILD_SLICE_r01 595 +#define _BUILD_STRING_r01 596 +#define _BUILD_TEMPLATE_r21 597 +#define _BUILD_TUPLE_r01 598 +#define _CALL_BUILTIN_CLASS_r01 599 +#define _CALL_BUILTIN_FAST_r01 600 +#define _CALL_BUILTIN_FAST_WITH_KEYWORDS_r01 601 +#define _CALL_BUILTIN_O_r03 602 +#define _CALL_INTRINSIC_1_r11 603 +#define _CALL_INTRINSIC_2_r21 604 +#define _CALL_ISINSTANCE_r31 605 +#define _CALL_KW_NON_PY_r11 606 +#define _CALL_LEN_r33 607 +#define _CALL_LIST_APPEND_r02 608 +#define _CALL_LIST_APPEND_r12 609 +#define _CALL_LIST_APPEND_r22 610 +#define _CALL_LIST_APPEND_r32 611 +#define _CALL_METHOD_DESCRIPTOR_FAST_r01 612 +#define _CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS_r01 613 +#define _CALL_METHOD_DESCRIPTOR_NOARGS_r01 614 +#define _CALL_METHOD_DESCRIPTOR_O_r01 615 +#define _CALL_NON_PY_GENERAL_r01 616 +#define _CALL_STR_1_r32 617 +#define _CALL_TUPLE_1_r32 618 +#define _CALL_TYPE_1_r02 619 +#define _CALL_TYPE_1_r12 620 +#define _CALL_TYPE_1_r22 621 +#define _CALL_TYPE_1_r32 622 +#define _CHECK_AND_ALLOCATE_OBJECT_r00 623 +#define _CHECK_ATTR_CLASS_r01 624 +#define _CHECK_ATTR_CLASS_r11 625 +#define _CHECK_ATTR_CLASS_r22 626 +#define _CHECK_ATTR_CLASS_r33 627 +#define _CHECK_ATTR_METHOD_LAZY_DICT_r01 628 +#define _CHECK_ATTR_METHOD_LAZY_DICT_r11 629 +#define _CHECK_ATTR_METHOD_LAZY_DICT_r22 630 +#define _CHECK_ATTR_METHOD_LAZY_DICT_r33 631 +#define _CHECK_CALL_BOUND_METHOD_EXACT_ARGS_r00 632 +#define _CHECK_EG_MATCH_r22 633 +#define _CHECK_EXC_MATCH_r22 634 +#define _CHECK_FUNCTION_EXACT_ARGS_r00 635 +#define _CHECK_FUNCTION_VERSION_r00 636 +#define _CHECK_FUNCTION_VERSION_INLINE_r00 637 +#define _CHECK_FUNCTION_VERSION_INLINE_r11 638 +#define _CHECK_FUNCTION_VERSION_INLINE_r22 639 +#define _CHECK_FUNCTION_VERSION_INLINE_r33 640 +#define _CHECK_FUNCTION_VERSION_KW_r11 641 +#define _CHECK_IS_NOT_PY_CALLABLE_r00 642 +#define _CHECK_IS_NOT_PY_CALLABLE_KW_r11 643 +#define _CHECK_MANAGED_OBJECT_HAS_VALUES_r01 644 +#define _CHECK_MANAGED_OBJECT_HAS_VALUES_r11 645 +#define _CHECK_MANAGED_OBJECT_HAS_VALUES_r22 646 +#define _CHECK_MANAGED_OBJECT_HAS_VALUES_r33 647 +#define _CHECK_METHOD_VERSION_r00 648 +#define _CHECK_METHOD_VERSION_KW_r11 649 +#define _CHECK_PEP_523_r00 650 +#define _CHECK_PEP_523_r11 651 +#define _CHECK_PEP_523_r22 652 +#define _CHECK_PEP_523_r33 653 +#define _CHECK_PERIODIC_r00 654 +#define _CHECK_PERIODIC_AT_END_r00 655 +#define _CHECK_PERIODIC_IF_NOT_YIELD_FROM_r00 656 +#define _CHECK_RECURSION_REMAINING_r00 657 +#define _CHECK_RECURSION_REMAINING_r11 658 +#define _CHECK_RECURSION_REMAINING_r22 659 +#define _CHECK_RECURSION_REMAINING_r33 660 +#define _CHECK_STACK_SPACE_r00 661 +#define _CHECK_STACK_SPACE_OPERAND_r00 662 +#define _CHECK_STACK_SPACE_OPERAND_r11 663 +#define _CHECK_STACK_SPACE_OPERAND_r22 664 +#define _CHECK_STACK_SPACE_OPERAND_r33 665 +#define _CHECK_VALIDITY_r00 666 +#define _CHECK_VALIDITY_r11 667 +#define _CHECK_VALIDITY_r22 668 +#define _CHECK_VALIDITY_r33 669 +#define _COLD_DYNAMIC_EXIT_r00 670 +#define _COLD_EXIT_r00 671 +#define _COMPARE_OP_r21 672 +#define _COMPARE_OP_FLOAT_r01 673 +#define _COMPARE_OP_FLOAT_r11 674 +#define _COMPARE_OP_FLOAT_r21 675 +#define _COMPARE_OP_FLOAT_r32 676 +#define _COMPARE_OP_INT_r23 677 +#define _COMPARE_OP_STR_r21 678 +#define _CONTAINS_OP_r21 679 +#define _CONTAINS_OP_DICT_r21 680 +#define _CONTAINS_OP_SET_r21 681 +#define _CONVERT_VALUE_r11 682 +#define _COPY_r01 683 +#define _COPY_1_r02 684 +#define _COPY_1_r12 685 +#define _COPY_1_r23 686 +#define _COPY_2_r03 687 +#define _COPY_2_r13 688 +#define _COPY_2_r23 689 +#define _COPY_3_r03 690 +#define _COPY_3_r13 691 +#define _COPY_3_r23 692 +#define _COPY_3_r33 693 +#define _COPY_FREE_VARS_r00 694 +#define _COPY_FREE_VARS_r11 695 +#define _COPY_FREE_VARS_r22 696 +#define _COPY_FREE_VARS_r33 697 +#define _CREATE_INIT_FRAME_r01 698 +#define _DELETE_ATTR_r10 699 +#define _DELETE_DEREF_r00 700 +#define _DELETE_FAST_r00 701 +#define _DELETE_GLOBAL_r00 702 +#define _DELETE_NAME_r00 703 +#define _DELETE_SUBSCR_r20 704 +#define _DEOPT_r00 705 +#define _DEOPT_r10 706 +#define _DEOPT_r20 707 +#define _DEOPT_r30 708 +#define _DICT_MERGE_r10 709 +#define _DICT_UPDATE_r10 710 +#define _DO_CALL_r01 711 +#define _DO_CALL_FUNCTION_EX_r31 712 +#define _DO_CALL_KW_r11 713 +#define _DYNAMIC_EXIT_r00 714 +#define _DYNAMIC_EXIT_r10 715 +#define _DYNAMIC_EXIT_r20 716 +#define _DYNAMIC_EXIT_r30 717 +#define _END_FOR_r10 718 +#define _END_SEND_r21 719 +#define _ERROR_POP_N_r00 720 +#define _EXIT_INIT_CHECK_r10 721 +#define _EXIT_TRACE_r00 722 +#define _EXIT_TRACE_r10 723 +#define _EXIT_TRACE_r20 724 +#define _EXIT_TRACE_r30 725 +#define _EXPAND_METHOD_r00 726 +#define _EXPAND_METHOD_KW_r11 727 +#define _FATAL_ERROR_r00 728 +#define _FATAL_ERROR_r11 729 +#define _FATAL_ERROR_r22 730 +#define _FATAL_ERROR_r33 731 +#define _FORMAT_SIMPLE_r11 732 +#define _FORMAT_WITH_SPEC_r21 733 +#define _FOR_ITER_r23 734 +#define _FOR_ITER_GEN_FRAME_r03 735 +#define _FOR_ITER_GEN_FRAME_r13 736 +#define _FOR_ITER_GEN_FRAME_r23 737 +#define _FOR_ITER_TIER_TWO_r23 738 +#define _GET_AITER_r11 739 +#define _GET_ANEXT_r12 740 +#define _GET_AWAITABLE_r11 741 +#define _GET_ITER_r12 742 +#define _GET_LEN_r12 743 +#define _GET_YIELD_FROM_ITER_r11 744 +#define _GUARD_BINARY_OP_EXTEND_r22 745 +#define _GUARD_CALLABLE_ISINSTANCE_r03 746 +#define _GUARD_CALLABLE_ISINSTANCE_r13 747 +#define _GUARD_CALLABLE_ISINSTANCE_r23 748 +#define _GUARD_CALLABLE_ISINSTANCE_r33 749 +#define _GUARD_CALLABLE_LEN_r03 750 +#define _GUARD_CALLABLE_LEN_r13 751 +#define _GUARD_CALLABLE_LEN_r23 752 +#define _GUARD_CALLABLE_LEN_r33 753 +#define _GUARD_CALLABLE_LIST_APPEND_r03 754 +#define _GUARD_CALLABLE_LIST_APPEND_r13 755 +#define _GUARD_CALLABLE_LIST_APPEND_r23 756 +#define _GUARD_CALLABLE_LIST_APPEND_r33 757 +#define _GUARD_CALLABLE_STR_1_r03 758 +#define _GUARD_CALLABLE_STR_1_r13 759 +#define _GUARD_CALLABLE_STR_1_r23 760 +#define _GUARD_CALLABLE_STR_1_r33 761 +#define _GUARD_CALLABLE_TUPLE_1_r03 762 +#define _GUARD_CALLABLE_TUPLE_1_r13 763 +#define _GUARD_CALLABLE_TUPLE_1_r23 764 +#define _GUARD_CALLABLE_TUPLE_1_r33 765 +#define _GUARD_CALLABLE_TYPE_1_r03 766 +#define _GUARD_CALLABLE_TYPE_1_r13 767 +#define _GUARD_CALLABLE_TYPE_1_r23 768 +#define _GUARD_CALLABLE_TYPE_1_r33 769 +#define _GUARD_DORV_NO_DICT_r01 770 +#define _GUARD_DORV_NO_DICT_r11 771 +#define _GUARD_DORV_NO_DICT_r22 772 +#define _GUARD_DORV_NO_DICT_r33 773 +#define _GUARD_DORV_VALUES_INST_ATTR_FROM_DICT_r01 774 +#define _GUARD_DORV_VALUES_INST_ATTR_FROM_DICT_r11 775 +#define _GUARD_DORV_VALUES_INST_ATTR_FROM_DICT_r22 776 +#define _GUARD_DORV_VALUES_INST_ATTR_FROM_DICT_r33 777 +#define _GUARD_GLOBALS_VERSION_r00 778 +#define _GUARD_GLOBALS_VERSION_r11 779 +#define _GUARD_GLOBALS_VERSION_r22 780 +#define _GUARD_GLOBALS_VERSION_r33 781 +#define _GUARD_IP_RETURN_GENERATOR_r00 782 +#define _GUARD_IP_RETURN_GENERATOR_r11 783 +#define _GUARD_IP_RETURN_GENERATOR_r22 784 +#define _GUARD_IP_RETURN_GENERATOR_r33 785 +#define _GUARD_IP_RETURN_VALUE_r00 786 +#define _GUARD_IP_RETURN_VALUE_r11 787 +#define _GUARD_IP_RETURN_VALUE_r22 788 +#define _GUARD_IP_RETURN_VALUE_r33 789 +#define _GUARD_IP_YIELD_VALUE_r00 790 +#define _GUARD_IP_YIELD_VALUE_r11 791 +#define _GUARD_IP_YIELD_VALUE_r22 792 +#define _GUARD_IP_YIELD_VALUE_r33 793 +#define _GUARD_IP__PUSH_FRAME_r00 794 +#define _GUARD_IP__PUSH_FRAME_r11 795 +#define _GUARD_IP__PUSH_FRAME_r22 796 +#define _GUARD_IP__PUSH_FRAME_r33 797 +#define _GUARD_IS_FALSE_POP_r00 798 +#define _GUARD_IS_FALSE_POP_r10 799 +#define _GUARD_IS_FALSE_POP_r21 800 +#define _GUARD_IS_FALSE_POP_r32 801 +#define _GUARD_IS_NONE_POP_r00 802 +#define _GUARD_IS_NONE_POP_r10 803 +#define _GUARD_IS_NONE_POP_r21 804 +#define _GUARD_IS_NONE_POP_r32 805 +#define _GUARD_IS_NOT_NONE_POP_r10 806 +#define _GUARD_IS_TRUE_POP_r00 807 +#define _GUARD_IS_TRUE_POP_r10 808 +#define _GUARD_IS_TRUE_POP_r21 809 +#define _GUARD_IS_TRUE_POP_r32 810 +#define _GUARD_KEYS_VERSION_r01 811 +#define _GUARD_KEYS_VERSION_r11 812 +#define _GUARD_KEYS_VERSION_r22 813 +#define _GUARD_KEYS_VERSION_r33 814 +#define _GUARD_NOS_DICT_r02 815 +#define _GUARD_NOS_DICT_r12 816 +#define _GUARD_NOS_DICT_r22 817 +#define _GUARD_NOS_DICT_r33 818 +#define _GUARD_NOS_FLOAT_r02 819 +#define _GUARD_NOS_FLOAT_r12 820 +#define _GUARD_NOS_FLOAT_r22 821 +#define _GUARD_NOS_FLOAT_r33 822 +#define _GUARD_NOS_INT_r02 823 +#define _GUARD_NOS_INT_r12 824 +#define _GUARD_NOS_INT_r22 825 +#define _GUARD_NOS_INT_r33 826 +#define _GUARD_NOS_LIST_r02 827 +#define _GUARD_NOS_LIST_r12 828 +#define _GUARD_NOS_LIST_r22 829 +#define _GUARD_NOS_LIST_r33 830 +#define _GUARD_NOS_NOT_NULL_r02 831 +#define _GUARD_NOS_NOT_NULL_r12 832 +#define _GUARD_NOS_NOT_NULL_r22 833 +#define _GUARD_NOS_NOT_NULL_r33 834 +#define _GUARD_NOS_NULL_r02 835 +#define _GUARD_NOS_NULL_r12 836 +#define _GUARD_NOS_NULL_r22 837 +#define _GUARD_NOS_NULL_r33 838 +#define _GUARD_NOS_OVERFLOWED_r02 839 +#define _GUARD_NOS_OVERFLOWED_r12 840 +#define _GUARD_NOS_OVERFLOWED_r22 841 +#define _GUARD_NOS_OVERFLOWED_r33 842 +#define _GUARD_NOS_TUPLE_r02 843 +#define _GUARD_NOS_TUPLE_r12 844 +#define _GUARD_NOS_TUPLE_r22 845 +#define _GUARD_NOS_TUPLE_r33 846 +#define _GUARD_NOS_UNICODE_r02 847 +#define _GUARD_NOS_UNICODE_r12 848 +#define _GUARD_NOS_UNICODE_r22 849 +#define _GUARD_NOS_UNICODE_r33 850 +#define _GUARD_NOT_EXHAUSTED_LIST_r02 851 +#define _GUARD_NOT_EXHAUSTED_LIST_r12 852 +#define _GUARD_NOT_EXHAUSTED_LIST_r22 853 +#define _GUARD_NOT_EXHAUSTED_LIST_r33 854 +#define _GUARD_NOT_EXHAUSTED_RANGE_r02 855 +#define _GUARD_NOT_EXHAUSTED_RANGE_r12 856 +#define _GUARD_NOT_EXHAUSTED_RANGE_r22 857 +#define _GUARD_NOT_EXHAUSTED_RANGE_r33 858 +#define _GUARD_NOT_EXHAUSTED_TUPLE_r02 859 +#define _GUARD_NOT_EXHAUSTED_TUPLE_r12 860 +#define _GUARD_NOT_EXHAUSTED_TUPLE_r22 861 +#define _GUARD_NOT_EXHAUSTED_TUPLE_r33 862 +#define _GUARD_THIRD_NULL_r03 863 +#define _GUARD_THIRD_NULL_r13 864 +#define _GUARD_THIRD_NULL_r23 865 +#define _GUARD_THIRD_NULL_r33 866 +#define _GUARD_TOS_ANY_SET_r01 867 +#define _GUARD_TOS_ANY_SET_r11 868 +#define _GUARD_TOS_ANY_SET_r22 869 +#define _GUARD_TOS_ANY_SET_r33 870 +#define _GUARD_TOS_DICT_r01 871 +#define _GUARD_TOS_DICT_r11 872 +#define _GUARD_TOS_DICT_r22 873 +#define _GUARD_TOS_DICT_r33 874 +#define _GUARD_TOS_FLOAT_r01 875 +#define _GUARD_TOS_FLOAT_r11 876 +#define _GUARD_TOS_FLOAT_r22 877 +#define _GUARD_TOS_FLOAT_r33 878 +#define _GUARD_TOS_INT_r01 879 +#define _GUARD_TOS_INT_r11 880 +#define _GUARD_TOS_INT_r22 881 +#define _GUARD_TOS_INT_r33 882 +#define _GUARD_TOS_LIST_r01 883 +#define _GUARD_TOS_LIST_r11 884 +#define _GUARD_TOS_LIST_r22 885 +#define _GUARD_TOS_LIST_r33 886 +#define _GUARD_TOS_OVERFLOWED_r01 887 +#define _GUARD_TOS_OVERFLOWED_r11 888 +#define _GUARD_TOS_OVERFLOWED_r22 889 +#define _GUARD_TOS_OVERFLOWED_r33 890 +#define _GUARD_TOS_SLICE_r01 891 +#define _GUARD_TOS_SLICE_r11 892 +#define _GUARD_TOS_SLICE_r22 893 +#define _GUARD_TOS_SLICE_r33 894 +#define _GUARD_TOS_TUPLE_r01 895 +#define _GUARD_TOS_TUPLE_r11 896 +#define _GUARD_TOS_TUPLE_r22 897 +#define _GUARD_TOS_TUPLE_r33 898 +#define _GUARD_TOS_UNICODE_r01 899 +#define _GUARD_TOS_UNICODE_r11 900 +#define _GUARD_TOS_UNICODE_r22 901 +#define _GUARD_TOS_UNICODE_r33 902 +#define _GUARD_TYPE_VERSION_r01 903 +#define _GUARD_TYPE_VERSION_r11 904 +#define _GUARD_TYPE_VERSION_r22 905 +#define _GUARD_TYPE_VERSION_r33 906 +#define _GUARD_TYPE_VERSION_AND_LOCK_r01 907 +#define _GUARD_TYPE_VERSION_AND_LOCK_r11 908 +#define _GUARD_TYPE_VERSION_AND_LOCK_r22 909 +#define _GUARD_TYPE_VERSION_AND_LOCK_r33 910 +#define _HANDLE_PENDING_AND_DEOPT_r00 911 +#define _HANDLE_PENDING_AND_DEOPT_r10 912 +#define _HANDLE_PENDING_AND_DEOPT_r20 913 +#define _HANDLE_PENDING_AND_DEOPT_r30 914 +#define _IMPORT_FROM_r12 915 +#define _IMPORT_NAME_r21 916 +#define _INIT_CALL_BOUND_METHOD_EXACT_ARGS_r00 917 +#define _INIT_CALL_PY_EXACT_ARGS_r01 918 +#define _INIT_CALL_PY_EXACT_ARGS_0_r01 919 +#define _INIT_CALL_PY_EXACT_ARGS_1_r01 920 +#define _INIT_CALL_PY_EXACT_ARGS_2_r01 921 +#define _INIT_CALL_PY_EXACT_ARGS_3_r01 922 +#define _INIT_CALL_PY_EXACT_ARGS_4_r01 923 +#define _INSERT_NULL_r10 924 +#define _INSTRUMENTED_FOR_ITER_r23 925 +#define _INSTRUMENTED_INSTRUCTION_r00 926 +#define _INSTRUMENTED_JUMP_FORWARD_r00 927 +#define _INSTRUMENTED_JUMP_FORWARD_r11 928 +#define _INSTRUMENTED_JUMP_FORWARD_r22 929 +#define _INSTRUMENTED_JUMP_FORWARD_r33 930 +#define _INSTRUMENTED_LINE_r00 931 +#define _INSTRUMENTED_NOT_TAKEN_r00 932 +#define _INSTRUMENTED_NOT_TAKEN_r11 933 +#define _INSTRUMENTED_NOT_TAKEN_r22 934 +#define _INSTRUMENTED_NOT_TAKEN_r33 935 +#define _INSTRUMENTED_POP_JUMP_IF_FALSE_r00 936 +#define _INSTRUMENTED_POP_JUMP_IF_FALSE_r10 937 +#define _INSTRUMENTED_POP_JUMP_IF_FALSE_r21 938 +#define _INSTRUMENTED_POP_JUMP_IF_FALSE_r32 939 +#define _INSTRUMENTED_POP_JUMP_IF_NONE_r10 940 +#define _INSTRUMENTED_POP_JUMP_IF_NOT_NONE_r10 941 +#define _INSTRUMENTED_POP_JUMP_IF_TRUE_r00 942 +#define _INSTRUMENTED_POP_JUMP_IF_TRUE_r10 943 +#define _INSTRUMENTED_POP_JUMP_IF_TRUE_r21 944 +#define _INSTRUMENTED_POP_JUMP_IF_TRUE_r32 945 +#define _IS_NONE_r11 946 +#define _IS_OP_r21 947 +#define _ITER_CHECK_LIST_r02 948 +#define _ITER_CHECK_LIST_r12 949 +#define _ITER_CHECK_LIST_r22 950 +#define _ITER_CHECK_LIST_r33 951 +#define _ITER_CHECK_RANGE_r02 952 +#define _ITER_CHECK_RANGE_r12 953 +#define _ITER_CHECK_RANGE_r22 954 +#define _ITER_CHECK_RANGE_r33 955 +#define _ITER_CHECK_TUPLE_r02 956 +#define _ITER_CHECK_TUPLE_r12 957 +#define _ITER_CHECK_TUPLE_r22 958 +#define _ITER_CHECK_TUPLE_r33 959 +#define _ITER_JUMP_LIST_r02 960 +#define _ITER_JUMP_LIST_r12 961 +#define _ITER_JUMP_LIST_r22 962 +#define _ITER_JUMP_LIST_r33 963 +#define _ITER_JUMP_RANGE_r02 964 +#define _ITER_JUMP_RANGE_r12 965 +#define _ITER_JUMP_RANGE_r22 966 +#define _ITER_JUMP_RANGE_r33 967 +#define _ITER_JUMP_TUPLE_r02 968 +#define _ITER_JUMP_TUPLE_r12 969 +#define _ITER_JUMP_TUPLE_r22 970 +#define _ITER_JUMP_TUPLE_r33 971 +#define _ITER_NEXT_LIST_r23 972 +#define _ITER_NEXT_LIST_TIER_TWO_r23 973 +#define _ITER_NEXT_RANGE_r03 974 +#define _ITER_NEXT_RANGE_r13 975 +#define _ITER_NEXT_RANGE_r23 976 +#define _ITER_NEXT_TUPLE_r03 977 +#define _ITER_NEXT_TUPLE_r13 978 +#define _ITER_NEXT_TUPLE_r23 979 +#define _JUMP_BACKWARD_NO_INTERRUPT_r00 980 +#define _JUMP_BACKWARD_NO_INTERRUPT_r11 981 +#define _JUMP_BACKWARD_NO_INTERRUPT_r22 982 +#define _JUMP_BACKWARD_NO_INTERRUPT_r33 983 +#define _JUMP_TO_TOP_r00 984 +#define _LIST_APPEND_r10 985 +#define _LIST_EXTEND_r10 986 +#define _LOAD_ATTR_r10 987 +#define _LOAD_ATTR_CLASS_r11 988 +#define _LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN_r11 989 +#define _LOAD_ATTR_INSTANCE_VALUE_r02 990 +#define _LOAD_ATTR_INSTANCE_VALUE_r12 991 +#define _LOAD_ATTR_INSTANCE_VALUE_r23 992 +#define _LOAD_ATTR_METHOD_LAZY_DICT_r02 993 +#define _LOAD_ATTR_METHOD_LAZY_DICT_r12 994 +#define _LOAD_ATTR_METHOD_LAZY_DICT_r23 995 +#define _LOAD_ATTR_METHOD_NO_DICT_r02 996 +#define _LOAD_ATTR_METHOD_NO_DICT_r12 997 +#define _LOAD_ATTR_METHOD_NO_DICT_r23 998 +#define _LOAD_ATTR_METHOD_WITH_VALUES_r02 999 +#define _LOAD_ATTR_METHOD_WITH_VALUES_r12 1000 +#define _LOAD_ATTR_METHOD_WITH_VALUES_r23 1001 +#define _LOAD_ATTR_MODULE_r11 1002 +#define _LOAD_ATTR_NONDESCRIPTOR_NO_DICT_r11 1003 +#define _LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES_r11 1004 +#define _LOAD_ATTR_PROPERTY_FRAME_r11 1005 +#define _LOAD_ATTR_SLOT_r11 1006 +#define _LOAD_ATTR_WITH_HINT_r11 1007 +#define _LOAD_BUILD_CLASS_r01 1008 +#define _LOAD_BYTECODE_r00 1009 +#define _LOAD_COMMON_CONSTANT_r01 1010 +#define _LOAD_COMMON_CONSTANT_r12 1011 +#define _LOAD_COMMON_CONSTANT_r23 1012 +#define _LOAD_CONST_r01 1013 +#define _LOAD_CONST_r12 1014 +#define _LOAD_CONST_r23 1015 +#define _LOAD_CONST_INLINE_r01 1016 +#define _LOAD_CONST_INLINE_r12 1017 +#define _LOAD_CONST_INLINE_r23 1018 +#define _LOAD_CONST_INLINE_BORROW_r01 1019 +#define _LOAD_CONST_INLINE_BORROW_r12 1020 +#define _LOAD_CONST_INLINE_BORROW_r23 1021 +#define _LOAD_CONST_UNDER_INLINE_r02 1022 +#define _LOAD_CONST_UNDER_INLINE_r12 1023 +#define _LOAD_CONST_UNDER_INLINE_r23 1024 +#define _LOAD_CONST_UNDER_INLINE_BORROW_r02 1025 +#define _LOAD_CONST_UNDER_INLINE_BORROW_r12 1026 +#define _LOAD_CONST_UNDER_INLINE_BORROW_r23 1027 +#define _LOAD_DEREF_r01 1028 +#define _LOAD_FAST_r01 1029 +#define _LOAD_FAST_r12 1030 +#define _LOAD_FAST_r23 1031 +#define _LOAD_FAST_0_r01 1032 +#define _LOAD_FAST_0_r12 1033 +#define _LOAD_FAST_0_r23 1034 +#define _LOAD_FAST_1_r01 1035 +#define _LOAD_FAST_1_r12 1036 +#define _LOAD_FAST_1_r23 1037 +#define _LOAD_FAST_2_r01 1038 +#define _LOAD_FAST_2_r12 1039 +#define _LOAD_FAST_2_r23 1040 +#define _LOAD_FAST_3_r01 1041 +#define _LOAD_FAST_3_r12 1042 +#define _LOAD_FAST_3_r23 1043 +#define _LOAD_FAST_4_r01 1044 +#define _LOAD_FAST_4_r12 1045 +#define _LOAD_FAST_4_r23 1046 +#define _LOAD_FAST_5_r01 1047 +#define _LOAD_FAST_5_r12 1048 +#define _LOAD_FAST_5_r23 1049 +#define _LOAD_FAST_6_r01 1050 +#define _LOAD_FAST_6_r12 1051 +#define _LOAD_FAST_6_r23 1052 +#define _LOAD_FAST_7_r01 1053 +#define _LOAD_FAST_7_r12 1054 +#define _LOAD_FAST_7_r23 1055 +#define _LOAD_FAST_AND_CLEAR_r01 1056 +#define _LOAD_FAST_AND_CLEAR_r12 1057 +#define _LOAD_FAST_AND_CLEAR_r23 1058 +#define _LOAD_FAST_BORROW_r01 1059 +#define _LOAD_FAST_BORROW_r12 1060 +#define _LOAD_FAST_BORROW_r23 1061 +#define _LOAD_FAST_BORROW_0_r01 1062 +#define _LOAD_FAST_BORROW_0_r12 1063 +#define _LOAD_FAST_BORROW_0_r23 1064 +#define _LOAD_FAST_BORROW_1_r01 1065 +#define _LOAD_FAST_BORROW_1_r12 1066 +#define _LOAD_FAST_BORROW_1_r23 1067 +#define _LOAD_FAST_BORROW_2_r01 1068 +#define _LOAD_FAST_BORROW_2_r12 1069 +#define _LOAD_FAST_BORROW_2_r23 1070 +#define _LOAD_FAST_BORROW_3_r01 1071 +#define _LOAD_FAST_BORROW_3_r12 1072 +#define _LOAD_FAST_BORROW_3_r23 1073 +#define _LOAD_FAST_BORROW_4_r01 1074 +#define _LOAD_FAST_BORROW_4_r12 1075 +#define _LOAD_FAST_BORROW_4_r23 1076 +#define _LOAD_FAST_BORROW_5_r01 1077 +#define _LOAD_FAST_BORROW_5_r12 1078 +#define _LOAD_FAST_BORROW_5_r23 1079 +#define _LOAD_FAST_BORROW_6_r01 1080 +#define _LOAD_FAST_BORROW_6_r12 1081 +#define _LOAD_FAST_BORROW_6_r23 1082 +#define _LOAD_FAST_BORROW_7_r01 1083 +#define _LOAD_FAST_BORROW_7_r12 1084 +#define _LOAD_FAST_BORROW_7_r23 1085 +#define _LOAD_FAST_BORROW_LOAD_FAST_BORROW_r02 1086 +#define _LOAD_FAST_BORROW_LOAD_FAST_BORROW_r13 1087 +#define _LOAD_FAST_CHECK_r01 1088 +#define _LOAD_FAST_CHECK_r12 1089 +#define _LOAD_FAST_CHECK_r23 1090 +#define _LOAD_FAST_LOAD_FAST_r02 1091 +#define _LOAD_FAST_LOAD_FAST_r13 1092 +#define _LOAD_FROM_DICT_OR_DEREF_r11 1093 +#define _LOAD_FROM_DICT_OR_GLOBALS_r11 1094 +#define _LOAD_GLOBAL_r00 1095 +#define _LOAD_GLOBAL_BUILTINS_r01 1096 +#define _LOAD_GLOBAL_MODULE_r01 1097 +#define _LOAD_LOCALS_r01 1098 +#define _LOAD_LOCALS_r12 1099 +#define _LOAD_LOCALS_r23 1100 +#define _LOAD_NAME_r01 1101 +#define _LOAD_SMALL_INT_r01 1102 +#define _LOAD_SMALL_INT_r12 1103 +#define _LOAD_SMALL_INT_r23 1104 +#define _LOAD_SMALL_INT_0_r01 1105 +#define _LOAD_SMALL_INT_0_r12 1106 +#define _LOAD_SMALL_INT_0_r23 1107 +#define _LOAD_SMALL_INT_1_r01 1108 +#define _LOAD_SMALL_INT_1_r12 1109 +#define _LOAD_SMALL_INT_1_r23 1110 +#define _LOAD_SMALL_INT_2_r01 1111 +#define _LOAD_SMALL_INT_2_r12 1112 +#define _LOAD_SMALL_INT_2_r23 1113 +#define _LOAD_SMALL_INT_3_r01 1114 +#define _LOAD_SMALL_INT_3_r12 1115 +#define _LOAD_SMALL_INT_3_r23 1116 +#define _LOAD_SPECIAL_r00 1117 +#define _LOAD_SUPER_ATTR_ATTR_r31 1118 +#define _LOAD_SUPER_ATTR_METHOD_r32 1119 +#define _MAKE_CALLARGS_A_TUPLE_r33 1120 +#define _MAKE_CELL_r00 1121 +#define _MAKE_FUNCTION_r11 1122 +#define _MAKE_WARM_r00 1123 +#define _MAKE_WARM_r11 1124 +#define _MAKE_WARM_r22 1125 +#define _MAKE_WARM_r33 1126 +#define _MAP_ADD_r20 1127 +#define _MATCH_CLASS_r31 1128 +#define _MATCH_KEYS_r23 1129 +#define _MATCH_MAPPING_r02 1130 +#define _MATCH_MAPPING_r12 1131 +#define _MATCH_MAPPING_r23 1132 +#define _MATCH_SEQUENCE_r02 1133 +#define _MATCH_SEQUENCE_r12 1134 +#define _MATCH_SEQUENCE_r23 1135 +#define _MAYBE_EXPAND_METHOD_r00 1136 +#define _MAYBE_EXPAND_METHOD_KW_r11 1137 +#define _MONITOR_CALL_r00 1138 +#define _MONITOR_CALL_KW_r11 1139 +#define _MONITOR_JUMP_BACKWARD_r00 1140 +#define _MONITOR_JUMP_BACKWARD_r11 1141 +#define _MONITOR_JUMP_BACKWARD_r22 1142 +#define _MONITOR_JUMP_BACKWARD_r33 1143 +#define _MONITOR_RESUME_r00 1144 +#define _NOP_r00 1145 +#define _NOP_r11 1146 +#define _NOP_r22 1147 +#define _NOP_r33 1148 +#define _POP_CALL_r20 1149 +#define _POP_CALL_LOAD_CONST_INLINE_BORROW_r21 1150 +#define _POP_CALL_ONE_r30 1151 +#define _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW_r31 1152 +#define _POP_CALL_TWO_r30 1153 +#define _POP_CALL_TWO_LOAD_CONST_INLINE_BORROW_r31 1154 +#define _POP_EXCEPT_r10 1155 +#define _POP_ITER_r20 1156 +#define _POP_JUMP_IF_FALSE_r00 1157 +#define _POP_JUMP_IF_FALSE_r10 1158 +#define _POP_JUMP_IF_FALSE_r21 1159 +#define _POP_JUMP_IF_FALSE_r32 1160 +#define _POP_JUMP_IF_TRUE_r00 1161 +#define _POP_JUMP_IF_TRUE_r10 1162 +#define _POP_JUMP_IF_TRUE_r21 1163 +#define _POP_JUMP_IF_TRUE_r32 1164 +#define _POP_TOP_r10 1165 +#define _POP_TOP_FLOAT_r00 1166 +#define _POP_TOP_FLOAT_r10 1167 +#define _POP_TOP_FLOAT_r21 1168 +#define _POP_TOP_FLOAT_r32 1169 +#define _POP_TOP_INT_r00 1170 +#define _POP_TOP_INT_r10 1171 +#define _POP_TOP_INT_r21 1172 +#define _POP_TOP_INT_r32 1173 +#define _POP_TOP_LOAD_CONST_INLINE_r11 1174 +#define _POP_TOP_LOAD_CONST_INLINE_BORROW_r11 1175 +#define _POP_TOP_NOP_r00 1176 +#define _POP_TOP_NOP_r10 1177 +#define _POP_TOP_NOP_r21 1178 +#define _POP_TOP_NOP_r32 1179 +#define _POP_TOP_UNICODE_r00 1180 +#define _POP_TOP_UNICODE_r10 1181 +#define _POP_TOP_UNICODE_r21 1182 +#define _POP_TOP_UNICODE_r32 1183 +#define _POP_TWO_r20 1184 +#define _POP_TWO_LOAD_CONST_INLINE_BORROW_r21 1185 +#define _PUSH_EXC_INFO_r02 1186 +#define _PUSH_EXC_INFO_r12 1187 +#define _PUSH_EXC_INFO_r23 1188 +#define _PUSH_FRAME_r10 1189 +#define _PUSH_NULL_r01 1190 +#define _PUSH_NULL_r12 1191 +#define _PUSH_NULL_r23 1192 +#define _PUSH_NULL_CONDITIONAL_r00 1193 +#define _PY_FRAME_GENERAL_r01 1194 +#define _PY_FRAME_KW_r11 1195 +#define _QUICKEN_RESUME_r00 1196 +#define _QUICKEN_RESUME_r11 1197 +#define _QUICKEN_RESUME_r22 1198 +#define _QUICKEN_RESUME_r33 1199 +#define _REPLACE_WITH_TRUE_r11 1200 +#define _RESUME_CHECK_r00 1201 +#define _RESUME_CHECK_r11 1202 +#define _RESUME_CHECK_r22 1203 +#define _RESUME_CHECK_r33 1204 +#define _RETURN_GENERATOR_r01 1205 +#define _RETURN_VALUE_r11 1206 +#define _SAVE_RETURN_OFFSET_r00 1207 +#define _SAVE_RETURN_OFFSET_r11 1208 +#define _SAVE_RETURN_OFFSET_r22 1209 +#define _SAVE_RETURN_OFFSET_r33 1210 +#define _SEND_r22 1211 +#define _SEND_GEN_FRAME_r22 1212 +#define _SETUP_ANNOTATIONS_r00 1213 +#define _SET_ADD_r10 1214 +#define _SET_FUNCTION_ATTRIBUTE_r01 1215 +#define _SET_FUNCTION_ATTRIBUTE_r11 1216 +#define _SET_FUNCTION_ATTRIBUTE_r21 1217 +#define _SET_FUNCTION_ATTRIBUTE_r32 1218 +#define _SET_IP_r00 1219 +#define _SET_IP_r11 1220 +#define _SET_IP_r22 1221 +#define _SET_IP_r33 1222 +#define _SET_UPDATE_r10 1223 +#define _SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r02 1224 +#define _SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r12 1225 +#define _SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r22 1226 +#define _SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r32 1227 +#define _SHUFFLE_3_LOAD_CONST_INLINE_BORROW_r03 1228 +#define _SHUFFLE_3_LOAD_CONST_INLINE_BORROW_r13 1229 +#define _SHUFFLE_3_LOAD_CONST_INLINE_BORROW_r23 1230 +#define _SHUFFLE_3_LOAD_CONST_INLINE_BORROW_r33 1231 +#define _SPILL_OR_RELOAD_r01 1232 +#define _SPILL_OR_RELOAD_r02 1233 +#define _SPILL_OR_RELOAD_r03 1234 +#define _SPILL_OR_RELOAD_r10 1235 +#define _SPILL_OR_RELOAD_r12 1236 +#define _SPILL_OR_RELOAD_r13 1237 +#define _SPILL_OR_RELOAD_r20 1238 +#define _SPILL_OR_RELOAD_r21 1239 +#define _SPILL_OR_RELOAD_r23 1240 +#define _SPILL_OR_RELOAD_r30 1241 +#define _SPILL_OR_RELOAD_r31 1242 +#define _SPILL_OR_RELOAD_r32 1243 +#define _START_EXECUTOR_r00 1244 +#define _STORE_ATTR_r20 1245 +#define _STORE_ATTR_INSTANCE_VALUE_r21 1246 +#define _STORE_ATTR_SLOT_r21 1247 +#define _STORE_ATTR_WITH_HINT_r21 1248 +#define _STORE_DEREF_r10 1249 +#define _STORE_FAST_r10 1250 +#define _STORE_FAST_0_r10 1251 +#define _STORE_FAST_1_r10 1252 +#define _STORE_FAST_2_r10 1253 +#define _STORE_FAST_3_r10 1254 +#define _STORE_FAST_4_r10 1255 +#define _STORE_FAST_5_r10 1256 +#define _STORE_FAST_6_r10 1257 +#define _STORE_FAST_7_r10 1258 +#define _STORE_FAST_LOAD_FAST_r11 1259 +#define _STORE_FAST_STORE_FAST_r20 1260 +#define _STORE_GLOBAL_r10 1261 +#define _STORE_NAME_r10 1262 +#define _STORE_SLICE_r30 1263 +#define _STORE_SUBSCR_r30 1264 +#define _STORE_SUBSCR_DICT_r31 1265 +#define _STORE_SUBSCR_LIST_INT_r32 1266 +#define _SWAP_r11 1267 +#define _SWAP_2_r02 1268 +#define _SWAP_2_r12 1269 +#define _SWAP_2_r22 1270 +#define _SWAP_2_r33 1271 +#define _SWAP_3_r03 1272 +#define _SWAP_3_r13 1273 +#define _SWAP_3_r23 1274 +#define _SWAP_3_r33 1275 +#define _TIER2_RESUME_CHECK_r00 1276 +#define _TIER2_RESUME_CHECK_r11 1277 +#define _TIER2_RESUME_CHECK_r22 1278 +#define _TIER2_RESUME_CHECK_r33 1279 +#define _TO_BOOL_r11 1280 +#define _TO_BOOL_BOOL_r01 1281 +#define _TO_BOOL_BOOL_r11 1282 +#define _TO_BOOL_BOOL_r22 1283 +#define _TO_BOOL_BOOL_r33 1284 +#define _TO_BOOL_INT_r11 1285 +#define _TO_BOOL_LIST_r11 1286 +#define _TO_BOOL_NONE_r01 1287 +#define _TO_BOOL_NONE_r11 1288 +#define _TO_BOOL_NONE_r22 1289 +#define _TO_BOOL_NONE_r33 1290 +#define _TO_BOOL_STR_r11 1291 +#define _TRACE_RECORD_r00 1292 +#define _UNARY_INVERT_r11 1293 +#define _UNARY_NEGATIVE_r11 1294 +#define _UNARY_NOT_r01 1295 +#define _UNARY_NOT_r11 1296 +#define _UNARY_NOT_r22 1297 +#define _UNARY_NOT_r33 1298 +#define _UNPACK_EX_r10 1299 +#define _UNPACK_SEQUENCE_r10 1300 +#define _UNPACK_SEQUENCE_LIST_r10 1301 +#define _UNPACK_SEQUENCE_TUPLE_r10 1302 +#define _UNPACK_SEQUENCE_TWO_TUPLE_r12 1303 +#define _WITH_EXCEPT_START_r33 1304 +#define _YIELD_VALUE_r11 1305 +#define MAX_UOP_REGS_ID 1305 #ifdef __cplusplus } diff --git a/Include/internal/pycore_uop_metadata.h b/Include/internal/pycore_uop_metadata.h index 21afd651c31a14..1078a11d55f919 100644 --- a/Include/internal/pycore_uop_metadata.h +++ b/Include/internal/pycore_uop_metadata.h @@ -335,9 +335,9 @@ const uint32_t _PyUop_Flags[MAX_UOP_ID+1] = { [_POP_TWO_LOAD_CONST_INLINE_BORROW] = HAS_ESCAPES_FLAG, [_POP_CALL_LOAD_CONST_INLINE_BORROW] = HAS_ESCAPES_FLAG, [_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW] = HAS_ESCAPES_FLAG, + [_SHUFFLE_2_LOAD_CONST_INLINE_BORROW] = 0, [_SHUFFLE_3_LOAD_CONST_INLINE_BORROW] = 0, [_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW] = HAS_ESCAPES_FLAG, - [_SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW] = HAS_ESCAPES_FLAG, [_LOAD_CONST_UNDER_INLINE] = 0, [_LOAD_CONST_UNDER_INLINE_BORROW] = 0, [_START_EXECUTOR] = HAS_DEOPT_FLAG, @@ -2474,12 +2474,12 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { }, }, [_CALL_TYPE_1] = { - .best = { 3, 3, 3, 3 }, + .best = { 0, 1, 2, 3 }, .entries = { - { -1, -1, -1 }, - { -1, -1, -1 }, - { -1, -1, -1 }, - { 1, 3, _CALL_TYPE_1_r31 }, + { 2, 0, _CALL_TYPE_1_r02 }, + { 2, 1, _CALL_TYPE_1_r12 }, + { 2, 2, _CALL_TYPE_1_r22 }, + { 2, 3, _CALL_TYPE_1_r32 }, }, }, [_GUARD_CALLABLE_STR_1] = { @@ -3067,6 +3067,15 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = { { 1, 3, _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW_r31 }, }, }, + [_SHUFFLE_2_LOAD_CONST_INLINE_BORROW] = { + .best = { 0, 1, 2, 3 }, + .entries = { + { 2, 0, _SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r02 }, + { 2, 1, _SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r12 }, + { 2, 2, _SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r22 }, + { 2, 3, _SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r32 }, + }, + }, [_SHUFFLE_3_LOAD_CONST_INLINE_BORROW] = { .best = { 0, 1, 2, 3 }, .entries = { @@ -3699,7 +3708,10 @@ const uint16_t _PyUop_Uncached[MAX_UOP_REGS_ID+1] = { [_GUARD_CALLABLE_TYPE_1_r13] = _GUARD_CALLABLE_TYPE_1, [_GUARD_CALLABLE_TYPE_1_r23] = _GUARD_CALLABLE_TYPE_1, [_GUARD_CALLABLE_TYPE_1_r33] = _GUARD_CALLABLE_TYPE_1, - [_CALL_TYPE_1_r31] = _CALL_TYPE_1, + [_CALL_TYPE_1_r02] = _CALL_TYPE_1, + [_CALL_TYPE_1_r12] = _CALL_TYPE_1, + [_CALL_TYPE_1_r22] = _CALL_TYPE_1, + [_CALL_TYPE_1_r32] = _CALL_TYPE_1, [_GUARD_CALLABLE_STR_1_r03] = _GUARD_CALLABLE_STR_1, [_GUARD_CALLABLE_STR_1_r13] = _GUARD_CALLABLE_STR_1, [_GUARD_CALLABLE_STR_1_r23] = _GUARD_CALLABLE_STR_1, @@ -3830,6 +3842,10 @@ const uint16_t _PyUop_Uncached[MAX_UOP_REGS_ID+1] = { [_POP_TWO_LOAD_CONST_INLINE_BORROW_r21] = _POP_TWO_LOAD_CONST_INLINE_BORROW, [_POP_CALL_LOAD_CONST_INLINE_BORROW_r21] = _POP_CALL_LOAD_CONST_INLINE_BORROW, [_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW_r31] = _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW, + [_SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r02] = _SHUFFLE_2_LOAD_CONST_INLINE_BORROW, + [_SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r12] = _SHUFFLE_2_LOAD_CONST_INLINE_BORROW, + [_SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r22] = _SHUFFLE_2_LOAD_CONST_INLINE_BORROW, + [_SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r32] = _SHUFFLE_2_LOAD_CONST_INLINE_BORROW, [_SHUFFLE_3_LOAD_CONST_INLINE_BORROW_r03] = _SHUFFLE_3_LOAD_CONST_INLINE_BORROW, [_SHUFFLE_3_LOAD_CONST_INLINE_BORROW_r13] = _SHUFFLE_3_LOAD_CONST_INLINE_BORROW, [_SHUFFLE_3_LOAD_CONST_INLINE_BORROW_r23] = _SHUFFLE_3_LOAD_CONST_INLINE_BORROW, @@ -4018,7 +4034,10 @@ const char *const _PyOpcode_uop_name[MAX_UOP_REGS_ID+1] = { [_CALL_TUPLE_1] = "_CALL_TUPLE_1", [_CALL_TUPLE_1_r32] = "_CALL_TUPLE_1_r32", [_CALL_TYPE_1] = "_CALL_TYPE_1", - [_CALL_TYPE_1_r31] = "_CALL_TYPE_1_r31", + [_CALL_TYPE_1_r02] = "_CALL_TYPE_1_r02", + [_CALL_TYPE_1_r12] = "_CALL_TYPE_1_r12", + [_CALL_TYPE_1_r22] = "_CALL_TYPE_1_r22", + [_CALL_TYPE_1_r32] = "_CALL_TYPE_1_r32", [_CHECK_AND_ALLOCATE_OBJECT] = "_CHECK_AND_ALLOCATE_OBJECT", [_CHECK_AND_ALLOCATE_OBJECT_r00] = "_CHECK_AND_ALLOCATE_OBJECT_r00", [_CHECK_ATTR_CLASS] = "_CHECK_ATTR_CLASS", @@ -4781,6 +4800,11 @@ const char *const _PyOpcode_uop_name[MAX_UOP_REGS_ID+1] = { [_SET_IP_r33] = "_SET_IP_r33", [_SET_UPDATE] = "_SET_UPDATE", [_SET_UPDATE_r10] = "_SET_UPDATE_r10", + [_SHUFFLE_2_LOAD_CONST_INLINE_BORROW] = "_SHUFFLE_2_LOAD_CONST_INLINE_BORROW", + [_SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r02] = "_SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r02", + [_SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r12] = "_SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r12", + [_SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r22] = "_SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r22", + [_SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r32] = "_SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r32", [_SHUFFLE_3_LOAD_CONST_INLINE_BORROW] = "_SHUFFLE_3_LOAD_CONST_INLINE_BORROW", [_SHUFFLE_3_LOAD_CONST_INLINE_BORROW_r03] = "_SHUFFLE_3_LOAD_CONST_INLINE_BORROW_r03", [_SHUFFLE_3_LOAD_CONST_INLINE_BORROW_r13] = "_SHUFFLE_3_LOAD_CONST_INLINE_BORROW_r13", @@ -4849,7 +4873,10 @@ const char *const _PyOpcode_uop_name[MAX_UOP_REGS_ID+1] = { [_SWAP_2_r22] = "_SWAP_2_r22", [_SWAP_2_r33] = "_SWAP_2_r33", [_SWAP_3] = "_SWAP_3", - [_SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW] = "_SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW", + [_SWAP_3_r03] = "_SWAP_3_r03", + [_SWAP_3_r13] = "_SWAP_3_r13", + [_SWAP_3_r23] = "_SWAP_3_r23", + [_SWAP_3_r33] = "_SWAP_3_r33", [_TIER2_RESUME_CHECK] = "_TIER2_RESUME_CHECK", [_TIER2_RESUME_CHECK_r00] = "_TIER2_RESUME_CHECK_r00", [_TIER2_RESUME_CHECK_r11] = "_TIER2_RESUME_CHECK_r11", @@ -5500,12 +5527,12 @@ int _PyUop_num_popped(int opcode, int oparg) return 2; case _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW: return 3; + case _SHUFFLE_2_LOAD_CONST_INLINE_BORROW: + return 3; case _SHUFFLE_3_LOAD_CONST_INLINE_BORROW: return 3; case _POP_CALL_TWO_LOAD_CONST_INLINE_BORROW: return 4; - case _SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW: - return 3; case _LOAD_CONST_UNDER_INLINE: return 1; case _LOAD_CONST_UNDER_INLINE_BORROW: diff --git a/Lib/test/test_capi/test_opt.py b/Lib/test/test_capi/test_opt.py index 338af22a90704c..d597e19d51e378 100644 --- a/Lib/test/test_capi/test_opt.py +++ b/Lib/test/test_capi/test_opt.py @@ -1925,10 +1925,10 @@ def testfunc(n): self.assertIsNotNone(ex) uops = get_opnames(ex) # When the result of type(...) is known, _CALL_TYPE_1 is replaced with - # _SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW which is optimized away in + # _SHUFFLE_2_LOAD_CONST_INLINE_BORROW which is optimized away in # remove_unneeded_uops. self.assertNotIn("_CALL_TYPE_1", uops) - self.assertNotIn("_SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW", uops) + self.assertNotIn("_SHUFFLE_2_LOAD_CONST_INLINE_BORROW", uops) self.assertNotIn("_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW", uops) self.assertNotIn("_POP_CALL_LOAD_CONST_INLINE_BORROW", uops) self.assertNotIn("_POP_TOP_LOAD_CONST_INLINE_BORROW", uops) diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 8c3b42f20c84b5..5e6b06f58862e9 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -5274,6 +5274,12 @@ dummy_func( value = PyStackRef_FromPyObjectBorrow(ptr); } + tier2 op(_SHUFFLE_2_LOAD_CONST_INLINE_BORROW, (ptr/4, callable, null, arg -- res, a)) { + res = PyStackRef_FromPyObjectBorrow(ptr); + a = arg; + INPUTS_DEAD(); + } + tier2 op(_SHUFFLE_3_LOAD_CONST_INLINE_BORROW, (ptr/4, callable, null, arg -- res, a, c)) { res = PyStackRef_FromPyObjectBorrow(ptr); a = arg; @@ -5290,16 +5296,6 @@ dummy_func( value = PyStackRef_FromPyObjectBorrow(ptr); } - tier2 op(_SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW, (ptr/4, callable, null, arg -- value, a)) { - (void)null; // Silence compiler warnings about unused variables - (void)callable; - DEAD(null); - DEAD(callable); - assert(_Py_IsImmortal(PyStackRef_AsPyObjectBorrow(callable))); - value = PyStackRef_FromPyObjectBorrow(ptr); - a = arg; - } - tier2 op(_LOAD_CONST_UNDER_INLINE, (ptr/4, old -- value, new)) { new = old; DEAD(old); diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index 82d3f1d198f042..baea8773a23bbf 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -12807,8 +12807,8 @@ break; } - case _CALL_TYPE_1_r31: { - CHECK_CURRENT_CACHED_VALUES(3); + case _CALL_TYPE_1_r02: { + CHECK_CURRENT_CACHED_VALUES(0); assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE()); _PyStackRef arg; _PyStackRef res; @@ -12820,10 +12820,82 @@ STAT_INC(CALL, hit); res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o)); a = arg; - stack_pointer[-3] = res; - stack_pointer[-2] = a; + _tos_cache1 = a; + _tos_cache0 = res; + SET_CURRENT_CACHED_VALUES(2); + stack_pointer += -3; + ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); + assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE()); + break; + } + + case _CALL_TYPE_1_r12: { + CHECK_CURRENT_CACHED_VALUES(1); + assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE()); + _PyStackRef arg; + _PyStackRef res; + _PyStackRef a; + _PyStackRef _stack_item_0 = _tos_cache0; + oparg = CURRENT_OPARG(); + arg = _stack_item_0; + PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg); + assert(oparg == 1); + STAT_INC(CALL, hit); + res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o)); + a = arg; + _tos_cache1 = a; + _tos_cache0 = res; + SET_CURRENT_CACHED_VALUES(2); + stack_pointer += -2; + ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); + assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE()); + break; + } + + case _CALL_TYPE_1_r22: { + CHECK_CURRENT_CACHED_VALUES(2); + assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE()); + _PyStackRef arg; + _PyStackRef res; + _PyStackRef a; + _PyStackRef _stack_item_0 = _tos_cache0; + _PyStackRef _stack_item_1 = _tos_cache1; + oparg = CURRENT_OPARG(); + arg = _stack_item_1; + PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg); + assert(oparg == 1); + STAT_INC(CALL, hit); + res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o)); + a = arg; + _tos_cache1 = a; + _tos_cache0 = res; + SET_CURRENT_CACHED_VALUES(2); stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); + ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); + assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE()); + break; + } + + case _CALL_TYPE_1_r32: { + CHECK_CURRENT_CACHED_VALUES(3); + assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE()); + _PyStackRef arg; + _PyStackRef res; + _PyStackRef a; + _PyStackRef _stack_item_0 = _tos_cache0; + _PyStackRef _stack_item_1 = _tos_cache1; + _PyStackRef _stack_item_2 = _tos_cache2; + oparg = CURRENT_OPARG(); + arg = _stack_item_2; + PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg); + assert(oparg == 1); + STAT_INC(CALL, hit); + res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o)); + a = arg; + _tos_cache1 = a; + _tos_cache0 = res; + SET_CURRENT_CACHED_VALUES(2); + assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE()); break; } @@ -16214,288 +16286,11 @@ break; } - case _LOAD_CONST_INLINE: { - _PyStackRef value; - PyObject *ptr = (PyObject *)CURRENT_OPERAND0(); - value = PyStackRef_FromPyObjectNew(ptr); - stack_pointer[0] = value; - stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); - break; - } - - case _POP_TOP_LOAD_CONST_INLINE: { - _PyStackRef pop; - _PyStackRef value; - pop = stack_pointer[-1]; - PyObject *ptr = (PyObject *)CURRENT_OPERAND0(); - stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); - _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(pop); - stack_pointer = _PyFrame_GetStackPointer(frame); - value = PyStackRef_FromPyObjectNew(ptr); - stack_pointer[0] = value; - stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); - break; - } - - case _LOAD_CONST_INLINE_BORROW: { - _PyStackRef value; - PyObject *ptr = (PyObject *)CURRENT_OPERAND0(); - value = PyStackRef_FromPyObjectBorrow(ptr); - stack_pointer[0] = value; - stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); - break; - } - - case _POP_CALL: { - _PyStackRef null; - _PyStackRef callable; - null = stack_pointer[-1]; - callable = stack_pointer[-2]; - (void)null; - stack_pointer += -2; - assert(WITHIN_STACK_BOUNDS()); - _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(callable); - stack_pointer = _PyFrame_GetStackPointer(frame); - break; - } - - case _POP_CALL_ONE: { - _PyStackRef pop; - _PyStackRef null; - _PyStackRef callable; - pop = stack_pointer[-1]; - null = stack_pointer[-2]; - callable = stack_pointer[-3]; - stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); - _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(pop); - stack_pointer = _PyFrame_GetStackPointer(frame); - (void)null; - stack_pointer += -2; - assert(WITHIN_STACK_BOUNDS()); - _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(callable); - stack_pointer = _PyFrame_GetStackPointer(frame); - break; - } - - case _POP_CALL_TWO: { - _PyStackRef pop2; - _PyStackRef pop1; - _PyStackRef null; - _PyStackRef callable; - pop2 = stack_pointer[-1]; - pop1 = stack_pointer[-2]; - null = stack_pointer[-3]; - callable = stack_pointer[-4]; - stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); - _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(pop2); - stack_pointer = _PyFrame_GetStackPointer(frame); - stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); - _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(pop1); - stack_pointer = _PyFrame_GetStackPointer(frame); - (void)null; - stack_pointer += -2; - assert(WITHIN_STACK_BOUNDS()); - _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(callable); - stack_pointer = _PyFrame_GetStackPointer(frame); - break; - } - - case _POP_TOP_LOAD_CONST_INLINE_BORROW: { - _PyStackRef pop; - _PyStackRef value; - pop = stack_pointer[-1]; - PyObject *ptr = (PyObject *)CURRENT_OPERAND0(); - stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); - _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(pop); - stack_pointer = _PyFrame_GetStackPointer(frame); - value = PyStackRef_FromPyObjectBorrow(ptr); - stack_pointer[0] = value; - stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); - break; - } - - case _POP_TWO_LOAD_CONST_INLINE_BORROW: { - _PyStackRef pop2; - _PyStackRef pop1; - _PyStackRef value; - pop2 = stack_pointer[-1]; - pop1 = stack_pointer[-2]; - PyObject *ptr = (PyObject *)CURRENT_OPERAND0(); - stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); - _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(pop2); - stack_pointer = _PyFrame_GetStackPointer(frame); - stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); - _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(pop1); - stack_pointer = _PyFrame_GetStackPointer(frame); - value = PyStackRef_FromPyObjectBorrow(ptr); - stack_pointer[0] = value; - stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); - break; - } - - case _POP_CALL_LOAD_CONST_INLINE_BORROW: { - _PyStackRef null; - _PyStackRef callable; - _PyStackRef value; - null = stack_pointer[-1]; - callable = stack_pointer[-2]; - PyObject *ptr = (PyObject *)CURRENT_OPERAND0(); - (void)null; - stack_pointer += -2; - assert(WITHIN_STACK_BOUNDS()); - _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(callable); - stack_pointer = _PyFrame_GetStackPointer(frame); - value = PyStackRef_FromPyObjectBorrow(ptr); - stack_pointer[0] = value; - stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); - break; - } - - case _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW: { - _PyStackRef pop; - _PyStackRef null; - _PyStackRef callable; - _PyStackRef value; - pop = stack_pointer[-1]; - null = stack_pointer[-2]; - callable = stack_pointer[-3]; - PyObject *ptr = (PyObject *)CURRENT_OPERAND0(); - stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); - _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(pop); - stack_pointer = _PyFrame_GetStackPointer(frame); - (void)null; - stack_pointer += -2; - assert(WITHIN_STACK_BOUNDS()); - _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(callable); - stack_pointer = _PyFrame_GetStackPointer(frame); - value = PyStackRef_FromPyObjectBorrow(ptr); - stack_pointer[0] = value; - stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); - break; - } - - case _POP_CALL_TWO_LOAD_CONST_INLINE_BORROW: { - _PyStackRef pop2; - _PyStackRef pop1; - _PyStackRef null; - _PyStackRef callable; - _PyStackRef value; - pop2 = stack_pointer[-1]; - pop1 = stack_pointer[-2]; - null = stack_pointer[-3]; - callable = stack_pointer[-4]; - PyObject *ptr = (PyObject *)CURRENT_OPERAND0(); - stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); - _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(pop2); - stack_pointer = _PyFrame_GetStackPointer(frame); - stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); - _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(pop1); - stack_pointer = _PyFrame_GetStackPointer(frame); - (void)null; - stack_pointer += -2; - assert(WITHIN_STACK_BOUNDS()); - _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(callable); - stack_pointer = _PyFrame_GetStackPointer(frame); - value = PyStackRef_FromPyObjectBorrow(ptr); - stack_pointer[0] = value; - stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); - break; - } - - case _SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW: { - _PyStackRef arg; - _PyStackRef null; - _PyStackRef callable; - _PyStackRef value; - _PyStackRef a; - arg = stack_pointer[-1]; - null = stack_pointer[-2]; - callable = stack_pointer[-3]; - PyObject *ptr = (PyObject *)CURRENT_OPERAND0(); - stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); - _PyFrame_SetStackPointer(frame, stack_pointer); - PyStackRef_CLOSE(arg); - stack_pointer = _PyFrame_GetStackPointer(frame); - (void)null; - (void)callable; - assert(_Py_IsImmortal(PyStackRef_AsPyObjectBorrow(callable))); - value = PyStackRef_FromPyObjectBorrow(ptr); - a = arg; - stack_pointer[-2] = value; - stack_pointer[-1] = a; - break; - } - - case _LOAD_CONST_UNDER_INLINE: { - _PyStackRef old; - _PyStackRef value; - _PyStackRef new; - old = stack_pointer[-1]; - PyObject *ptr = (PyObject *)CURRENT_OPERAND0(); - new = old; - value = PyStackRef_FromPyObjectNew(ptr); - stack_pointer[-1] = value; - stack_pointer[0] = new; - stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); - break; - } - - case _LOAD_CONST_UNDER_INLINE_BORROW: { - _PyStackRef old; - _PyStackRef value; - _PyStackRef new; - old = stack_pointer[-1]; - PyObject *ptr = (PyObject *)CURRENT_OPERAND0(); - new = old; - value = PyStackRef_FromPyObjectBorrow(ptr); - stack_pointer[-1] = value; - stack_pointer[0] = new; - stack_pointer += 1; - assert(WITHIN_STACK_BOUNDS()); - break; - } - - case _CHECK_FUNCTION: { - uint32_t func_version = (uint32_t)CURRENT_OPERAND0(); - assert(PyStackRef_FunctionCheck(frame->f_funcobj)); - PyFunctionObject *func = (PyFunctionObject *)PyStackRef_AsPyObjectBorrow(frame->f_funcobj); - if (func->func_version != func_version) { + case _CHECK_VALIDITY_r11: { + CHECK_CURRENT_CACHED_VALUES(1); + assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE()); + _PyStackRef _stack_item_0 = _tos_cache0; + if (!current_executor->vm_data.valid) { UOP_STAT_INC(uopcode, miss); _tos_cache0 = _stack_item_0; SET_CURRENT_CACHED_VALUES(1); @@ -16857,6 +16652,86 @@ break; } + case _SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r02: { + CHECK_CURRENT_CACHED_VALUES(0); + assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE()); + _PyStackRef arg; + _PyStackRef res; + _PyStackRef a; + arg = stack_pointer[-1]; + PyObject *ptr = (PyObject *)CURRENT_OPERAND0_64(); + res = PyStackRef_FromPyObjectBorrow(ptr); + a = arg; + _tos_cache1 = a; + _tos_cache0 = res; + SET_CURRENT_CACHED_VALUES(2); + stack_pointer += -3; + ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); + assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE()); + break; + } + + case _SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r12: { + CHECK_CURRENT_CACHED_VALUES(1); + assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE()); + _PyStackRef arg; + _PyStackRef res; + _PyStackRef a; + _PyStackRef _stack_item_0 = _tos_cache0; + arg = _stack_item_0; + PyObject *ptr = (PyObject *)CURRENT_OPERAND0_64(); + res = PyStackRef_FromPyObjectBorrow(ptr); + a = arg; + _tos_cache1 = a; + _tos_cache0 = res; + SET_CURRENT_CACHED_VALUES(2); + stack_pointer += -2; + ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); + assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE()); + break; + } + + case _SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r22: { + CHECK_CURRENT_CACHED_VALUES(2); + assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE()); + _PyStackRef arg; + _PyStackRef res; + _PyStackRef a; + _PyStackRef _stack_item_0 = _tos_cache0; + _PyStackRef _stack_item_1 = _tos_cache1; + arg = _stack_item_1; + PyObject *ptr = (PyObject *)CURRENT_OPERAND0_64(); + res = PyStackRef_FromPyObjectBorrow(ptr); + a = arg; + _tos_cache1 = a; + _tos_cache0 = res; + SET_CURRENT_CACHED_VALUES(2); + stack_pointer += -1; + ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); + assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE()); + break; + } + + case _SHUFFLE_2_LOAD_CONST_INLINE_BORROW_r32: { + CHECK_CURRENT_CACHED_VALUES(3); + assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE()); + _PyStackRef arg; + _PyStackRef res; + _PyStackRef a; + _PyStackRef _stack_item_0 = _tos_cache0; + _PyStackRef _stack_item_1 = _tos_cache1; + _PyStackRef _stack_item_2 = _tos_cache2; + arg = _stack_item_2; + PyObject *ptr = (PyObject *)CURRENT_OPERAND0_64(); + res = PyStackRef_FromPyObjectBorrow(ptr); + a = arg; + _tos_cache1 = a; + _tos_cache0 = res; + SET_CURRENT_CACHED_VALUES(2); + assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE()); + break; + } + case _SHUFFLE_3_LOAD_CONST_INLINE_BORROW_r03: { CHECK_CURRENT_CACHED_VALUES(0); assert(WITHIN_STACK_BOUNDS_IGNORING_CACHE()); diff --git a/Python/optimizer_analysis.c b/Python/optimizer_analysis.c index 3ff27f200070c1..81479a8f28e319 100644 --- a/Python/optimizer_analysis.c +++ b/Python/optimizer_analysis.c @@ -448,7 +448,7 @@ const uint16_t op_without_push[MAX_UOP_ID + 1] = { [_POP_TWO_LOAD_CONST_INLINE_BORROW] = _POP_TWO, [_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW] = _POP_CALL_ONE, [_POP_CALL_TWO_LOAD_CONST_INLINE_BORROW] = _POP_CALL_TWO, - [_SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW] = _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW, + [_SHUFFLE_2_LOAD_CONST_INLINE_BORROW] = _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW, }; const bool op_skip[MAX_UOP_ID + 1] = { diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c index 26245703fab1b9..9b691a5cf09073 100644 --- a/Python/optimizer_bytecodes.c +++ b/Python/optimizer_bytecodes.c @@ -533,8 +533,8 @@ dummy_func(void) { value = PyJitRef_Borrow(sym_new_const(ctx, ptr)); } - op(_SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW, (ptr/4, unused, unused, arg -- value, a)) { - value = PyJitRef_Borrow(sym_new_const(ctx, ptr)); + op(_SHUFFLE_2_LOAD_CONST_INLINE_BORROW, (ptr/4, unused, unused, arg -- res, a)) { + res = PyJitRef_Borrow(sym_new_const(ctx, ptr)); a = arg; } @@ -989,7 +989,7 @@ dummy_func(void) { PyObject* type = (PyObject *)sym_get_type(arg); if (type) { res = sym_new_const(ctx, type); - REPLACE_OP(this_instr, _SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW, 0, + REPLACE_OP(this_instr, _SHUFFLE_2_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)type); } else { diff --git a/Python/optimizer_cases.c.h b/Python/optimizer_cases.c.h index 3c702af99fe9d0..f02f0d45f70cf4 100644 --- a/Python/optimizer_cases.c.h +++ b/Python/optimizer_cases.c.h @@ -2677,17 +2677,18 @@ PyObject* type = (PyObject *)sym_get_type(arg); if (type) { res = sym_new_const(ctx, type); - REPLACE_OP(this_instr, _SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW, 0, + REPLACE_OP(this_instr, _SHUFFLE_2_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)type); } else { res = sym_new_not_null(ctx); } a = arg; + CHECK_STACK_BOUNDS(-1); stack_pointer[-3] = res; stack_pointer[-2] = a; stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); + ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); break; } @@ -3444,6 +3445,22 @@ break; } + case _SHUFFLE_2_LOAD_CONST_INLINE_BORROW: { + JitOptRef arg; + JitOptRef res; + JitOptRef a; + arg = stack_pointer[-1]; + PyObject *ptr = (PyObject *)this_instr->operand0; + res = PyJitRef_Borrow(sym_new_const(ctx, ptr)); + a = arg; + CHECK_STACK_BOUNDS(-1); + stack_pointer[-3] = res; + stack_pointer[-2] = a; + stack_pointer += -1; + ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__); + break; + } + case _SHUFFLE_3_LOAD_CONST_INLINE_BORROW: { JitOptRef res; JitOptRef a; @@ -3468,21 +3485,6 @@ break; } - case _SWAP_CALL_ONE_LOAD_CONST_INLINE_BORROW: { - JitOptRef arg; - JitOptRef value; - JitOptRef a; - arg = stack_pointer[-1]; - PyObject *ptr = (PyObject *)this_instr->operand0; - value = PyJitRef_Borrow(sym_new_const(ctx, ptr)); - a = arg; - stack_pointer[-3] = value; - stack_pointer[-2] = a; - stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); - break; - } - case _LOAD_CONST_UNDER_INLINE: { JitOptRef value; JitOptRef new; From 225d6dbbb6e3a17bf4a2fcac6006112d8f9f105f Mon Sep 17 00:00:00 2001 From: Tomas Roun Date: Tue, 23 Dec 2025 10:03:03 +0100 Subject: [PATCH 09/10] Regenerate files --- Include/internal/pycore_uop_ids.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Include/internal/pycore_uop_ids.h b/Include/internal/pycore_uop_ids.h index 7805310fb8eb18..204210ff101efe 100644 --- a/Include/internal/pycore_uop_ids.h +++ b/Include/internal/pycore_uop_ids.h @@ -811,7 +811,7 @@ extern "C" { #define _LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES_r11 1004 #define _LOAD_ATTR_PROPERTY_FRAME_r11 1005 #define _LOAD_ATTR_SLOT_r11 1006 -#define _LOAD_ATTR_WITH_HINT_r11 1007 +#define _LOAD_ATTR_WITH_HINT_r12 1007 #define _LOAD_BUILD_CLASS_r01 1008 #define _LOAD_BYTECODE_r00 1009 #define _LOAD_COMMON_CONSTANT_r01 1010 From bba94359017bc7fed86262598d125730bfacccfe Mon Sep 17 00:00:00 2001 From: Ken Jin Date: Tue, 23 Dec 2025 16:14:26 +0000 Subject: [PATCH 10/10] address review --- Python/bytecodes.c | 2 +- Python/executor_cases.c.h | 8 ++++---- Python/generated_cases.c.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 985191546c349f..84a9f07995922f 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -3991,9 +3991,9 @@ dummy_func( assert(oparg == 1); STAT_INC(CALL, hit); + a = arg; INPUTS_DEAD(); res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o)); - a = arg; } macro(CALL_TYPE_1) = diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index a4e1a7e099e82f..f64747d6f27f2a 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -12821,8 +12821,8 @@ PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg); assert(oparg == 1); STAT_INC(CALL, hit); - res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o)); a = arg; + res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o)); _tos_cache1 = a; _tos_cache0 = res; SET_CURRENT_CACHED_VALUES(2); @@ -12844,8 +12844,8 @@ PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg); assert(oparg == 1); STAT_INC(CALL, hit); - res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o)); a = arg; + res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o)); _tos_cache1 = a; _tos_cache0 = res; SET_CURRENT_CACHED_VALUES(2); @@ -12868,8 +12868,8 @@ PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg); assert(oparg == 1); STAT_INC(CALL, hit); - res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o)); a = arg; + res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o)); _tos_cache1 = a; _tos_cache0 = res; SET_CURRENT_CACHED_VALUES(2); @@ -12893,8 +12893,8 @@ PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg); assert(oparg == 1); STAT_INC(CALL, hit); - res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o)); a = arg; + res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o)); _tos_cache1 = a; _tos_cache0 = res; SET_CURRENT_CACHED_VALUES(2); diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 2a3f6dd0efff79..bc022db672f8d2 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -4173,8 +4173,8 @@ PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg); assert(oparg == 1); STAT_INC(CALL, hit); - res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o)); a = arg; + res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o)); } // _POP_TOP {