summaryrefslogtreecommitdiffstats
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r--Python/bytecodes.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index fae1da3..8820b52 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -132,24 +132,37 @@ dummy_func(
inst(NOP, (--)) {
}
+ family(RESUME, 0) = {
+ RESUME_CHECK,
+ };
+
inst(RESUME, (--)) {
+ TIER_ONE_ONLY
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);
ERROR_IF(err, error);
- #if TIER_ONE
next_instr--;
- #endif
- #if TIER_TWO
- goto deoptimize;
- #endif
}
- else if (oparg < 2) {
- CHECK_EVAL_BREAKER();
+ else {
+ if (oparg < 2) {
+ CHECK_EVAL_BREAKER();
+ }
+ next_instr[-1].op.code = RESUME_CHECK;
}
}
+ inst(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);
+ }
+
inst(INSTRUMENTED_RESUME, (--)) {
/* Possible performance enhancement:
* We need to check the eval breaker anyway, can we