RFR(S): JDK-8042474: Clean up duplicated code in RSHashTable

Bengt Rutisson bengt.rutisson at oracle.com
Thu May 8 08:20:41 UTC 2014


Hi Andreas,

On 2014-05-08 10:01, Andreas Sjöberg wrote:
> Hi all,
>
> could I please have reviews for this small cleanup?
> For RSHashTable, it
>  - removes entry_for_region_ind(RegionIdx_t)
>  - changes get_entry to be public and declared const
>  - changes the sites that called entry_for_region to instead use 
> get_entry, since they have the same implementation.
>  - changes get_cards to make use of get_entry instead of very similar 
> code contained inline.
>
> webrev: http://cr.openjdk.java.net/~brutisso/JDK-8042474/01/webrev/

Looks good. Nice cleanup!

One minor thing:

These asserts in RSHashTable::get_cards():

  204   assert(entry->r_ind() == region_ind, "Postcondition of loop + 
test above.");
  205   assert(entry->num_valid_cards() > 0, "Inv");

are already done in RSHashTable::get_entry(). I think you can remove 
them too.


>
> It seems get_cards is not used. Maybe it should be removed as a 
> separate CR?

Yes it is unused, so it would be good to remove it. I'm fine with doing 
that as a separate CR. Maybe in that case also go through all methods in 
sparsePRT.hpp and make sure that they are used.

Thanks,
Bengt

>
> testing: jprt.
>
> Best regards,
> Andreas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20140508/1b12ae86/attachment-0001.html>


More information about the hotspot-gc-dev mailing list