GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Improve internal API for fetching original instruction, replacing `_Py_GetBaseOpcode` · Issue #122390 · python/cpython

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

New issue
Copy link
New issue
Copy link
Closed
Closed
Improve internal API for fetching original instruction, replacing _Py_GetBaseOpcode#122390
Copy link
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)

Description

@markshannon
markshannon
opened on Jul 29, 2024
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

  • GH-122390: Replace _Py_GetbaseOpcode with _Py_GetBaseCodeUnit #122942

Activity

  1. Eclips4
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on Jul 29, 2024
  2. markshannon
    added a commit that references this issue on Aug 13, 2024

    GH-122390: Replace `_Py_GetbaseOpcode` with `_Py_GetBaseCodeUnit` (GH…

    7a65439
  3. markshannon
    closed this as completedon Aug 14, 2024
  4. blhsing
    added a commit that references this issue on Aug 22, 2024

    pythonGH-122390: Replace `_Py_GetbaseOpcode` with `_Py_GetBaseCodeUni…

    03a8301
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.