]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-107265: Add missing deoptimizations for ENTER_EXECUTOR's original opcode (GH-109420)
authorTian Gao <gaogaotiantian@hotmail.com>
Fri, 22 Sep 2023 21:13:31 +0000 (14:13 -0700)
committerGitHub <noreply@github.com>
Fri, 22 Sep 2023 21:13:31 +0000 (14:13 -0700)
Misc/NEWS.d/next/Core and Builtins/2023-09-14-20-15-57.gh-issue-107265.qHZL_6.rst [new file with mode: 0644]
Objects/codeobject.c
Python/instrumentation.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-09-14-20-15-57.gh-issue-107265.qHZL_6.rst b/Misc/NEWS.d/next/Core and Builtins/2023-09-14-20-15-57.gh-issue-107265.qHZL_6.rst
new file mode 100644 (file)
index 0000000..c30c21f
--- /dev/null
@@ -0,0 +1 @@
+Deopt opcodes hidden by the executor when base opcode is needed
index 20e5dedb22826f03b5ec9e9ad58b3896d00871f3..f662b8e354bb1e11d8283bfb83c9d8ab6d057ace 100644 (file)
@@ -1505,7 +1505,7 @@ deopt_code(PyCodeObject *code, _Py_CODEUNIT *instructions)
         int opcode = _Py_GetBaseOpcode(code, i);
         if (opcode == ENTER_EXECUTOR) {
             _PyExecutorObject *exec = code->co_executors->executors[instructions[i].op.arg];
-            opcode = exec->vm_data.opcode;
+            opcode = _PyOpcode_Deopt[exec->vm_data.opcode];
             instructions[i].op.arg = exec->vm_data.oparg;
         }
         assert(opcode != ENTER_EXECUTOR);
index df8943b1f9a7212886da0f7532c42c88c54a6ab3..0b974f6133ce7d29afa00393fe147dd0fe80a7b7 100644 (file)
@@ -306,7 +306,7 @@ _PyInstruction_GetLength(PyCodeObject *code, int offset)
     if (opcode == ENTER_EXECUTOR) {
         int exec_index = _PyCode_CODE(code)[offset].op.arg;
         _PyExecutorObject *exec = code->co_executors->executors[exec_index];
-        opcode = exec->vm_data.opcode;
+        opcode = _PyOpcode_Deopt[exec->vm_data.opcode];
 
     }
     assert(opcode != ENTER_EXECUTOR);