From b0c7fb399e2c1fb51f717aad5e8414c315e52a48 Mon Sep 17 00:00:00 2001 From: Tian Gao Date: Thu, 14 Sep 2023 13:00:15 -0700 Subject: [PATCH 1/3] Add deopt for opcode from executor for future proof --- Python/instrumentation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/instrumentation.c b/Python/instrumentation.c index 0768c82ba29882..029cbff89ce8da 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); From 7ae11ee784cf4b36a65c3381939f3ad47fbca56c Mon Sep 17 00:00:00 2001 From: Tian Gao Date: Thu, 14 Sep 2023 13:10:17 -0700 Subject: [PATCH 2/3] Add codeobject --- Objects/codeobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 20e5dedb22826f..f662b8e354bb1e 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); From 18944e0ff563e74b061b2df074e733691be11dbe Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Thu, 14 Sep 2023 20:15:59 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2023-09-14-20-15-57.gh-issue-107265.qHZL_6.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2023-09-14-20-15-57.gh-issue-107265.qHZL_6.rst 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 00000000000000..c30c21f034a1bc --- /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