@@ -2130,8 +2130,7 @@ dummy_func(
21302130 PyStackRef_CLOSE (self_st );
21312131 self_or_null = PyStackRef_NULL ;
21322132 }
2133- PyStackRef_CLOSE (class_st );
2134- PyStackRef_CLOSE (global_super_st );
2133+ DECREF_INPUTS ();
21352134
21362135 attr = PyStackRef_FromPyObjectSteal (attr_o );
21372136 }
@@ -2245,7 +2244,7 @@ dummy_func(
22452244 attr = PyStackRef_FromPyObjectNew (attr_o );
22462245 #endif
22472246 STAT_INC (LOAD_ATTR , hit );
2248- DECREF_INPUTS ( );
2247+ PyStackRef_CLOSE ( owner );
22492248 }
22502249
22512250 macro (LOAD_ATTR_INSTANCE_VALUE ) =
@@ -3671,15 +3670,14 @@ dummy_func(
36713670 EXIT_IF (!PyStackRef_IsNull (null [0 ]));
36723671 }
36733672
3674- op (_EXPAND_METHOD , (callable [1 ], null [1 ], unused [oparg ] -- method [1 ], self [1 ], unused [oparg ])) {
3673+ op (_EXPAND_METHOD , (callable [1 ], self_or_null [1 ], unused [oparg ] -- callable [1 ], self_or_null [1 ], unused [oparg ])) {
36753674 PyObject * callable_o = PyStackRef_AsPyObjectBorrow (callable [0 ]);
3676- assert (PyStackRef_IsNull (null [0 ]));
3677- DEAD (null );
3675+ assert (PyStackRef_IsNull (self_or_null [0 ]));
36783676 assert (Py_TYPE (callable_o ) == & PyMethod_Type );
3679- self [0 ] = PyStackRef_FromPyObjectNew (((PyMethodObject * )callable_o )-> im_self );
3677+ self_or_null [0 ] = PyStackRef_FromPyObjectNew (((PyMethodObject * )callable_o )-> im_self );
36803678 _PyStackRef temp = callable [0 ];
3681- method [0 ] = PyStackRef_FromPyObjectNew (((PyMethodObject * )callable_o )-> im_func );
3682- assert (PyStackRef_FunctionCheck (method [0 ]));
3679+ callable [0 ] = PyStackRef_FromPyObjectNew (((PyMethodObject * )callable_o )-> im_func );
3680+ assert (PyStackRef_FunctionCheck (callable [0 ]));
36833681 PyStackRef_CLOSE (temp );
36843682 }
36853683
@@ -3740,13 +3738,13 @@ dummy_func(
37403738 EXIT_IF (Py_TYPE (PyStackRef_AsPyObjectBorrow (callable [0 ])) != & PyMethod_Type );
37413739 }
37423740
3743- op (_INIT_CALL_BOUND_METHOD_EXACT_ARGS , (callable [1 ], null [1 ], unused [oparg ] -- func [1 ], self [1 ], unused [oparg ])) {
3744- DEAD ( null );
3741+ op (_INIT_CALL_BOUND_METHOD_EXACT_ARGS , (callable [1 ], self_or_null [1 ], unused [oparg ] -- callable [1 ], self_or_null [1 ], unused [oparg ])) {
3742+ assert ( PyStackRef_IsNull ( self_or_null [ 0 ]) );
37453743 PyObject * callable_o = PyStackRef_AsPyObjectBorrow (callable [0 ]);
37463744 STAT_INC (CALL , hit );
3747- self [0 ] = PyStackRef_FromPyObjectNew (((PyMethodObject * )callable_o )-> im_self );
3745+ self_or_null [0 ] = PyStackRef_FromPyObjectNew (((PyMethodObject * )callable_o )-> im_self );
37483746 _PyStackRef temp = callable [0 ];
3749- func [0 ] = PyStackRef_FromPyObjectNew (((PyMethodObject * )callable_o )-> im_func );
3747+ callable [0 ] = PyStackRef_FromPyObjectNew (((PyMethodObject * )callable_o )-> im_func );
37503748 PyStackRef_CLOSE (temp );
37513749 }
37523750
@@ -4171,8 +4169,9 @@ dummy_func(
41714169 PyObject * callable_o = PyStackRef_AsPyObjectBorrow (callable [0 ]);
41724170
41734171 int total_args = oparg ;
4172+ _PyStackRef * arguments = args ;
41744173 if (!PyStackRef_IsNull (self_or_null [0 ])) {
4175- args -- ;
4174+ arguments -- ;
41764175 total_args ++ ;
41774176 }
41784177
@@ -4183,8 +4182,8 @@ dummy_func(
41834182 EXIT_IF (meth -> ml_flags != METH_O );
41844183 // CPython promises to check all non-vectorcall function calls.
41854184 EXIT_IF (tstate -> c_recursion_remaining <= 0 );
4186- _PyStackRef arg_stackref = args [1 ];
4187- _PyStackRef self_stackref = args [0 ];
4185+ _PyStackRef arg_stackref = arguments [1 ];
4186+ _PyStackRef self_stackref = arguments [0 ];
41884187 EXIT_IF (!Py_IS_TYPE (PyStackRef_AsPyObjectBorrow (self_stackref ),
41894188 method -> d_common .d_type ));
41904189 STAT_INC (CALL , hit );
@@ -4195,11 +4194,7 @@ dummy_func(
41954194 PyStackRef_AsPyObjectBorrow (arg_stackref ));
41964195 _Py_LeaveRecursiveCallTstate (tstate );
41974196 assert ((res_o != NULL ) ^ (_PyErr_Occurred (tstate ) != NULL ));
4198- PyStackRef_CLOSE (self_stackref );
4199- PyStackRef_CLOSE (arg_stackref );
4200- DEAD (args );
4201- DEAD (self_or_null );
4202- PyStackRef_CLOSE (callable [0 ]);
4197+ DECREF_INPUTS ();
42034198 ERROR_IF (res_o == NULL , error );
42044199 res = PyStackRef_FromPyObjectSteal (res_o );
42054200 }
@@ -4486,15 +4481,14 @@ dummy_func(
44864481 EXIT_IF (!PyStackRef_IsNull (null [0 ]));
44874482 }
44884483
4489- op (_EXPAND_METHOD_KW , (callable [1 ], null [1 ], unused [oparg ], unused -- method [1 ], self [1 ], unused [oparg ], unused )) {
4484+ op (_EXPAND_METHOD_KW , (callable [1 ], self_or_null [1 ], unused [oparg ], unused -- callable [1 ], self_or_null [1 ], unused [oparg ], unused )) {
4485+ assert (PyStackRef_IsNull (self_or_null [0 ]));
44904486 _PyStackRef callable_s = callable [0 ];
44914487 PyObject * callable_o = PyStackRef_AsPyObjectBorrow (callable_s );
4492-
4493- assert (PyStackRef_IsNull (null [0 ]));
44944488 assert (Py_TYPE (callable_o ) == & PyMethod_Type );
4495- self [0 ] = PyStackRef_FromPyObjectNew (((PyMethodObject * )callable_o )-> im_self );
4496- method [0 ] = PyStackRef_FromPyObjectNew (((PyMethodObject * )callable_o )-> im_func );
4497- assert (PyStackRef_FunctionCheck (method [0 ]));
4489+ self_or_null [0 ] = PyStackRef_FromPyObjectNew (((PyMethodObject * )callable_o )-> im_self );
4490+ callable [0 ] = PyStackRef_FromPyObjectNew (((PyMethodObject * )callable_o )-> im_func );
4491+ assert (PyStackRef_FunctionCheck (callable [0 ]));
44984492 PyStackRef_CLOSE (callable_s );
44994493 }
45004494
@@ -4600,7 +4594,8 @@ dummy_func(
46004594 }
46014595 }
46024596
4603- op (_DO_CALL_FUNCTION_EX , (func_st , unused , callargs_st , kwargs_st -- result )) {
4597+ op (_DO_CALL_FUNCTION_EX , (func_st , null , callargs_st , kwargs_st -- result )) {
4598+ (void )null ;
46044599 PyObject * func = PyStackRef_AsPyObjectBorrow (func_st );
46054600
46064601 // DICT_MERGE is called before this opcode if there are kwargs.
@@ -4671,8 +4666,8 @@ dummy_func(
46714666 result_o = PyObject_Call (func , callargs , kwargs );
46724667 }
46734668 PyStackRef_XCLOSE (kwargs_st );
4674- DEAD (kwargs_st );
46754669 PyStackRef_CLOSE (callargs_st );
4670+ DEAD (null );
46764671 PyStackRef_CLOSE (func_st );
46774672 ERROR_IF (result_o == NULL , error );
46784673 result = PyStackRef_FromPyObjectSteal (result_o );
@@ -4809,12 +4804,11 @@ dummy_func(
48094804
48104805 macro (BINARY_OP ) = _SPECIALIZE_BINARY_OP + unused /4 + _BINARY_OP ;
48114806
4812- pure inst (SWAP , (bottom_in , unused [oparg - 2 ], top_in --
4813- top_out , unused [oparg - 2 ], bottom_out )) {
4814- bottom_out = bottom_in ;
4815- DEAD (bottom_in );
4816- top_out = top_in ;
4817- DEAD (top_in );
4807+ pure inst (SWAP , (bottom [1 ], unused [oparg - 2 ], top [1 ] --
4808+ bottom [1 ], unused [oparg - 2 ], top [1 ])) {
4809+ _PyStackRef temp = bottom [0 ];
4810+ bottom [0 ] = top [0 ];
4811+ top [0 ] = temp ;
48184812 assert (oparg >= 2 );
48194813 }
48204814
@@ -5174,7 +5168,8 @@ dummy_func(
51745168 EXIT_TO_TIER1 ();
51755169 }
51765170
5177- tier2 op (_ERROR_POP_N , (target /2 , unused [oparg ] -- )) {
5171+ tier2 op (_ERROR_POP_N , (target /2 -- )) {
5172+ assert (oparg == 0 );
51785173 frame -> instr_ptr = _PyFrame_GetBytecode (frame ) + target ;
51795174 SYNC_SP ();
51805175 GOTO_UNWIND ();
@@ -5193,18 +5188,18 @@ dummy_func(
51935188 }
51945189
51955190 label (pop_4_error ) {
5196- STACK_SHRINK (1 );
5197- goto pop_3_error ;
5191+ STACK_SHRINK (4 );
5192+ goto error ;
51985193 }
51995194
52005195 label (pop_3_error ) {
5201- STACK_SHRINK (1 );
5202- goto pop_2_error ;
5196+ STACK_SHRINK (3 );
5197+ goto error ;
52035198 }
52045199
52055200 label (pop_2_error ) {
5206- STACK_SHRINK (1 );
5207- goto pop_1_error ;
5201+ STACK_SHRINK (2 );
5202+ goto error ;
52085203 }
52095204
52105205 label (pop_1_error ) {
0 commit comments