mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
Add specialization stats for FOR_ITER. (GH-31079)
This commit is contained in:
parent
f66c857572
commit
0d05da1fbf
3 changed files with 74 additions and 1 deletions
|
@ -4212,6 +4212,11 @@ handle_eval_breaker:
|
|||
PREDICTED(FOR_ITER);
|
||||
/* before: [iter]; after: [iter, iter()] *or* [] */
|
||||
PyObject *iter = TOP();
|
||||
#ifdef Py_STATS
|
||||
extern int _PySpecialization_ClassifyIterator(PyObject *);
|
||||
_py_stats.opcode_stats[FOR_ITER].specialization.failure++;
|
||||
_py_stats.opcode_stats[FOR_ITER].specialization.failure_kinds[_PySpecialization_ClassifyIterator(iter)]++;
|
||||
#endif
|
||||
PyObject *next = (*Py_TYPE(iter)->tp_iternext)(iter);
|
||||
if (next != NULL) {
|
||||
PUSH(next);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue