RFR: 8356780: PhaseMacroExpand::_has_locks is unused

Benoît Maillard duke at openjdk.org
Fri Jun 6 07:47:30 UTC 2025


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!

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

Commit messages:
 - 8356780: Remove useless assert
 - 8356780: Merge both while loops in PhaseMacroExpand::eliminate_macro_nodes
 - 8356780: Remove unused field PhaseMacroExpand::_has_locks

Changes: https://git.openjdk.org/jdk/pull/25669/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25669&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8356780
  Stats: 32 lines in 2 files changed: 4 ins; 24 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/25669.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25669/head:pull/25669

PR: https://git.openjdk.org/jdk/pull/25669


More information about the hotspot-compiler-dev mailing list