mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
GH-103082: Filter LINE events in VM, to simplify tool implementation. (GH-104387)
When monitoring LINE events, instrument all instructions that can have a predecessor on a different line. Then check that the a new line has been hit in the instrumentation code. This brings the behavior closer to that of 3.11, simplifying implementation and porting of tools.
This commit is contained in:
parent
19ee53d52e
commit
45f5aa8fc7
16 changed files with 255 additions and 161 deletions
|
@ -367,8 +367,6 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) {
|
|||
return 2;
|
||||
case SWAP:
|
||||
return (oparg-2) + 2;
|
||||
case INSTRUMENTED_LINE:
|
||||
return 0;
|
||||
case INSTRUMENTED_INSTRUCTION:
|
||||
return 0;
|
||||
case INSTRUMENTED_JUMP_FORWARD:
|
||||
|
@ -759,8 +757,6 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) {
|
|||
return 1;
|
||||
case SWAP:
|
||||
return (oparg-2) + 2;
|
||||
case INSTRUMENTED_LINE:
|
||||
return 0;
|
||||
case INSTRUMENTED_INSTRUCTION:
|
||||
return 0;
|
||||
case INSTRUMENTED_JUMP_FORWARD:
|
||||
|
@ -976,7 +972,6 @@ const struct opcode_metadata _PyOpcode_opcode_metadata[256] = {
|
|||
[COPY] = { true, INSTR_FMT_IB },
|
||||
[BINARY_OP] = { true, INSTR_FMT_IBC },
|
||||
[SWAP] = { true, INSTR_FMT_IB },
|
||||
[INSTRUMENTED_LINE] = { true, INSTR_FMT_IX },
|
||||
[INSTRUMENTED_INSTRUCTION] = { true, INSTR_FMT_IX },
|
||||
[INSTRUMENTED_JUMP_FORWARD] = { true, INSTR_FMT_IB },
|
||||
[INSTRUMENTED_JUMP_BACKWARD] = { true, INSTR_FMT_IB },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue