@@ -719,7 +719,7 @@ specialize(_Py_CODEUNIT *instr, uint8_t specialized_opcode)
719
719
}
720
720
721
721
static inline void
722
- unspecialize (_Py_CODEUNIT * instr , int reason )
722
+ unspecialize (_Py_CODEUNIT * instr )
723
723
{
724
724
assert (!PyErr_Occurred ());
725
725
uint8_t opcode = FT_ATOMIC_LOAD_UINT8_RELAXED (instr -> op .code );
@@ -729,7 +729,6 @@ unspecialize(_Py_CODEUNIT *instr, int reason)
729
729
SPECIALIZATION_FAIL (generic_opcode , SPEC_FAIL_OTHER );
730
730
return ;
731
731
}
732
- SPECIALIZATION_FAIL (generic_opcode , reason );
733
732
_Py_BackoffCounter * counter = (_Py_BackoffCounter * )instr + 1 ;
734
733
_Py_BackoffCounter cur = load_counter (counter );
735
734
set_counter (counter , adaptive_counter_backoff (cur ));
@@ -2243,6 +2242,7 @@ _Py_Specialize_CallKw(_PyStackRef callable_st, _Py_CODEUNIT *instr, int nargs)
2243
2242
}
2244
2243
}
2245
2244
2245
+ #ifdef Py_STATS
2246
2246
static int
2247
2247
binary_op_fail_kind (int oparg , PyObject * lhs , PyObject * rhs )
2248
2248
{
@@ -2310,6 +2310,7 @@ binary_op_fail_kind(int oparg, PyObject *lhs, PyObject *rhs)
2310
2310
}
2311
2311
Py_UNREACHABLE ();
2312
2312
}
2313
+ #endif
2313
2314
2314
2315
void
2315
2316
_Py_Specialize_BinaryOp (_PyStackRef lhs_st , _PyStackRef rhs_st , _Py_CODEUNIT * instr ,
@@ -2373,7 +2374,8 @@ _Py_Specialize_BinaryOp(_PyStackRef lhs_st, _PyStackRef rhs_st, _Py_CODEUNIT *in
2373
2374
}
2374
2375
break ;
2375
2376
}
2376
- unspecialize (instr , binary_op_fail_kind (oparg , lhs , rhs ));
2377
+ SPECIALIZATION_FAIL (BINARY_OP , binary_op_fail_kind (oparg , lhs , rhs ));
2378
+ unspecialize (instr );
2377
2379
}
2378
2380
2379
2381
@@ -2760,6 +2762,7 @@ _Py_Specialize_ToBool(_PyStackRef value_o, _Py_CODEUNIT *instr)
2760
2762
cache -> counter = adaptive_counter_cooldown ();
2761
2763
}
2762
2764
2765
+ #ifdef Py_STATS
2763
2766
static int
2764
2767
containsop_fail_kind (PyObject * value ) {
2765
2768
if (PyUnicode_CheckExact (value )) {
@@ -2776,6 +2779,7 @@ containsop_fail_kind(PyObject *value) {
2776
2779
}
2777
2780
return SPEC_FAIL_OTHER ;
2778
2781
}
2782
+ #endif
2779
2783
2780
2784
void
2781
2785
_Py_Specialize_ContainsOp (_PyStackRef value_st , _Py_CODEUNIT * instr )
@@ -2793,7 +2797,8 @@ _Py_Specialize_ContainsOp(_PyStackRef value_st, _Py_CODEUNIT *instr)
2793
2797
return ;
2794
2798
}
2795
2799
2796
- unspecialize (instr , containsop_fail_kind (value ));
2800
+ SPECIALIZATION_FAIL (CONTAINS_OP , containsop_fail_kind (value ));
2801
+ unspecialize (instr );
2797
2802
return ;
2798
2803
}
2799
2804
0 commit comments