RFR: 8282072: G1: Rename CardSetPtr to CardSetContainerPtr

Thomas Schatzl tschatzl at openjdk.java.net
Wed Mar 16 09:41:41 UTC 2022


On Tue, 15 Mar 2022 11:32:35 GMT, Ivan Walulya <iwalulya at openjdk.org> wrote:

> Hi all,
> Please review this change to rename CardSetPtr to ContainerPtr since it is a pointer to the containers. 
> 
> Testing: tier1

Lgtm with some minor formatting comments.

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

> 208:   //                              limited to a sub-range of the original range. Currently only one level of this
> 209:   //                              container is supported.
> 210:   using ContainerPtr = void*;

I can't anchor this elsewhere: the below `CardSetInlinePtr` etc tag names should also be `ContainerInlinePtr` etc, shouldn't they?

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

> 219: 
> 220:   // The special sentinel values
> 221:   static constexpr ContainerPtr FreeCardSet    = nullptr;

Suggestion:

  static constexpr ContainerPtr FreeCardSet = nullptr;

Let's avoid lining up fairly unrelated constants.

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

> 224:   static ContainerPtr FullCardSet;
> 225: 
> 226:   static const uintptr_t ContainerPtrTypeMask  = ((uintptr_t)1 << ContainerPtrHeaderSize) - 1;

Suggestion:

  static const uintptr_t ContainerPtrTypeMask = ((uintptr_t)1 << ContainerPtrHeaderSize) - 1;

Same here.

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

> 260:   bool coarsen_container(ContainerPtr volatile* container_addr,
> 261:                         ContainerPtr cur_container,
> 262:                         uint card_in_region, bool within_howl = false);

Suggestion:

  bool coarsen_container(ContainerPtr volatile* container_addr,
                         ContainerPtr cur_container,
                         uint card_in_region, bool within_howl = false);

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

> 301: 
> 302:   // Adds the given card to this set, returning an appropriate result.
> 303:   // If added, updates the total count.

Suggestion:

  // If incremental_count is true and the card has been added, updates the total count.

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

Marked as reviewed by tschatzl (Reviewer).

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



More information about the hotspot-gc-dev mailing list