GH-107265: Add missing deoptimizations for ENTER_EXECUTOR's original opcode (GH-109420)

This commit is contained in:
Tian Gao 2023-09-22 14:13:31 -07:00 committed by GitHub
parent 8ded34a1ff
commit d5611f2804
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -0,0 +1 @@
Deopt opcodes hidden by the executor when base opcode is needed

View 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);

View 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);