summaryrefslogtreecommitdiffstats
path: root/Include/internal
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-03-15 10:48:00 (GMT)
committerGitHub <noreply@github.com>2024-03-15 10:48:00 (GMT)
commit2cf18a44303b6d84faa8ecffaecc427b53ae121e (patch)
tree944935198b1935d61091b1e40681720de4177dd8 /Include/internal
parenta50cf6c3d76b34e2ee9f92a248f1b0df24e407f6 (diff)
downloadcpython-2cf18a44303b6d84faa8ecffaecc427b53ae121e.zip
cpython-2cf18a44303b6d84faa8ecffaecc427b53ae121e.tar.gz
cpython-2cf18a44303b6d84faa8ecffaecc427b53ae121e.tar.bz2
GH-116422: Modify a few uops so that they can be supported by tier 2 with hot/cold splitting (GH-116832)
Diffstat (limited to 'Include/internal')
-rw-r--r--Include/internal/pycore_ceval.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h
index 6eab2ba..946f82a 100644
--- a/Include/internal/pycore_ceval.h
+++ b/Include/internal/pycore_ceval.h
@@ -138,12 +138,12 @@ extern void _PyEval_DeactivateOpCache(void);
/* With USE_STACKCHECK macro defined, trigger stack checks in
_Py_CheckRecursiveCall() on every 64th call to _Py_EnterRecursiveCall. */
static inline int _Py_MakeRecCheck(PyThreadState *tstate) {
- return (tstate->c_recursion_remaining-- <= 0
+ return (tstate->c_recursion_remaining-- < 0
|| (tstate->c_recursion_remaining & 63) == 0);
}
#else
static inline int _Py_MakeRecCheck(PyThreadState *tstate) {
- return tstate->c_recursion_remaining-- <= 0;
+ return tstate->c_recursion_remaining-- < 0;
}
#endif
@@ -161,6 +161,11 @@ static inline int _Py_EnterRecursiveCallTstate(PyThreadState *tstate,
return (_Py_MakeRecCheck(tstate) && _Py_CheckRecursiveCall(tstate, where));
}
+static inline void _Py_EnterRecursiveCallTstateUnchecked(PyThreadState *tstate) {
+ assert(tstate->c_recursion_remaining > 0);
+ tstate->c_recursion_remaining--;
+}
+
static inline int _Py_EnterRecursiveCall(const char *where) {
PyThreadState *tstate = _PyThreadState_GET();
return _Py_EnterRecursiveCallTstate(tstate, where);