diff options
author | Mark Shannon <mark@hotpy.org> | 2023-09-07 13:39:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-07 13:39:03 (GMT) |
commit | 0858328ca2457ae95715eb93e347d5c0547bec6f (patch) | |
tree | 35c18050d74c747699f30e9862fd4a63fb14eaa7 /Python/executor_cases.c.h | |
parent | d485551c9d1792ff3539eef1d6374bd4c01dcd5d (diff) | |
download | cpython-0858328ca2457ae95715eb93e347d5c0547bec6f.zip cpython-0858328ca2457ae95715eb93e347d5c0547bec6f.tar.gz cpython-0858328ca2457ae95715eb93e347d5c0547bec6f.tar.bz2 |
GH-108614: Add `RESUME_CHECK` instruction (GH-108630)
Diffstat (limited to 'Python/executor_cases.c.h')
-rw-r--r-- | Python/executor_cases.c.h | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index 0d5606f..f4c526a 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -7,22 +7,15 @@ break; } - case RESUME: { - assert(frame == tstate->current_frame); - /* Possibly combine this with eval breaker */ - if (_PyFrame_GetCode(frame)->_co_instrumentation_version != tstate->interp->monitoring_version) { - int err = _Py_Instrument(_PyFrame_GetCode(frame), tstate->interp); - if (err) goto error; - #if TIER_ONE - next_instr--; - #endif - #if TIER_TWO - goto deoptimize; - #endif - } - else if (oparg < 2) { - CHECK_EVAL_BREAKER(); - } + case RESUME_CHECK: { +#if defined(__EMSCRIPTEN__) + DEOPT_IF(emscripten_signal_clock == 0, RESUME); + emscripten_signal_clock -= Py_EMSCRIPTEN_SIGNAL_HANDLING; +#endif + /* Possibly combine these two checks */ + DEOPT_IF(_PyFrame_GetCode(frame)->_co_instrumentation_version + != tstate->interp->monitoring_version, RESUME); + DEOPT_IF(_Py_atomic_load_relaxed_int32(&tstate->interp->ceval.eval_breaker), RESUME); break; } |