[master] RFR: JDK-8328886: Lilliput: Build COH archives [v2]

Roman Kennke rkennke at openjdk.org
Tue Mar 26 11:26:43 UTC 2024


On Tue, 26 Mar 2024 10:49:51 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> This is a breakout from and a prerequisite for [JDK-8325104](https://bugs.openjdk.org/browse/JDK-8325104).
>> 
>> To run with +COH and CDS enabled, and to enable tests testing this combination, we need to build archives with +COH too.
>> 
>> This patch expands the number of archives built to four:
>> 
>> a) **classes.jsa** (+UseCompressedClassPointers, -UseCompactObjectHeaders)
>> b) **classes_nocoops.jsa** (-UseCompressedClassPointers, -UseCompactObjectHeaders)
>> c) **classes_coh.jsa** (+UseCompressedClassPointers, +UseCompactObjectHeaders)
>> d) **classes_nocoops_coh.jsa** (-UseCompressedClassPointers, +UseCompactObjectHeaders)
>> 
>> Naming could be more logical, but my aim was to keep compatibility with upstream archive names (no functional or name changes for *classes.jsa* and *classes_nocoops.jsa*). 
>> 
>> Another design goal was for the name-to-options mapping not to change *even if UseCOH were enabled by default*. So, _classes.jsa_ is not the "default jsa" but explicitly and always signifies the jsa with +coops -coh.
>> 
>> The new configure option `--(enable|disable)-cds-archive-coh` allows you to enable/disable the generation of COH archives. By default, it is enabled if the underlying platform supports COH (64-bit) and if standard CDS archive generation is enabled (e.g., not for cross-compilation).
>> 
>> Note that the upcoming JEP "CDS Archived Object Streaming" ([JDK-8326035](https://bugs.openjdk.org/browse/JDK-8326035)) will eliminate the +-Coops distinction, thus reducing the number of CDS archives. It may also eliminate the +-COH distinction at some point, though that is harder.
>> 
>> But that JEP has to be developed and shipped first. After that, it will run alongside the old implementation for a while, which we keep as a fallback. Only if it is the sole remaining way to load CDS archives can we cut down the number of jsa archives. Until then, I propose to keep +-COH archives in addition to +-Coops archives.
>
> Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
> 
>   copyright changes

Looks good, but I have a question.

make/Images.gmk line 137:

> 135:   $1_$2_COOPS_OPTION := $(if $(findstring _nocoops, $2),-XX:-UseCompressedOops)
> 136:   # enable and also explicitly disable coh as needed.
> 137:   ifeq ($(call isTargetCpuBits, 64), true)

Not all 64-bit platforms currently support COH. Only aarch64 and x86_64 do. Would that be a problem?

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

PR Review: https://git.openjdk.org/lilliput/pull/145#pullrequestreview-1960071477
PR Review Comment: https://git.openjdk.org/lilliput/pull/145#discussion_r1539039149


More information about the lilliput-dev mailing list