Skip to content

Commit

Permalink
Heap2Local: Optimize Arrays in addition to Structs (#6478)
Browse files Browse the repository at this point in the history
To keep things simple, this adds a Array2Struct component to the pass. When we
find a non-escaping array, we run that to turn it into a struct, and then run the
existing Struct2Local to convert that to locals. This avoids refactoring Struct2Local
to handle both structs and arrays (with the downside of making the optimization of
arrays a little less efficient, but they are rarer, I suspect - that is certainly the case
in Java output I've seen).

The core EscapeAnalyzer logic is generalized to handle both arrays and structs,
but the changes there are thankfully quite minor.
  • Loading branch information
kripken authored Apr 9, 2024
1 parent 0ee46de commit fca1d3a
Show file tree
Hide file tree
Showing 2 changed files with 1,418 additions and 22 deletions.
Loading

0 comments on commit fca1d3a

Please sign in to comment.