RFR: JDK-8232069: Enable CDS even when UseCompressedClassPointers and/or UseCompressedOops are false

Ioi Lam ioi.lam at oracle.com
Wed Feb 5 18:34:52 UTC 2020


Hi Yumin,


Looks good. Some nitpicks on the tests:

CommandLineFlagComboNegative.java: the following line is not needed.

import jdk.test.lib.cds.CDSTestUtils.Result;


TestCombinedCompressedFlags.java: DUMP_NORMAL_MSG doesn't seem to be 
used by the test.

DifferentHeapSizes.java: after your change, 
CDSTestUtils.MSG_COMPRESSION_MUST_BE_USED is no longer used anywhere in 
the tests. Also, This message is no longer printed by the VM. I think 
the CDSTestUtils.MSG_COMPRESSION_MUST_BE_USED field should be removed.


IncompatibleOptions.java: COOPS_DUMP_WARNING can be removed.

The check_shared parameter for testExec() should be removed. It's 
currently used only when expectedToFail == false. However, in all the 
cases where expectedToFail == false, check_shared is always true.


Also, in filemap.cpp, before checking "compressed_oops() != 
UseCompressedOops ...", I think it will be good to add a log to print 
out the expected compressed mode. That way if the user gets an error, 
they can run with -Xlog:cds to find out exactly what the reason is. E.g.

     log_info(cds)("Archive was created with UseCompressedOops = %d, 
UseCompressedClassPointers = %d",
                           compressed_oops(), compressed_class_pointers());
     if (compressed_oops() != UseCompressedOops ...

Thanks
- Ioi


On 2/4/20 6:01 PM, Yumin Qi wrote:
> Hi,
>
>    Please review fix:
>
>    Bug: https://bugs.openjdk.java.net/browse/JDK-8232069
>
>    Webrev:http://cr.openjdk.java.net/~minqi/8232069/webrev/
>
>     Description: Currently CDS only works when using compressed Oops 
> turned on, -XX:+UseCompressedOops (default), the fix is allowing CDS 
> works with uncompressed oops and uncompressed class pointers. The 
> contents of InstanceKlass::_fields are depending on UseCompressedOops 
> and UseCompressedClassPointers on/off. There are three suggestions as 
> described in bug description:
>
> 1. Remember the compression mode at CDS dump time. At runtime, disable 
> CDS if the compression mode is changed.
> 2. Same as 1, but save more than one CDS archives in the JDK image. 
> Choose the appropriate one at start-up
> 3. Recompute re-compute InstanceKlass::_fields at runtime.
>
> The fix takes the first one, storing UseCompressedOops and 
> UseCompressedClassPointers in shared archive. CDS is only allowed at 
> runtime if the flags are consistent with the stored versions in archive.
>
>  Testing: hs-tier1-2
>
>
>   Thanks
>
>   Yumin
>



More information about the hotspot-runtime-dev mailing list