RFR: 8356780: PhaseMacroExpand::_has_locks is unused

Manuel Hässig mhaessig at openjdk.org
Fri Jun 6 09:10:54 UTC 2025


On Fri, 6 Jun 2025 07:41:45 GMT, Benoît Maillard <duke at openjdk.org> wrote:

> This PR introduces two cleanup changes to `PhaseMacroExpand`:
> 
> - Removes the unused field `PhaseMacroExpand::_has_locks`
> - Merges two `while` loops in `PhaseMacroExpand::eliminate_macro_nodes` into a single loop
> 
> Previously, `eliminate_macro_nodes` used two separate `while` loops:
> 
> - The first loop removed lock nodes
> - The second loop removed allocation nodes
> 
> Both loops had the same structure and independently traversed the same set of nodes. Since their operations do not interfere, the lock node removal logic was moved into the second loop as an additional case in the `switch` statement.
> 
> Thanks!

Thank you for working on this! Your change looks good.

However, it would be nice if you could mention in the PR description what testing you ran. Also, you forgot to update the copyright year in `opto/macro.hpp`.

src/hotspot/share/opto/macro.hpp line 199:

> 197: 
> 198: public:
> 199:   PhaseMacroExpand(PhaseIterGVN &igvn) : Phase(Macro_Expand), _igvn(igvn) {

You forgot to update the copyright year. You can use the helper script [`make/scripts/update_copyright_year.sh`](https://github.com/openjdk/jdk/blob/master/make/scripts/update_copyright_year.sh) to do it automatically, before you send out a PR.

-------------

Changes requested by mhaessig (Author).

PR Review: https://git.openjdk.org/jdk/pull/25669#pullrequestreview-2904259441
PR Review Comment: https://git.openjdk.org/jdk/pull/25669#discussion_r2131794133


More information about the hotspot-compiler-dev mailing list