summaryrefslogtreecommitdiffstats
path: root/Python/executor.c
diff options
context:
space:
mode:
authorMichael Droettboom <mdboom@gmail.com>2023-10-31 00:02:45 (GMT)
committerGitHub <noreply@github.com>2023-10-31 00:02:45 (GMT)
commit84b4533e8446cbff3325fffe939c87f7120a3ffd (patch)
treedd06a187031f6929c5bf4ba0e49ccac87e5b8ed8 /Python/executor.c
parentc6fe0869ab1d91525f88279f8567461082c0d3ce (diff)
downloadcpython-84b4533e8446cbff3325fffe939c87f7120a3ffd.zip
cpython-84b4533e8446cbff3325fffe939c87f7120a3ffd.tar.gz
cpython-84b4533e8446cbff3325fffe939c87f7120a3ffd.tar.bz2
gh-109329: Count tier2 opcode misses (#110561)
This keeps a separate 'miss' counter for each micro-opcode, incremented whenever a guard uop takes a deoptimization side exit.
Diffstat (limited to 'Python/executor.c')
-rw-r--r--Python/executor.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/executor.c b/Python/executor.c
index bfa7f7e..2884565 100644
--- a/Python/executor.c
+++ b/Python/executor.c
@@ -25,6 +25,7 @@
#undef DEOPT_IF
#define DEOPT_IF(COND, INSTNAME) \
if ((COND)) { \
+ UOP_STAT_INC(INSTNAME, miss); \
goto deoptimize; \
}
@@ -93,7 +94,7 @@ _PyUopExecute(_PyExecutorObject *executor, _PyInterpreterFrame *frame, PyObject
(int)(stack_pointer - _PyFrame_Stackbase(frame)));
pc++;
OPT_STAT_INC(uops_executed);
- UOP_EXE_INC(opcode);
+ UOP_STAT_INC(opcode, execution_count);
#ifdef Py_STATS
trace_uop_execution_counter++;
#endif