diff options
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r-- | Python/bytecodes.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 7f398391c5d..fae1da31875 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -2974,6 +2974,7 @@ dummy_func( PyFunctionObject *func = (PyFunctionObject *)callable; PyCodeObject *code = (PyCodeObject *)func->func_code; DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, code->co_framesize), CALL); + DEOPT_IF(tstate->py_recursion_remaining <= 1, CALL); } op(_INIT_CALL_PY_EXACT_ARGS, (callable, self_or_null, args[oparg] -- new_frame: _PyInterpreterFrame*)) { @@ -2998,18 +2999,19 @@ dummy_func( // Eventually this should be the only occurrence of this code. frame->return_offset = 0; assert(tstate->interp->eval_frame == NULL); - _PyFrame_SetStackPointer(frame, stack_pointer); + STORE_SP(); new_frame->previous = frame; CALL_STAT_INC(inlined_py_calls); frame = tstate->current_frame = new_frame; - #if TIER_ONE - goto start_frame; - #endif - #if TIER_TWO - ERROR_IF(_Py_EnterRecursivePy(tstate), exit_unwind); - stack_pointer = _PyFrame_GetStackPointer(frame); - ip_offset = (_Py_CODEUNIT *)_PyFrame_GetCode(frame)->co_code_adaptive; - #endif + tstate->py_recursion_remaining--; + LOAD_SP(); + LOAD_IP(); +#if LLTRACE && TIER_ONE + lltrace = maybe_lltrace_resume_frame(frame, &entry_frame, GLOBALS()); + if (lltrace < 0) { + goto exit_unwind; + } +#endif } macro(CALL_BOUND_METHOD_EXACT_ARGS) = |