RFR: 8329994: Zap alignment padding bits for ArrayOops in non-release builds

Albert Mingkun Yang ayang at openjdk.org
Wed Apr 10 12:08:09 UTC 2024


On Wed, 10 Apr 2024 11:47:53 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

> In a similar vein to [JDK-8325870](https://bugs.openjdk.org/browse/JDK-8325870). Zap the any alignment padding that may exist between the header and the payload.
> 
> Currently this padding only occurs when disabling `UseCompressedClassPointers`. But becomes more relevant with [JDK-8294992](https://bugs.openjdk.org/browse/JDK-8294992).

src/hotspot/share/gc/shared/memAllocator.cpp line 409:

> 407:   if (_do_zero) {
> 408:     mem_clear(mem);
> 409:     mem_zap_alignment_padding(mem);

I feel the ordering here is a bit odd; these methods are for spaces corresponding to before-body, body and after-body.

src/hotspot/share/gc/shared/memAllocator.hpp line 101:

> 99:   const bool _do_zero;
> 100: 
> 101:   void mem_zap_alignment_padding(HeapWord* mem) const PRODUCT_RETURN;

Both methods are about alignment-padding, one for array-element type, the other for obj itself. Maybe call it "mem_zap_start_padding" to make them more symmetric?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18714#discussion_r1559317472
PR Review Comment: https://git.openjdk.org/jdk/pull/18714#discussion_r1559320139


More information about the hotspot-gc-dev mailing list