remove_globals shouldn't be its own pass
#124949
Labels
3.14
new features, bugs and security fixes
interpreter-core
(Objects, Python, Grammar, and Parser dirs)


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?
The text was updated successfully, but these errors were encountered: