@@ -2130,8 +2130,7 @@ dummy_func(
2130
2130
PyStackRef_CLOSE (self_st );
2131
2131
self_or_null = PyStackRef_NULL ;
2132
2132
}
2133
- PyStackRef_CLOSE (class_st );
2134
- PyStackRef_CLOSE (global_super_st );
2133
+ DECREF_INPUTS ();
2135
2134
2136
2135
attr = PyStackRef_FromPyObjectSteal (attr_o );
2137
2136
}
@@ -2245,7 +2244,7 @@ dummy_func(
2245
2244
attr = PyStackRef_FromPyObjectNew (attr_o );
2246
2245
#endif
2247
2246
STAT_INC (LOAD_ATTR , hit );
2248
- DECREF_INPUTS ( );
2247
+ PyStackRef_CLOSE ( owner );
2249
2248
}
2250
2249
2251
2250
macro (LOAD_ATTR_INSTANCE_VALUE ) =
@@ -3671,15 +3670,14 @@ dummy_func(
3671
3670
EXIT_IF (!PyStackRef_IsNull (null [0 ]));
3672
3671
}
3673
3672
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 ])) {
3675
3674
PyObject * callable_o = PyStackRef_AsPyObjectBorrow (callable [0 ]);
3676
- assert (PyStackRef_IsNull (null [0 ]));
3677
- DEAD (null );
3675
+ assert (PyStackRef_IsNull (self_or_null [0 ]));
3678
3676
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 );
3680
3678
_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 ]));
3683
3681
PyStackRef_CLOSE (temp );
3684
3682
}
3685
3683
@@ -3740,13 +3738,13 @@ dummy_func(
3740
3738
EXIT_IF (Py_TYPE (PyStackRef_AsPyObjectBorrow (callable [0 ])) != & PyMethod_Type );
3741
3739
}
3742
3740
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 ]) );
3745
3743
PyObject * callable_o = PyStackRef_AsPyObjectBorrow (callable [0 ]);
3746
3744
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 );
3748
3746
_PyStackRef temp = callable [0 ];
3749
- func [0 ] = PyStackRef_FromPyObjectNew (((PyMethodObject * )callable_o )-> im_func );
3747
+ callable [0 ] = PyStackRef_FromPyObjectNew (((PyMethodObject * )callable_o )-> im_func );
3750
3748
PyStackRef_CLOSE (temp );
3751
3749
}
3752
3750
@@ -4171,8 +4169,9 @@ dummy_func(
4171
4169
PyObject * callable_o = PyStackRef_AsPyObjectBorrow (callable [0 ]);
4172
4170
4173
4171
int total_args = oparg ;
4172
+ _PyStackRef * arguments = args ;
4174
4173
if (!PyStackRef_IsNull (self_or_null [0 ])) {
4175
- args -- ;
4174
+ arguments -- ;
4176
4175
total_args ++ ;
4177
4176
}
4178
4177
@@ -4183,8 +4182,8 @@ dummy_func(
4183
4182
EXIT_IF (meth -> ml_flags != METH_O );
4184
4183
// CPython promises to check all non-vectorcall function calls.
4185
4184
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 ];
4188
4187
EXIT_IF (!Py_IS_TYPE (PyStackRef_AsPyObjectBorrow (self_stackref ),
4189
4188
method -> d_common .d_type ));
4190
4189
STAT_INC (CALL , hit );
@@ -4195,11 +4194,7 @@ dummy_func(
4195
4194
PyStackRef_AsPyObjectBorrow (arg_stackref ));
4196
4195
_Py_LeaveRecursiveCallTstate (tstate );
4197
4196
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 ();
4203
4198
ERROR_IF (res_o == NULL , error );
4204
4199
res = PyStackRef_FromPyObjectSteal (res_o );
4205
4200
}
@@ -4486,15 +4481,14 @@ dummy_func(
4486
4481
EXIT_IF (!PyStackRef_IsNull (null [0 ]));
4487
4482
}
4488
4483
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 ]));
4490
4486
_PyStackRef callable_s = callable [0 ];
4491
4487
PyObject * callable_o = PyStackRef_AsPyObjectBorrow (callable_s );
4492
-
4493
- assert (PyStackRef_IsNull (null [0 ]));
4494
4488
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 ]));
4498
4492
PyStackRef_CLOSE (callable_s );
4499
4493
}
4500
4494
@@ -4600,7 +4594,8 @@ dummy_func(
4600
4594
}
4601
4595
}
4602
4596
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 ;
4604
4599
PyObject * func = PyStackRef_AsPyObjectBorrow (func_st );
4605
4600
4606
4601
// DICT_MERGE is called before this opcode if there are kwargs.
@@ -4671,8 +4666,8 @@ dummy_func(
4671
4666
result_o = PyObject_Call (func , callargs , kwargs );
4672
4667
}
4673
4668
PyStackRef_XCLOSE (kwargs_st );
4674
- DEAD (kwargs_st );
4675
4669
PyStackRef_CLOSE (callargs_st );
4670
+ DEAD (null );
4676
4671
PyStackRef_CLOSE (func_st );
4677
4672
ERROR_IF (result_o == NULL , error );
4678
4673
result = PyStackRef_FromPyObjectSteal (result_o );
@@ -4809,12 +4804,11 @@ dummy_func(
4809
4804
4810
4805
macro (BINARY_OP ) = _SPECIALIZE_BINARY_OP + unused /4 + _BINARY_OP ;
4811
4806
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 ;
4818
4812
assert (oparg >= 2 );
4819
4813
}
4820
4814
@@ -5174,7 +5168,8 @@ dummy_func(
5174
5168
EXIT_TO_TIER1 ();
5175
5169
}
5176
5170
5177
- tier2 op (_ERROR_POP_N , (target /2 , unused [oparg ] -- )) {
5171
+ tier2 op (_ERROR_POP_N , (target /2 -- )) {
5172
+ assert (oparg == 0 );
5178
5173
frame -> instr_ptr = _PyFrame_GetBytecode (frame ) + target ;
5179
5174
SYNC_SP ();
5180
5175
GOTO_UNWIND ();
@@ -5193,18 +5188,18 @@ dummy_func(
5193
5188
}
5194
5189
5195
5190
label (pop_4_error ) {
5196
- STACK_SHRINK (1 );
5197
- goto pop_3_error ;
5191
+ STACK_SHRINK (4 );
5192
+ goto error ;
5198
5193
}
5199
5194
5200
5195
label (pop_3_error ) {
5201
- STACK_SHRINK (1 );
5202
- goto pop_2_error ;
5196
+ STACK_SHRINK (3 );
5197
+ goto error ;
5203
5198
}
5204
5199
5205
5200
label (pop_2_error ) {
5206
- STACK_SHRINK (1 );
5207
- goto pop_1_error ;
5201
+ STACK_SHRINK (2 );
5202
+ goto error ;
5208
5203
}
5209
5204
5210
5205
label (pop_1_error ) {
0 commit comments