RFR: 8330006: Serial: Extract out ContiguousSpace::block_start_const

Albert Mingkun Yang ayang at openjdk.org
Wed Apr 10 13:40:09 UTC 2024


On Wed, 10 Apr 2024 13:10:50 GMT, Guoxiong Li <gli at openjdk.org> wrote:

> Hi all,
> 
> This patch moves the method `ContiguousSpace::block_start_const` to `DefNewGeneration` (note: not the parent class `Generation`) and moves the method `TenuredSpace::block_start_const` to `TenuredGeneration`. These two methods don't need  the same signature so I don't add a virtual method to the parent class `Generation`.
> 
> Thanks for taking the time to review.
> 
> Best Regards,
> -- Guoxiong

src/hotspot/share/gc/serial/defNewGeneration.hpp line 162:

> 160:   // some heaps may not pack objects densely; a chunk may either be an
> 161:   // object or a non-object.  If "p" is not in the space, return null.
> 162:   HeapWord* block_start_const(const ContiguousSpace* cs, const void* p) const;

Can this be static function in cpp? (It'd be good if it is not exposed, even as private api.)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18722#discussion_r1559454152


More information about the hotspot-gc-dev mailing list