Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-120024: Use pointer for stack pointer #121923

Merged
merged 3 commits into from
Jul 18, 2024

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Jul 17, 2024

To support deferred reference counting, the stack pointer will need to be spilled around many calls.
The current implementation of the stack pointer as an offset from the 0th local will be too slow for that as each spill and reload will need to perform a calculation of the stack pointer from the stacktop or vice-versa.

This PR changes the stacktop offset to stackpointer pointer, so that no calculation is needed for the spill.

Copy link
Member

@Fidget-Spinner Fidget-Spinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even without deferred refcounts, this is a simplification in my eyes (and also brings Tier 1 and Tier 2 representations closer together), so we should do this regardless.

@markshannon markshannon merged commit 169324c into python:main Jul 18, 2024
38 checks passed
@markshannon markshannon deleted the use-pointer-for-stack-pointer branch August 6, 2024 10:13
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.

2 participants