Skip to content

GH-131498: Another refactoring of the code generator #131827

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

Merged
merged 18 commits into from
Mar 31, 2025

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Mar 28, 2025

The main change in this refactoring is to replace the mutable StackOffset with an immutable PointerOffset.

The new class fills much the same role.
We use these offsets like numerical values, so making them immutable makes the code more robust and a bit simpler.

There is no change to the generated code, apart from a few variable declarations that get reordered.

@markshannon markshannon merged commit c535a13 into python:main Mar 31, 2025
71 checks passed
@markshannon markshannon deleted the code-gen-refactor-again branch March 31, 2025 14:54
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
…131827)

* Rename 'defined' attribute to 'in_local' to more accurately reflect how it is used

* Make death of variables explicit even for array variables.

* Convert in_memory from boolean to stack offset

* Don't apply liveness analyis to optimizer generated code

* Add 'out' parameter to stack.pop
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