RFR: 7904026: JOL: Handle (generational) ZGC when dealing with raw addresses
Aleksey Shipilev
shade at openjdk.org
Fri Jun 6 15:28:07 UTC 2025
On Thu, 8 May 2025 01:37:35 GMT, Anton Rybochkin <duke at openjdk.org> wrote:
> Because of color bits in lower positions, object alignment size heuristics does not work with generational ZGC. This PR implements address uncolorizing so alignment size and hence object size is calculated correctly
Without cross-checking against ZGC sources... Some cosmetics, but also a question: I suppose it would be good to handle the non-generational ZGC to cover JDK 17 and JDK 21?
Also, I would think we want https://github.com/openjdk/jol/pull/64/ to be merged first, so we get the automated testing done.
jol-core/src/main/java/org/openjdk/jol/vm/HotspotUnsafe.java line 83:
> 81:
> 82: private final boolean lilliputVM;
> 83: private final boolean generationalZGCEnabled;
Suggestion:
private final boolean isZGC;
jol-core/src/main/java/org/openjdk/jol/vm/ZGCAddress.java line 12:
> 10: private static final long CLEAR_UNUSED_BITS_MASK = (1L << 46) - 1;
> 11: private static final long COLOR_BITS_COUNT = 16;
> 12: private static final boolean isAarch = "aarch64".equals(System.getProperty("os.arch"));
Suggestion:
private static final boolean IS_ARM64 = "aarch64".equals(System.getProperty("os.arch"));
-------------
PR Review: https://git.openjdk.org/jol/pull/65#pullrequestreview-2905255289
PR Review Comment: https://git.openjdk.org/jol/pull/65#discussion_r2132394294
PR Review Comment: https://git.openjdk.org/jol/pull/65#discussion_r2132398723
More information about the jol-dev
mailing list