summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTian Gao <gaogaotiantian@hotmail.com>2023-09-22 21:13:31 (GMT)
committerGitHub <noreply@github.com>2023-09-22 21:13:31 (GMT)
commitd5611f280403d19befe4a3e505b037d286cf798e (patch)
tree468f1560b4e67a67a579b98c9cc0dfd26bad47ce
parent8ded34a1ff2d355e95213ab72493908f2ca25dd9 (diff)
downloadcpython-d5611f280403d19befe4a3e505b037d286cf798e.zip
cpython-d5611f280403d19befe4a3e505b037d286cf798e.tar.gz
cpython-d5611f280403d19befe4a3e505b037d286cf798e.tar.bz2
GH-107265: Add missing deoptimizations for ENTER_EXECUTOR's original opcode (GH-109420)
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2023-09-14-20-15-57.gh-issue-107265.qHZL_6.rst1
-rw-r--r--Objects/codeobject.c2
-rw-r--r--Python/instrumentation.c2
3 files changed, 3 insertions, 2 deletions
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
index 0000000..c30c21f
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2023-09-14-20-15-57.gh-issue-107265.qHZL_6.rst
@@ -0,0 +1 @@
+Deopt opcodes hidden by the executor when base opcode is needed
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index 20e5ded..f662b8e 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -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);
diff --git a/Python/instrumentation.c b/Python/instrumentation.c
index df8943b..0b974f6 100644
--- a/Python/instrumentation.c
+++ b/Python/instrumentation.c
@@ -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);