summaryrefslogtreecommitdiffstats
path: root/Python/executor_cases.c.h
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-04-29 06:54:05 (GMT)
committerGitHub <noreply@github.com>2024-04-29 06:54:05 (GMT)
commitab6eda0ee59587e84cb417dd84452b9c6845434c (patch)
treea8b35575dc02021f8e043926023763895b477cf9 /Python/executor_cases.c.h
parentaa8f6d2708bce1462544d2e2cae05a2595ffd9ec (diff)
downloadcpython-ab6eda0ee59587e84cb417dd84452b9c6845434c.zip
cpython-ab6eda0ee59587e84cb417dd84452b9c6845434c.tar.gz
cpython-ab6eda0ee59587e84cb417dd84452b9c6845434c.tar.bz2
GH-118095: Allow a variant of RESUME_CHECK in tier 2 (GH-118286)
Diffstat (limited to 'Python/executor_cases.c.h')
-rw-r--r--Python/executor_cases.c.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h
index 280cca1..2d9acfe 100644
--- a/Python/executor_cases.c.h
+++ b/Python/executor_cases.c.h
@@ -4295,4 +4295,31 @@
break;
}
+ case _TIER2_RESUME_CHECK: {
+ #if defined(__EMSCRIPTEN__)
+ if (_Py_emscripten_signal_clock == 0) {
+ UOP_STAT_INC(uopcode, miss);
+ JUMP_TO_JUMP_TARGET();
+ }
+ _Py_emscripten_signal_clock -= Py_EMSCRIPTEN_SIGNAL_HANDLING;
+ #endif
+ uintptr_t eval_breaker = _Py_atomic_load_uintptr_relaxed(&tstate->eval_breaker);
+ if (eval_breaker & _PY_EVAL_EVENTS_MASK) {
+ UOP_STAT_INC(uopcode, miss);
+ JUMP_TO_JUMP_TARGET();
+ }
+ assert(eval_breaker == FT_ATOMIC_LOAD_UINTPTR_ACQUIRE(_PyFrame_GetCode(frame)->_co_instrumentation_version));
+ break;
+ }
+
+ case _EVAL_BREAKER_EXIT: {
+ _Py_CHECK_EMSCRIPTEN_SIGNALS_PERIODICALLY();
+ QSBR_QUIESCENT_STATE(tstate);
+ if (_Py_HandlePending(tstate) != 0) {
+ GOTO_UNWIND();
+ }
+ EXIT_TO_TRACE();
+ break;
+ }
+
#undef TIER_TWO