Hi,

I have a question on JDK-8058150: "Compile for Specific Platform Version". To support compilation for older versions of the platform, javac will need some description of the APIs as they existed in the target platforms.

For this, the current proposal is to use lib/ct.sym file (similar, but different, to the JDK 8 lib/ct.sym), containing classfiles of the older APIs. This file would be constructed at build time from a textual representation of the APIs stored in an OpenJDK repository (currently called ct.sym.txt).

The current ct.sym.txt is a single file that contains APIs for all supported versions, reusing entries for multiple versions when needed. An alternative would be to use ct7.sym.txt for JDK 7 APIs, ct8.sym.txt for JDK 8 APIs, etc. Using a single file leads to a smaller total size (as it reuses entries where it can), but needs to be considerably changed when a new version is added or an obsolete version is removed.

The size of the file is considerable: for the "ct.sym.txt" that represents APIs from OpenJDK 7 and 8, the size of the checked-out file in the working copy is (currently[2]) ~23MB, and inside the .hg directory, the file has ~1.7MB (Mercurial is apparently able to compress the ct.sym.txt file very well - but as all history is kept inside .hg directory, the size of the file inside the .hg directory increases when the ct.sym.txt is updated).

[2] The size may change based on what is included/excluded - e.g. currently, private methods and fields are removed from classes before writing this file; including these would make the file bigger.

Another alternative would be to partition the file into several smaller files - would be easier to grasp, but if the files would be too small, the compression would be worse (leading to bigger repositories).

Currently, the proposal is to place the ct.sym.txt file into the top-level repository. A prototype of this feature is currently in the jdk9/sandbox forest, on branch JDK-8058150-branch. The current ct.sym.txt file is <top-level-repository>/make/data/symbols/ct.sym.txt.

Are there any insights/comments on this? Would adding this file to the repositories be acceptable?

Thanks go to Jon Gibbons, Joe Darcy, Alan Bateman and others for their comments on this so far.

Thanks,
   Jan

Reply via email to