Skip to content

remove_globals shouldn't be its own pass #124949

@brandtbucher

Description

@brandtbucher

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.14bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions