X Tutup
The Wayback Machine - https://web.archive.org/web/20241008115835/https://github.com/python/cpython/issues/124949
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

remove_globals shouldn't be its own pass #124949

Open
brandtbucher opened this issue Oct 3, 2024 · 0 comments
Open

remove_globals shouldn't be its own pass #124949

brandtbucher opened this issue Oct 3, 2024 · 0 comments
Labels
3.14 new features, bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@brandtbucher
Copy link
Member

Before running our abstract interpreter over a trace to optimize it, we first run remove_globals, which (amongst other things) converts most global loads into constants. This requires maintaining a "stack" of information about what dictionaries and functions have been watched or had their versions checked, as well as other bookkeeping.

This is probably simpler to do as part of the abstract interpretation pass, since we're already doing a lot of the same sort of bookkeeping there and adding cases for the relevant opcodes is quite straightforward.

@markshannon was the one who originally suggested this idea, and I think it makes sense.

@Fidget-Spinner, thoughts?

@brandtbucher brandtbucher added interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.14 new features, bugs and security fixes labels Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.14 new features, bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)
Projects
None yet
Development

No branches or pull requests

1 participant
X Tutup