Skip to content

Commit f9cf3db

Browse files
committed
Add a couple more comments.
1 parent b8d6799 commit f9cf3db

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Python/ceval.c

+2
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,8 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
801801
}
802802
if (_PyOpcode_Caches[original_opcode]) {
803803
_PyBinaryOpCache *cache = (_PyBinaryOpCache *)(next_instr+1);
804+
/* Prevent the underlying instruction from specializing
805+
* and overwriting the instrumentation. */
804806
INCREMENT_ADAPTIVE_COUNTER(cache->counter);
805807
}
806808
opcode = original_opcode;

Python/instrumentation.c

+3
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,9 @@ _Py_call_instrumentation_line(PyThreadState *tstate, _PyInterpreterFrame* frame,
11081108
int prev_line = _Py_Instrumentation_GetLine(code, prev_index);
11091109
if (prev_line == line) {
11101110
int prev_opcode = _PyCode_CODE(code)[prev_index].op.code;
1111+
/* RESUME and INSTRUMENTED_RESUME are needed for the operation of
1112+
* instrumentation, so must never be hidden by an INSTRUMENTED_LINE.
1113+
*/
11111114
if (prev_opcode != RESUME && prev_opcode != INSTRUMENTED_RESUME) {
11121115
goto done;
11131116
}

0 commit comments

Comments
 (0)