RFR: 8287312: G1: Early return on first failure in VerifyRegionClosure

Thomas Schatzl tschatzl at openjdk.java.net
Mon May 30 09:23:34 UTC 2022


On Wed, 25 May 2022 11:18:23 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> Simple restructuring to match the intent of the comment.
> 
> Test: hotspot_gc

Changes requested by tschatzl (Reviewer).

src/hotspot/share/gc/g1/g1HeapVerifier.cpp line 374:

> 372:     if (r->is_closed_archive()) {
> 373:       VerifyObjectInArchiveRegionClosure verify_oop_pointers(r, false);
> 374:       r->object_iterate(&verify_oop_pointers);

This should also set `_failures` if there are any; the previous code early exited via `return true`.

src/hotspot/share/gc/g1/g1HeapVerifier.cpp line 377:

> 375:     } else if (r->is_open_archive()) {
> 376:       VerifyObjsInRegionClosure verify_open_archive_oop(r, _vo);
> 377:       r->object_iterate(&verify_open_archive_oop);

This should also set `_failures` if there are any; the previous code early exited via `return true`.

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

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



More information about the hotspot-gc-dev mailing list