From 847f65c14a8fea3d5e2ee9d920c458b8923da3b4 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Fri, 22 Nov 2024 11:37:35 +0000 Subject: [PATCH] 8344844: ciReplay tests fail with -XX:+UseCompactObjectHeaders because CDS is disabled since JDK-8341553 Reviewed-by: epeter, rcastanedalo --- test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java | 10 +++++++++- test/hotspot/jtreg/compiler/ciReplay/InliningBase.java | 10 +++++++++- .../ciReplay/TestInliningProtectionDomain.java | 7 +++++-- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java b/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java index dcb8dff8f7d37..a974a09d61517 100644 --- a/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java +++ b/test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,9 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.util.CoreUtils; +import jdk.test.whitebox.WhiteBox; + +import jtreg.SkippedException; import java.io.BufferedReader; import java.io.File; @@ -126,6 +129,11 @@ public CiReplayBase(String args[]) { } public void runTest(boolean needCoreDump, String... args) { + // The CiReplay tests don't work properly when CDS is disabled + boolean cdsEnabled = WhiteBox.getWhiteBox().isSharingEnabled(); + if (!cdsEnabled) { + throw new SkippedException("CDS is not available for this JDK."); + } cleanup(); if (generateReplay(needCoreDump, args)) { testAction(); diff --git a/test/hotspot/jtreg/compiler/ciReplay/InliningBase.java b/test/hotspot/jtreg/compiler/ciReplay/InliningBase.java index 4cf4045aebc67..e3ec752712303 100644 --- a/test/hotspot/jtreg/compiler/ciReplay/InliningBase.java +++ b/test/hotspot/jtreg/compiler/ciReplay/InliningBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,9 @@ package compiler.ciReplay; import jdk.test.lib.Asserts; +import jdk.test.whitebox.WhiteBox; + +import jtreg.SkippedException; import java.io.IOException; import java.nio.file.Files; @@ -51,6 +54,11 @@ protected InliningBase(Class testClass) { } protected void runTest() { + // The CiReplay tests don't work properly when CDS is disabled + boolean cdsEnabled = WhiteBox.getWhiteBox().isSharingEnabled(); + if (!cdsEnabled) { + throw new SkippedException("CDS is not available for this JDK."); + } runTest(commandLineNormal.toArray(new String[0])); } diff --git a/test/hotspot/jtreg/compiler/ciReplay/TestInliningProtectionDomain.java b/test/hotspot/jtreg/compiler/ciReplay/TestInliningProtectionDomain.java index 31e05ba7ecf4f..339b6b59f4e15 100644 --- a/test/hotspot/jtreg/compiler/ciReplay/TestInliningProtectionDomain.java +++ b/test/hotspot/jtreg/compiler/ciReplay/TestInliningProtectionDomain.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,10 @@ * @summary Testing that ciReplay inlining does not fail with unresolved signature classes. * @requires vm.flightRecorder != true & vm.compMode != "Xint" & vm.compMode != "Xcomp" & vm.debug == true & vm.compiler2.enabled * @modules java.base/jdk.internal.misc - * @run driver compiler.ciReplay.TestInliningProtectionDomain + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * compiler.ciReplay.TestInliningProtectionDomain */ package compiler.ciReplay;