RFR: 8242038: G1: Lazily initialize RSHashTables

Kim Barrett kim.barrett at oracle.com
Wed Apr 8 23:06:58 UTC 2020


> On Apr 8, 2020, at 7:42 AM, Claes Redestad <claes.redestad at oracle.com> wrote:
>>> src/hotspot/share/gc/g1/sparsePRT.hpp
>>>    int _tbl_ind;         // [-1, 0.._rsht->_capacity)
>>> 
>>> [pre-existing]
>>> 
>>> I see no sign of -1 (or any other negative value) as a possibility for
>>> this member. It is initialized to 0 in the constructor and is only
>>> ever incremented. As such, I think it's type could be unsigned, and
>>> the cast when comparing with _rsht->capacity() in RSHTBIter::has_next
>>> would not be needed.
>>> 
>>> ------------------------------------------------------------------------------ 
>> The iteration completely changed in the changes how the card scanning is done in jdk14, this is a leftover.
> 
> Ok, I've fixed the comment and changed type to uint (or do you prefer
> "unsigned”):

uint is fine; I meant “unsigned” in the generic “an unsigned integer type” sense.

> http://cr.openjdk.java.net/~redestad/8242038/open.02/

Looks good.




More information about the hotspot-gc-dev mailing list