Include length in stats for UNPACK_SEQUENCE. (GH-31254)

This commit is contained in:
Mark Shannon 2022-02-14 10:01:31 +00:00 committed by GitHub
parent 1d6ce67c29
commit 15ee55528e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 8 deletions

View file

@ -2740,10 +2740,10 @@ handle_eval_breaker:
PREDICTED(UNPACK_SEQUENCE);
PyObject *seq = POP(), *item, **items;
#ifdef Py_STATS
extern int _PySpecialization_ClassifySequence(PyObject *);
extern int _PySpecialization_ClassifySequence(PyObject *, int);
_py_stats.opcode_stats[UNPACK_SEQUENCE].specialization.failure++;
_py_stats.opcode_stats[UNPACK_SEQUENCE].specialization.
failure_kinds[_PySpecialization_ClassifySequence(seq)]++;
failure_kinds[_PySpecialization_ClassifySequence(seq, oparg)]++;
#endif
if (PyTuple_CheckExact(seq) &&
PyTuple_GET_SIZE(seq) == oparg) {