RFR: JDK-8277139 Improve code readability in PredecessorValidator (c1_IR.cpp)

Ludvig Janiuk duke at openjdk.java.net
Mon Nov 15 19:24:00 UTC 2021


Refactor PredecessorValidator, more or less applying the following:

declare variables where used
redeclare instead of reuse variables
move assert to a more logical place
remove unused length variable
inline variables where senseful
split loops
extract methods

this is done in preparation for work on optimizing IR::verify. IR::verify calls PredecessorValidator. If the work of PredecessorValidator is made clearer, it will be easier to reason about where IR::verify doesn't need to be called (or where a subset of it would suffice).

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

Commit messages:
 - extract methods
 - inline variable
 - deduplicate block_do
 - extract method
 - Init _blocks with expected size
 - Trivial polishing in PredecessorValidator

Changes: https://git.openjdk.java.net/jdk/pull/6394/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6394&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8277139
  Stats: 75 lines in 1 file changed: 26 ins; 23 del; 26 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6394.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6394/head:pull/6394

PR: https://git.openjdk.java.net/jdk/pull/6394


More information about the hotspot-compiler-dev mailing list