https://github.com/python/cpython/commit/59eee399a80df1307f6ad1a6b029c7580981fd89
commit: 59eee399a80df1307f6ad1a6b029c7580981fd89
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: ngoldbaum <[email protected]>
date: 2026-11-12T07:15:48-07:00
summary:
[3.14] gh-161827: Mark `_PyEval_EvalFrameDefault` as `Py_NO_INLINE` (GH-161829)
(#161834)
files:
A
Misc/NEWS.d/next/Core_and_Builtins/2026-11-11-21-52-02.gh-issue-161827.3PD3RK.rst
M Python/ceval.c
diff --git
a/Misc/NEWS.d/next/Core_and_Builtins/2026-11-11-21-52-02.gh-issue-161827.3PD3RK.rst
b/Misc/NEWS.d/next/Core_and_Builtins/2026-11-11-21-52-02.gh-issue-161827.3PD3RK.rst
new file mode 100644
index 00000000000000..2ae6517db14f15
--- /dev/null
+++
b/Misc/NEWS.d/next/Core_and_Builtins/2026-11-11-21-52-02.gh-issue-161827.3PD3RK.rst
@@ -0,0 +1,4 @@
+Keep ``_PyEval_EvalFrameDefault`` as a separate frame in the C call stack
+when Python is built with the tail-calling interpreter
+(:option:`--with-tail-call-interp`), so that stack unwinders, profilers and
+other tools that walk the stack can find the interpreter loop.
diff --git a/Python/ceval.c b/Python/ceval.c
index c0b22613a07445..8d2d127bfacea0 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1150,7 +1150,13 @@ typedef struct {
_PyStackRef stack[1];
} _PyEntryFrame;
-PyObject* _Py_HOT_FUNCTION DONT_SLP_VECTORIZE
+/*
+ * _PyEval_EvalFrameDefault must remain a separate frame in the C call stack:
+ * stack unwinders, profilers and other tools that walk the stack use it to
+ * find the interpreter loop. With the tail-calling interpreter it is small
+ * enough to be inlined into its callers, e.g. by Clang with PGO.
+ */
+Py_NO_INLINE PyObject* _Py_HOT_FUNCTION DONT_SLP_VECTORIZE
_PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame,
int throwflag)
{
_Py_EnsureTstateNotNULL(tstate);
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]