Skip to content

Commit

Permalink
[Lilliput] Fix CDSPluginTest.java jlink not using COH
Browse files Browse the repository at this point in the history
Summary: jlink would not use COH if it's not on by default

Testing: tools/jlink/plugins/CDSPluginTest.java

Reviewers: mmyxym, lingjun-cg

Issue: #128
  • Loading branch information
linade committed Nov 7, 2024
1 parent edbda7e commit 6387e4b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/jdk/tools/jlink/plugins/CDSPluginTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* @bug 8264322
* @summary Test the --generate-cds-archive plugin
* @requires vm.cds
* @requires vm.flagless
* @library ../../lib
* @library /test/lib
* @modules java.base/jdk.internal.jimage
Expand Down Expand Up @@ -78,8 +79,12 @@ public static void main(String[] args) throws Throwable {
}
subDir += "server" + sep;

boolean COMPACT_HEADERS =
Platform.is64bit() && WhiteBox.getWhiteBox().getBooleanVMFlag("UseCompactObjectHeaders");
// Check if COH is on by default, which means the plugin would have created an archive
// using COH. Note the @requires vm.flagless
WhiteBox wb = WhiteBox.getWhiteBox();
boolean COMPACT_HEADERS = Platform.is64bit() &&
wb.getBooleanVMFlag("UseCompactObjectHeaders") &&
wb.isDefaultVMFlag("UseCompactObjectHeaders");

String suffix = COMPACT_HEADERS ? "_coh.jsa" : ".jsa";

Expand Down

0 comments on commit 6387e4b

Please sign in to comment.