mirror of
https://github.com/python/cpython.git
synced 2025-10-27 08:46:53 +00:00
GH-116422: Modify a few uops so that they can be supported by tier 2 with hot/cold splitting (GH-116832)
This commit is contained in:
parent
a50cf6c3d7
commit
2cf18a4430
4 changed files with 52 additions and 55 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue