You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function _Py_GetBaseOpcode returns the original opcode for an instruction, even if that instruction has been instrumented.
However it doesn't work for ENTER_EXECUTOR and doesn't allow for the op.arg to have been changed.
We should add a new _Py_GetBaseInstruction which handles ENTER_EXECUTOR as well, and is efficient enough to use in the few places where it is used outside of an assert, such as in is_resume which is used in gen_close.
The new API will be either
_Py_CODEUNIT _Py_GetBaseInstruction(PyCodeObject *code, int i)
The function
_Py_GetBaseOpcodereturns the original opcode for an instruction, even if that instruction has been instrumented.However it doesn't work for
ENTER_EXECUTORand doesn't allow for theop.argto have been changed.We should add a new
_Py_GetBaseInstructionwhich handlesENTER_EXECUTORas well, and is efficient enough to use in the few places where it is used outside of an assert, such as inis_resumewhich is used ingen_close.The new API will be either
or
depending on which is the most convenient for the current use cases.
Linked PRs
_Py_GetbaseOpcodewith_Py_GetBaseCodeUnit#122942