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 — GH-131498: Another refactoring of the code generator by markshannon · Pull Request #131827 · python/cpython

Conversation

@markshannon

@markshannon markshannon commented Mar 28, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

  • Issue: Top-of-stack caching in the interpreter #131498

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
markshannon added 15 commits March 24, 2025 09:51
@markshannon
Remove redundant attribute
45199ae
@markshannon
Rename 'defined' attribute to 'in_local' to more accurately reflect h…
d786146
…ow it is used
@markshannon
Remove unused function
2b21bf9
@markshannon
Make death of variables explicit even for array variables.
66f5826
@markshannon
Remove used 'peeks' attribute
5d6a9f8
@markshannon
Convert in_memory from boolean to stack offset
6e2a189
@markshannon
Don't apply liveness analyis to optimizer generated code
417c96d
@markshannon
Fix RETURN_VALUE in optimizer
05a4daa
@markshannon
Fix up type annotations
b8c3a9e
@markshannon
Fixup NULLing out array items during DECREF_INPUTS
d81c7de
@markshannon
Cleanup errors
af5f616
@markshannon
Update test output to reflect fix
9238a67
@markshannon
Cases gen refactoring.
f80764f
@markshannon
Merge branch 'main' into code-gen-refactor-again
fbad220
@markshannon
Add 'out' parameter to stack.pop
ba3979d
@markshannon markshannon added the skip news label Mar 28, 2025
@bedevere-app bedevere-app Bot added the awaiting core review label Mar 28, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Mar 28, 2025
Top-of-stack caching in the interpreter #131498
Closed
markshannon added 2 commits March 30, 2025 09:55
@markshannon
Don't declare unused variables and update test
e38eab4
@markshannon
Remove unreachable code
e95d33b
iritkatriel
iritkatriel approved these changes Mar 31, 2025
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Mar 31, 2025
@markshannon
Handle negative numbers smaller than -9
b7eb0bd
@markshannon
markshannon merged commit c535a13 into python:main Mar 31, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label Mar 31, 2025
@markshannon
markshannon deleted the code-gen-refactor-again branch March 31, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@iritkatriel iritkatriel iritkatriel approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@markshannon @iritkatriel
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.