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
|
@ -4094,6 +4094,12 @@ dummy_func(
|
|||
frame->instr_ptr = (_Py_CODEUNIT *)instr_ptr;
|
||||
}
|
||||
|
||||
tier2 op(_CHECK_STACK_SPACE_OPERAND, (framesize/2 --)) {
|
||||
assert(framesize <= INT_MAX);
|
||||
DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, framesize));
|
||||
DEOPT_IF(tstate->py_recursion_remaining <= 1);
|
||||
}
|
||||
|
||||
op(_SAVE_RETURN_OFFSET, (--)) {
|
||||
#if TIER_ONE
|
||||
frame->return_offset = (uint16_t)(next_instr - this_instr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue