mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-106581: Fix instrumentation in tier 2 (GH-108493)
This commit is contained in:
parent
5f41376e93
commit
4eae1e5342
4 changed files with 20 additions and 12 deletions
|
@ -0,0 +1,2 @@
|
|||
Fix possible assertion failures and missing instrumentation events when
|
||||
:envvar:`PYTHONUOPS` or :option:`-X uops <-X>` is enabled.
|
|
@ -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--;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (oparg < 2) {
|
||||
#if TIER_TWO
|
||||
goto deoptimize;
|
||||
#endif
|
||||
}
|
||||
else if (oparg < 2) {
|
||||
CHECK_EVAL_BREAKER();
|
||||
}
|
||||
}
|
||||
|
|
10
Python/executor_cases.c.h
generated
10
Python/executor_cases.c.h
generated
|
@ -8,17 +8,19 @@
|
|||
}
|
||||
|
||||
case 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);
|
||||
if (err) goto error;
|
||||
#if TIER_ONE
|
||||
next_instr--;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (oparg < 2) {
|
||||
#if TIER_TWO
|
||||
goto deoptimize;
|
||||
#endif
|
||||
}
|
||||
else if (oparg < 2) {
|
||||
CHECK_EVAL_BREAKER();
|
||||
}
|
||||
break;
|
||||
|
|
10
Python/generated_cases.c.h
generated
10
Python/generated_cases.c.h
generated
|
@ -8,17 +8,19 @@
|
|||
}
|
||||
|
||||
TARGET(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);
|
||||
if (err) goto error;
|
||||
#if TIER_ONE
|
||||
next_instr--;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (oparg < 2) {
|
||||
#if TIER_TWO
|
||||
goto deoptimize;
|
||||
#endif
|
||||
}
|
||||
else if (oparg < 2) {
|
||||
CHECK_EVAL_BREAKER();
|
||||
}
|
||||
DISPATCH();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue