GH-123197: Only count an instruction as deferred if it hasn't deopted first. (GH-123222)

Only count an instruction as deferred if hasn't deopted first.
This commit is contained in:
Mark Shannon 2024-08-22 14:17:10 +01:00 committed by GitHub
parent 3d7b1a526d
commit a3d8c0542e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 33 additions and 30 deletions

View file

@ -384,6 +384,7 @@ extern void _Py_Specialize_ContainsOp(_PyStackRef value, _Py_CODEUNIT *instr);
} \
} while (0)
#define RARE_EVENT_STAT_INC(name) do { if (_Py_stats) _Py_stats->rare_event_stats.name++; } while (0)
#define OPCODE_DEFERRED_INC(opname) do { if (_Py_stats && opcode == opname) _Py_stats->opcode_stats[opname].specialization.deferred++; } while (0)
// Export for '_opcode' shared extension
PyAPI_FUNC(PyObject*) _Py_GetSpecializationStats(void);
@ -405,6 +406,7 @@ PyAPI_FUNC(PyObject*) _Py_GetSpecializationStats(void);
#define OPT_ERROR_IN_OPCODE(opname) ((void)0)
#define OPT_HIST(length, name) ((void)0)
#define RARE_EVENT_STAT_INC(name) ((void)0)
#define OPCODE_DEFERRED_INC(opname) ((void)0)
#endif // !Py_STATS
// Utility functions for reading/writing 32/64-bit values in the inline caches.