RFR: 8276093: Improve naming in closures to iterate over card sets

Stefan Johansson sjohanss at openjdk.java.net
Wed Nov 17 17:32:16 UTC 2021


On Wed, 17 Nov 2021 13:10:02 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> Hi all,
> 
>   can I have reviews for this renaming change that tries to change naming for some remembered set closures to include `Closure` instead of `Iterator` in their names. Additionally I removed two or so `G1` prefixes for nested classes. Hopefully this improves the situation a bit, although it's still a mess of nested closures.
> 
> Testing: local compilation, gha
> 
> Thanks,
>   Thomas

Looks good, some additional iter -> closure renames suggested below.

src/hotspot/share/gc/g1/g1CardSet.cpp line 824:

> 822: }
> 823: 
> 824: void G1CardSet::iterate_containers(CardSetPtrClosure* found, bool at_safepoint) {

Please change `found` to closure or cl as well.

src/hotspot/share/gc/g1/g1CardSet.cpp line 839:

> 837: 
> 838: public:
> 839:   G1ContainerCardsClosure(Closure& iter, uint region_idx) : _iter(iter), _region_idx(region_idx) { }

Maybe change `_iter` and `iter` to `_closure` and `closure`?

src/hotspot/share/gc/g1/g1CardSet.cpp line 861:

> 859: public:
> 860: 
> 861:   G1CardSetContainersClosure(G1CardSet* card_set,

Same as above.

src/hotspot/share/gc/g1/g1CardSet.cpp line 872:

> 870: };
> 871: 
> 872: void G1CardSet::iterate_cards(CardClosure& iter) {

iter -> closure

src/hotspot/share/gc/g1/g1CardSet.hpp line 363:

> 361:   };
> 362: 
> 363:   void iterate_containers(CardSetPtrClosure* iter, bool safepoint = false);

iter -> closure

src/hotspot/share/gc/g1/g1CardSet.hpp line 370:

> 368:   };
> 369: 
> 370:   void iterate_cards(CardClosure& iter);

iter -> closure

src/hotspot/share/gc/g1/heapRegionRemSet.inline.hpp line 90:

> 88: public:
> 89: 
> 90:   G1HeapRegionRemSetMergeCardClosure(G1CardSet* card_set,

`(_)iter` -> `(_)closure`

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

Marked as reviewed by sjohanss (Reviewer).

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



More information about the hotspot-gc-dev mailing list