RFR: 8279699: Parallel: More precise boundary in ObjectStartArray::object_starts_in_range

Albert Mingkun Yang ayang at openjdk.java.net
Tue Jan 11 16:23:23 UTC 2022


On Tue, 11 Jan 2022 12:56:39 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>> Simple change in boundary condition checking and updating the API doc.
>> 
>> Test: hotspot_gc
>
> src/hotspot/share/gc/parallel/objectStartArray.hpp line 172:
> 
>> 170:   // where
>> 171:   //   start_addr_aligned_down = align_down(start_addr, _card_size)
>> 172:   //   end_addr_aligned_up = align_up(end_addr, _card_size)
> 
> The code doesn't do align_down on start, but looking at the callers it looks like start_addr will always be card size aligned. Would it make sense to assert this?

`block_for_addr` does `align_down` implicitly. It's true that all callers provide aligned `start_addr`, but it feels odd that only one end is asserted aligned. Besides, this method doesn't really rely (or depend) on args being aligned.

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

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



More information about the hotspot-gc-dev mailing list