@@ -276,22 +276,11 @@ void _Py_Specialize_BinaryOp(PyObject *lhs, PyObject *rhs, _Py_CODEUNIT *instr,
276
276
SpecializedCacheEntry * cache );
277
277
void _Py_Specialize_CompareOp (PyObject * lhs , PyObject * rhs , _Py_CODEUNIT * instr , SpecializedCacheEntry * cache );
278
278
279
- #define PRINT_SPECIALIZATION_STATS 0
280
- #define PRINT_SPECIALIZATION_STATS_DETAILED 0
281
- #define PRINT_SPECIALIZATION_STATS_TO_FILE 0
282
279
283
- #ifdef Py_DEBUG
284
- #define COLLECT_SPECIALIZATION_STATS 1
285
- #define COLLECT_SPECIALIZATION_STATS_DETAILED 1
286
- #else
287
- #define COLLECT_SPECIALIZATION_STATS PRINT_SPECIALIZATION_STATS
288
- #define COLLECT_SPECIALIZATION_STATS_DETAILED PRINT_SPECIALIZATION_STATS_DETAILED
289
- #endif
280
+ #ifdef Py_STATS
290
281
291
282
#define SPECIALIZATION_FAILURE_KINDS 30
292
283
293
- #if COLLECT_SPECIALIZATION_STATS
294
-
295
284
typedef struct _stats {
296
285
uint64_t specialization_success ;
297
286
uint64_t specialization_failure ;
@@ -300,15 +289,13 @@ typedef struct _stats {
300
289
uint64_t miss ;
301
290
uint64_t deopt ;
302
291
uint64_t unquickened ;
303
- #if COLLECT_SPECIALIZATION_STATS_DETAILED
304
292
uint64_t specialization_failure_kinds [SPECIALIZATION_FAILURE_KINDS ];
305
- #endif
306
293
} SpecializationStats ;
307
294
308
295
extern SpecializationStats _specialization_stats [256 ];
309
296
#define STAT_INC (opname , name ) _specialization_stats[opname].name++
310
297
#define STAT_DEC (opname , name ) _specialization_stats[opname].name--
311
- void _Py_PrintSpecializationStats (void );
298
+ void _Py_PrintSpecializationStats (int to_file );
312
299
313
300
PyAPI_FUNC (PyObject * ) _Py_GetSpecializationStats (void );
314
301
0 commit comments