Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f9cf3db

Browse filesBrowse files
committed
Add a couple more comments.
1 parent b8d6799 commit f9cf3db
Copy full SHA for f9cf3db

File tree

2 files changed

+5
-0
lines changed
Filter options

2 files changed

+5
-0
lines changed

‎Python/ceval.c

Copy file name to clipboardExpand all lines: Python/ceval.c
+2Lines changed: 2 additions & 0 deletions
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

Copy file name to clipboardExpand all lines: Python/instrumentation.c
+3Lines changed: 3 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.