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 — Remove irregular stack effects · Issue #105678 · python/cpython

Remove irregular stack effects #105678

New issue
Copy link
New issue
Copy link
Closed
Closed
Remove irregular stack effects#105678
Copy link
Labels
performancePerformance or resource usagePerformance or resource usage

Description

@markshannon
markshannon
opened on Jun 12, 2023
Issue body actions

As we move towards generating more components from the instruction definition file (bytecodes.c), it helps if the instructions have regular formats and stack effects.
Currently the stack effects can be simple, variable, conditional or complex.

  • Simple: Does not depend on the operand (oparg)
  • Variable: Either pops or pushes oparg * k items.
  • Conditional: Pushes a value conditional on oparg & 1
  • Complex: The stack effect depends on a set of flags embedded in oparg.

We can easily get rid of the complex case. There are only two cases, MAKE_FUNCTION and FORMAT_VALUE. Both can easily broken down into simple (and faster) parts.

We might want to get rid of condition stack effects, as it would simplify things, but performance may suffer as both LOAD_GLOBAL and LOAD_ATTR are conditional and they are performance critical.

Linked PRs

  • GH-105678: Split MAKE_FUNCTION into MAKE_FUNCTION and SET_FUNCTION_ATTRIBUTE #105680
  • gh-105678: document SET_FUNCTION_ATTRIBUTE #105843

Activity

  1. markshannon
    added
    performancePerformance or resource usagePerformance or resource usage
    on Jun 12, 2023
  2. markshannon
    changed the title [-]Remove irregular opargs[/-] [+]Remove irregular stack effects[/+] on Jun 12, 2023
  3. markshannon
    added a commit that references this issue on Jun 13, 2023

    GH-105678: Split MAKE_FUNCTION into MAKE_FUNCTION and SET_FUNCTION_AT…

    09ffa69
  4. carljm
    added 2 commits that reference this issue on Jun 16, 2023

    pythongh-105678: document SET_FUNCTION_ATTRIBUTE

    518e991

    gh-105678: document SET_FUNCTION_ATTRIBUTE (#105843)

    b356a47
  5. gvanrossum
    added a commit that references this issue on Jun 18, 2023

    pythongh-105678: document SET_FUNCTION_ATTRIBUTE (python#105843)

    ca53b70
  6. gvanrossum commented on Jun 18, 2023

    @gvanrossum
    gvanrossum
    on Jun 18, 2023
    Member
    More actions

    @markshannon Can this be closed yet? I doubt that we'll be removing conditional stack effects (at least conditional pushes). Note that we now support conditional pushes in the final op of a macro. (If needed the same approach could be used to support conditional pops in the first op.)

  7. markshannon commented on Jun 19, 2023

    @markshannon
    markshannon
    on Jun 19, 2023
    MemberAuthor
    More actions

    Yes, this can be closed.
    We might want to remove conditional stack effects in the future, but not now.

  8. markshannon
    closed this as completedon Jun 19, 2023
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

    performancePerformance or resource usagePerformance or resource usage

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — 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.