diff options
author | Brandt Bucher <brandtbucher@microsoft.com> | 2023-08-25 19:12:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-25 19:12:59 (GMT) |
commit | 4eae1e53425d3a816a26760f28d128a4f05c1da4 (patch) | |
tree | b75367832f4000daea61bf066b21eaece5a2858f /Python | |
parent | 5f41376e93cdeb1a4714b0f08b5921b69e345dd6 (diff) | |
download | cpython-4eae1e53425d3a816a26760f28d128a4f05c1da4.zip cpython-4eae1e53425d3a816a26760f28d128a4f05c1da4.tar.gz cpython-4eae1e53425d3a816a26760f28d128a4f05c1da4.tar.bz2 |
GH-106581: Fix instrumentation in tier 2 (GH-108493)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/bytecodes.c | 10 | ||||
-rw-r--r-- | Python/executor_cases.c.h | 10 | ||||
-rw-r--r-- | Python/generated_cases.c.h | 10 |
3 files changed, 18 insertions, 12 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c index a5cb117..a55460a 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -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(); } } diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index 85c60c2..1283cc7 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -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--; + #endif + #if TIER_TWO + goto deoptimize; + #endif } - else - #endif - if (oparg < 2) { + else if (oparg < 2) { CHECK_EVAL_BREAKER(); } break; diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 4aa16f8..3f46f1a 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -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--; + #endif + #if TIER_TWO + goto deoptimize; + #endif } - else - #endif - if (oparg < 2) { + else if (oparg < 2) { CHECK_EVAL_BREAKER(); } DISPATCH(); |