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

Christian Hagedorn chagedorn at openjdk.java.net
Wed Nov 24 16:46:05 UTC 2021


On Wed, 24 Nov 2021 16:17:34 GMT, Ludvig Janiuk <duke at openjdk.java.net> wrote:

>> 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).
>
> Ludvig Janiuk has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - last one now
>  - more asterisks ;)

Thanks for doing the updates!

src/hotspot/share/c1/c1_IR.cpp line 1308:

> 1306:     }
> 1307:     for (int i = 0; i < block->number_of_exception_handlers(); i++) {
> 1308:       assert(block->exception_handler_at(i)->is_set(BlockBegin::exception_entry_flag), "must be xhandler");

Could these two assertions also directly be moved before the `collect_predecessor()` calls below?

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

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


More information about the hotspot-compiler-dev mailing list