Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Improve internal API for fetching original instruction, replacing _Py_GetBaseOpcode #122390

Copy link
Copy link
@markshannon

Description

@markshannon
Issue body actions

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)

or

_Py_CODEUNIT _Py_GetBaseInstruction(PyCodeObject *code, _Py_CODEUNIT *)

depending on which is the most convenient for the current use cases.

Linked PRs

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.