aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-07-26 12:24:12 +0100
committerGitHub <noreply@github.com>2024-07-26 12:24:12 +0100
commitafb0aa6ed20bd8e982ecb307f12923cf8dbccd8c (patch)
tree222f3075796f8167442bcc744c52efe3c7c8eaa5 /Python/ceval.c
parentd9efa45d7457b0dfea467bb1c2d22c69056ffc73 (diff)
downloadcpython-afb0aa6ed20bd8e982ecb307f12923cf8dbccd8c.tar.gz
cpython-afb0aa6ed20bd8e982ecb307f12923cf8dbccd8c.zip
GH-121131: Clean up and fix some instrumented instructions. (GH-121132)
* Add support for 'prev_instr' to code generator and refactor some INSTRUMENTED instructions
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 1e911d3ba17..c0074c45b27 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -835,46 +835,6 @@ resume_frame:
#include "generated_cases.c.h"
- /* INSTRUMENTED_LINE has to be here, rather than in bytecodes.c,
- * because it needs to capture frame->instr_ptr before it is updated,
- * as happens in the standard instruction prologue.
- */
-#if USE_COMPUTED_GOTOS
- TARGET_INSTRUMENTED_LINE:
-#else
- case INSTRUMENTED_LINE:
-#endif
- {
- _Py_CODEUNIT *prev = frame->instr_ptr;
- _Py_CODEUNIT *here = frame->instr_ptr = next_instr;
- int original_opcode = 0;
- if (tstate->tracing) {
- PyCodeObject *code = _PyFrame_GetCode(frame);
- original_opcode = code->_co_monitoring->lines[(int)(here - _PyCode_CODE(code))].original_opcode;
- } else {
- _PyFrame_SetStackPointer(frame, stack_pointer);
- original_opcode = _Py_call_instrumentation_line(
- tstate, frame, here, prev);
- stack_pointer = _PyFrame_GetStackPointer(frame);
- if (original_opcode < 0) {
- next_instr = here+1;
- goto error;
- }
- next_instr = frame->instr_ptr;
- if (next_instr != here) {
- DISPATCH();
- }
- }
- if (_PyOpcode_Caches[original_opcode]) {
- _PyBinaryOpCache *cache = (_PyBinaryOpCache *)(next_instr+1);
- /* Prevent the underlying instruction from specializing
- * and overwriting the instrumentation. */
- PAUSE_ADAPTIVE_COUNTER(cache->counter);
- }
- opcode = original_opcode;
- DISPATCH_GOTO();
- }
-
#if USE_COMPUTED_GOTOS
_unknown_opcode: