RFR: 8347830: [premain] UseCompatibleCompressedOops is broken after merging with mainline

Vladimir Kozlov kvn at openjdk.org
Fri May 16 15:04:16 UTC 2025


On Fri, 16 May 2025 14:45:21 GMT, Ashutosh Mehra <asmehra at openjdk.org> wrote:

>> The issue was that we did not allocate space "noaccess prefix" before heap for read-only page when we setup type of encoding  with `UseCompatibleCompressedOops` flag. I update code which reserves heap for compressed oops to take into account this flag.
>> 
>> An other issue was that `UseCompatibleCompressedOops` flag was set during CDS arguments consistency checkup. But `UseCompressedOops` flag is set by GC ergonomics. I moved code to CDS ergonomics setting method.
>> 
>> During testing I hit assert that AOT code address table is missing some code blob address. But it was actually card table base address which pointed inside CodeCache. I added special case to check for it early.
>> 
>> Tested premain-tier1.
>
> src/hotspot/share/memory/memoryReserver.cpp line 556:
> 
>> 554:   bool unscaled  = false;
>> 555:   bool zerobased = false;
>> 556:   bool heapbased = UseCompatibleCompressedOops;
> 
> Use of `heapbased` is a bit confusing to me. Can we restructure it like this:
> 
> bool unscaled = false;
> bool zerobased = false;
> if (UseCompatibleCompressedOops) {
>   unscaled = (heap_end_address <= (char*)UnscaledOopHeapMax);
>   zerobased = (heap_end_address <= (char*)OopEncodingHeapMax);
> }
> size_t noaccess_prefix = (UseCompatibleCompressedOops || !zerobased) ? noaccess_prefix_size : 0;

I can do that. I got names from [CompressedOops::Mode](https://github.com/openjdk/leyden/blob/premain/src/hotspot/share/oops/compressedOops.hpp#L67) values

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

PR Review Comment: https://git.openjdk.org/leyden/pull/67#discussion_r2093223192


More information about the leyden-dev mailing list