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

GH-131498: manage stacks automatically#132074

Merged
markshannon merged 10 commits into
python:mainpython/cpython:mainfrom
faster-cpython:code-gen-handle-stacksfaster-cpython/cpython:code-gen-handle-stacksCopy head branch name to clipboard
Apr 4, 2025
Merged

GH-131498: manage stacks automatically#132074
markshannon merged 10 commits into
python:mainpython/cpython:mainfrom
faster-cpython:code-gen-handle-stacksfaster-cpython/cpython:code-gen-handle-stacksCopy head branch name to clipboard

Conversation

@markshannon

@markshannon markshannon commented Apr 4, 2025

Copy link
Copy Markdown
Member

This is the final preparatory PR for top-of-stack caching

This PR:

  • Removes the stack manipulation macros. Instructions must declare values as dead, and let the code generator pop them from the stack
  • Updates the instrumented instructions to be explicit about their stack effect
  • Supports mixing of scalars and arrays on the stack. The code generator pushes scalars to memory if needed for an array.

Comment thread Python/bytecodes.c Outdated
Comment thread Python/stackrefs.c Outdated
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@markshannon

markshannon commented Apr 4, 2025

Copy link
Copy Markdown
Member Author

The MSVC tail calling interpreter failure seems unrelated to this PR.

@markshannon markshannon merged commit 7099c75 into python:main Apr 4, 2025
@markshannon markshannon deleted the code-gen-handle-stacks branch April 4, 2025 17:09
picnixz pushed a commit to picnixz/cpython that referenced this pull request Apr 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

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