RFR: 8305896: Alternative full GC forwarding [v25]

Roman Kennke rkennke at openjdk.org
Thu May 4 06:09:26 UTC 2023


On Wed, 3 May 2023 22:04:08 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix type narrowing
>
> src/hotspot/share/gc/shared/slidingForwarding.inline.hpp line 82:
> 
>> 80: 
>> 81:   uintptr_t encoded = (offset << OFFSET_BITS_SHIFT) |
>> 82:                       (alt_region << ALT_REGION_SHIFT) |
> 
> While I understand that a `bool` is typically encoded as either `0` or `1` (not sure if it's actually specified somewhere) it would likely make the code cleaner to use a real integer of some type here to me.
> 
> Also, the shift could be inlined in the assignments above.
> Like setting `alt_region` to either `0 (<< ALT_REGION_SHIFT)` or `1 << ALT_REGION_SHIFT` directly in the code.
> This is obviously a nano-optimization that probably won't show up anywhere...

Oh yes, I'll change it to an integral value.
I don't see how moving the shift to the assignment would help, and I'd prefer to keep it in the place where we encode the value, I think that is more readable/less confusing.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13582#discussion_r1184575641


More information about the shenandoah-dev mailing list