Skip to content

gh-87092: refactor assemble() to a number of separate functions, which do not need the compiler struct#102562

Merged
iritkatriel merged 10 commits intopython:mainfrom
iritkatriel:decouple_assembler
Mar 13, 2023
Merged

gh-87092: refactor assemble() to a number of separate functions, which do not need the compiler struct#102562
iritkatriel merged 10 commits intopython:mainfrom
iritkatriel:decouple_assembler

Conversation

@iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Mar 9, 2023

This PR:

  1. further breaks up the assemble() function, and extracts out of it the optimize_code_unit(), assemble_code_unit(), assemble_emit() and resolve_line_numbers() steps into separate functions.
  2. passes less stuff around (namely, not passing the whole compiler struct but only what is needed).
  3. unit tests (_PyCompile_OptimizeCfg ) run all of optimize_code_unit(), not just optimize_cfg(), so we can test dead code removal, unused const removal, hot/cold code arrangements, etc.
  4. _PyCompile_CodeGen no longer constructs a cfg.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

interpreter-core (Objects, Python, Grammar, and Parser dirs) skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants