summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-02-03 18:40:56 (GMT)
committerGitHub <noreply@github.com>2022-02-03 18:40:56 (GMT)
commita0401d83720d93cd95ddf25f86874bfbee528722 (patch)
tree35d612e351e0af0de3eea9f59cb7c95f145a6996 /Python/ceval.c
parentda4d4ec1851714bb56a5e8d0c1cd5bf9842b4cee (diff)
downloadcpython-a0401d83720d93cd95ddf25f86874bfbee528722.zip
cpython-a0401d83720d93cd95ddf25f86874bfbee528722.tar.gz
cpython-a0401d83720d93cd95ddf25f86874bfbee528722.tar.bz2
Collect stats for UNPACK_SEQUENCE. (GH-31105)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 3197fe8..b4029d1 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2792,6 +2792,12 @@ handle_eval_breaker:
TARGET(UNPACK_SEQUENCE) {
PREDICTED(UNPACK_SEQUENCE);
PyObject *seq = POP(), *item, **items;
+#ifdef Py_STATS
+ extern int _PySpecialization_ClassifySequence(PyObject *);
+ _py_stats.opcode_stats[UNPACK_SEQUENCE].specialization.failure++;
+ _py_stats.opcode_stats[UNPACK_SEQUENCE].specialization.
+ failure_kinds[_PySpecialization_ClassifySequence(seq)]++;
+#endif
if (PyTuple_CheckExact(seq) &&
PyTuple_GET_SIZE(seq) == oparg) {
items = ((PyTupleObject *)seq)->ob_item;