gh-107674: Improve performance of sys.settrace (GH-114986)

This commit is contained in:
Tian Gao 2024-02-28 07:21:42 -08:00 committed by GitHub
parent 9578288a3e
commit 0a61e23700
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 64 additions and 53 deletions

View file

@ -20,7 +20,7 @@
uintptr_t eval_breaker = _Py_atomic_load_uintptr_relaxed(&tstate->eval_breaker);
uintptr_t version = _PyFrame_GetCode(frame)->_co_instrumentation_version;
assert((version & _PY_EVAL_EVENTS_MASK) == 0);
if (eval_breaker != version) goto deoptimize;
if (eval_breaker != version && tstate->tracing == 0) goto deoptimize;
break;
}