[Python-checkins] gh-104584: Replace ENTER_EXECUTOR with the original in trace projection (#106526)

gvanrossum webhook-mailer at python.org
Fri Jul 7 14:41:45 EDT 2023


https://github.com/python/cpython/commit/80b9b3a51757ebb1e3547afc349a229706eadfde
commit: 80b9b3a51757ebb1e3547afc349a229706eadfde
branch: main
author: Guido van Rossum <guido at python.org>
committer: gvanrossum <gvanrossum at gmail.com>
date: 2023-07-07T11:41:42-07:00
summary:

gh-104584: Replace ENTER_EXECUTOR with the original in trace projection (#106526)

files:
M Python/optimizer.c

diff --git a/Python/optimizer.c b/Python/optimizer.c
index 2870f2fd05052..1d731ed2309c3 100644
--- a/Python/optimizer.c
+++ b/Python/optimizer.c
@@ -419,6 +419,12 @@ translate_bytecode_to_trace(
             opcode = instr->op.code;
             oparg = (oparg << 8) | instr->op.arg;
         }
+        if (opcode == ENTER_EXECUTOR) {
+            _PyExecutorObject *executor = (_PyExecutorObject *)code->co_executors->executors[oparg&255];
+            opcode = executor->vm_data.opcode;
+            DPRINTF(2, "  * ENTER_EXECUTOR -> %s\n",  _PyOpcode_OpName[opcode]);
+            oparg = (oparg & 0xffffff00) | executor->vm_data.oparg;
+        }
         switch (opcode) {
             default:
             {



More information about the Python-checkins mailing list