Summary
-------
Make the UseAppCDS option obsolete in JDK 11 because it is no longer needed to separate the functionality for archiving non-system classes. The support for archiving non-system classes was open-sourced in JDK 10. Also, make SharedArchiveFile a product flag in JDK 11.
Problem
-------
The UseAppCDS flag was useful when AppCDS feature was in the closed and we wanted a separation of the feature from the basic CDS. Now AppCDS is in the open, the UseAppCDS flag is no longer serving its original purpose and complicates code unnecessarily.
The SharedArchiveFile flag is for specifying an alternative location of the generated shared archive file. It is a diagnostic flag for base CDS and requires -XX:+UnlockDiagnosticVMOptions by default, but a product flag when UseAppCDS is specified. The usage is inconsistent.
The benefit of removing the usage of UseAppCDS flag:
- Cleaner code
- Less confusion in the community about CDS and AppCDS. AppCDS is CDS but with application classes supported in the archive. It adds extra complexity to force the separation of the two.
- Users no longer need to specify -XX:+UseAppCDS to archive non-system classes. Simpler usage, which will result more adoptions.
Solution
--------
- Remove various 'if (UseAppCDS)' checks from CDS code.
- Make the UseAppCDS flag obsolete in JDK 11 and remove in JDK 12.
- Make SharedArchiveFile a product flag in JDK 11.
Specification
-------------
The UseAppCDS flag will be marked as obsolete and the SharedArchiveFile flag will be a product flag in JDK 11.