Skip to content

Commit

Permalink
GH-106581: Fix instrumentation in tier 2 (GH-108493)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher authored Aug 25, 2023
1 parent 5f41376 commit 4eae1e5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix possible assertion failures and missing instrumentation events when
:envvar:`PYTHONUOPS` or :option:`-X uops <-X>` is enabled.
10 changes: 6 additions & 4 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,19 @@ dummy_func(
}

inst(RESUME, (--)) {
#if TIER_ONE
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
#endif
if (oparg < 2) {
else if (oparg < 2) {
CHECK_EVAL_BREAKER();
}
}
Expand Down
10 changes: 6 additions & 4 deletions Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4eae1e5

Please sign in to comment.