mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-116168: Remove extra _CHECK_STACK_SPACE
uops (#117242)
This merges all `_CHECK_STACK_SPACE` uops in a trace into a single `_CHECK_STACK_SPACE_OPERAND` uop that checks whether there is enough stack space for all calls included in the entire trace.
This commit is contained in:
parent
976bcb2379
commit
1c43468886
8 changed files with 493 additions and 125 deletions
8
Python/executor_cases.c.h
generated
8
Python/executor_cases.c.h
generated
|
@ -3592,6 +3592,14 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _CHECK_STACK_SPACE_OPERAND: {
|
||||
uint32_t framesize = (uint32_t)CURRENT_OPERAND();
|
||||
assert(framesize <= INT_MAX);
|
||||
if (!_PyThreadState_HasStackSpace(tstate, framesize)) JUMP_TO_JUMP_TARGET();
|
||||
if (tstate->py_recursion_remaining <= 1) JUMP_TO_JUMP_TARGET();
|
||||
break;
|
||||
}
|
||||
|
||||
case _SAVE_RETURN_OFFSET: {
|
||||
oparg = CURRENT_OPARG();
|
||||
#if TIER_ONE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue