-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-134728: Don't deopt due to eval breaker in _TIER2_RESUME_CHECK
#134729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Handle ``_TIER2_RESUME_CHECK`` in the JIT. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5392,15 +5392,16 @@ dummy_func( | |
GOTO_TIER_ONE(NULL); | ||
} | ||
|
||
/* Progress is guaranteed if we DEOPT on the eval breaker, because | ||
* ENTER_EXECUTOR will not re-enter tier 2 with the eval breaker set. */ | ||
tier2 op(_TIER2_RESUME_CHECK, (--)) { | ||
#if defined(__EMSCRIPTEN__) | ||
DEOPT_IF(_Py_emscripten_signal_clock == 0); | ||
_Py_emscripten_signal_clock -= Py_EMSCRIPTEN_SIGNAL_HANDLING; | ||
#endif | ||
uintptr_t eval_breaker = _Py_atomic_load_uintptr_relaxed(&tstate->eval_breaker); | ||
DEOPT_IF(eval_breaker & _PY_EVAL_EVENTS_MASK); | ||
if (eval_breaker & _PY_EVAL_EVENTS_MASK) { | ||
int err = _Py_HandlePending(tstate); | ||
ERROR_IF(err != 0); | ||
} | ||
Comment on lines
+5401
to
+5404
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just throwing this out there since I don't yet know enough about these specific instructions, but with this change, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possibly could replace _TIER2_RESUME_CHECK with _CHECK_PERIODIC. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok I think maybe not, the assertions in TIER2_RESUME_CHECK are different. |
||
assert(tstate->tracing || eval_breaker == FT_ATOMIC_LOAD_UINTPTR_ACQUIRE(_PyFrame_GetCode(frame)->_co_instrumentation_version)); | ||
} | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.