From 564316f26435f75791abb8a92d80ae2c818511ca Mon Sep 17 00:00:00 2001 From: Tyler Steele Date: Tue, 1 Aug 2023 17:06:43 +0000 Subject: [PATCH 1/4] 8307603: [AIX] Broken build after JDK-8307301 Backport-of: bb3e44d8b604b4e3facc4f49f625cc0b7ff2abd7 --- src/java.desktop/share/native/libharfbuzz/hb-subset.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/java.desktop/share/native/libharfbuzz/hb-subset.cc b/src/java.desktop/share/native/libharfbuzz/hb-subset.cc index ff591cb259f..538f4ec64bf 100644 --- a/src/java.desktop/share/native/libharfbuzz/hb-subset.cc +++ b/src/java.desktop/share/native/libharfbuzz/hb-subset.cc @@ -43,7 +43,11 @@ #include "OT/Color/sbix/sbix.hh" #include "hb-ot-os2-table.hh" #include "hb-ot-post-table.hh" + +#if !defined(AIX) #include "hb-ot-post-table-v2subset.hh" +#endif + #include "hb-ot-cff1-table.hh" #include "hb-ot-cff2-table.hh" #include "hb-ot-vorg-table.hh" From 7f215cc487e49838aad30f235a9e67c3bc5e9227 Mon Sep 17 00:00:00 2001 From: Gui Cao Date: Wed, 2 Aug 2023 01:58:38 +0000 Subject: [PATCH 2/4] 8311923: TestIRMatching.java fails on RISC-V Reviewed-by: phh, fyang Backport-of: e7adbdb1f1506b82392907f7e4a5c8882d3198eb --- .../jtreg/compiler/lib/ir_framework/IRNode.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java index 0d3f22fad8f..2f2395b77c6 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java @@ -53,13 +53,13 @@ public class IRNode { private static final String STORE_OF_CLASS_POSTFIX = "(:|\\+)\\S* \\*" + END; private static final String LOAD_OF_CLASS_POSTFIX = "(:|\\+)\\S* \\*" + END; - public static final String ALLOC = "(.*precise klass .*\\R((.*(?i:mov|xorl|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java" + END; - public static final String ALLOC_OF = COMPOSITE_PREFIX + "(.*precise klass .*" + IS_REPLACED + ":.*\\R((.*(?i:mov|xorl|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java" + END; - public static final String ALLOC_ARRAY = "(.*precise klass \\[L.*\\R((.*(?i:mov|xor|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_array_Java" + END; - public static final String ALLOC_ARRAY_OF = COMPOSITE_PREFIX + "(.*precise klass \\[L.*" + IS_REPLACED + ";:.*\\R((.*(?i:mov|xorl|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_array_Java" + END; + public static final String ALLOC = "(.*precise klass .*\\R((.*(?i:mov|mv|xorl|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java" + END; + public static final String ALLOC_OF = COMPOSITE_PREFIX + "(.*precise klass .*" + IS_REPLACED + ":.*\\R((.*(?i:mov|mv|xorl|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_instance_Java" + END; + public static final String ALLOC_ARRAY = "(.*precise klass \\[L.*\\R((.*(?i:mov|mv|xor|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_array_Java" + END; + public static final String ALLOC_ARRAY_OF = COMPOSITE_PREFIX + "(.*precise klass \\[L.*" + IS_REPLACED + ";:.*\\R((.*(?i:mov|mv|xorl|nop|spill).*|\\s*|.*LGHI.*)\\R)*.*(?i:call,static).*wrapper for: _new_array_Java" + END; - public static final String CHECKCAST_ARRAY = "(((?i:cmp|CLFI|CLR).*precise klass \\[.*;:|.*(?i:mov|or).*precise klass \\[.*;:.*\\R.*(cmp|CMP|CLR))" + END; - public static final String CHECKCAST_ARRAY_OF = COMPOSITE_PREFIX + "(((?i:cmp|CLFI|CLR).*precise klass \\[.*" + IS_REPLACED + ";:|.*(?i:mov|or).*precise klass \\[.*" + IS_REPLACED + ";:.*\\R.*(cmp|CMP|CLR))" + END; + public static final String CHECKCAST_ARRAY = "(((?i:cmp|CLFI|CLR).*precise klass \\[.*;:|.*(?i:mov|mv|or).*precise klass \\[.*;:.*\\R.*(cmp|CMP|CLR))" + END; + public static final String CHECKCAST_ARRAY_OF = COMPOSITE_PREFIX + "(((?i:cmp|CLFI|CLR).*precise klass \\[.*" + IS_REPLACED + ";:|.*(?i:mov|mv|or).*precise klass \\[.*" + IS_REPLACED + ";:.*\\R.*(cmp|CMP|CLR))" + END; // Does not work on s390 (a rule containing this regex will be skipped on s390). public static final String CHECKCAST_ARRAYCOPY = "(.*((?i:call_leaf_nofp,runtime)|CALL,\\s?runtime leaf nofp|BCTRL.*.leaf call).*checkcast_arraycopy.*" + END; From 820b07666f3192fef5865bd4b81f8c73f6bed79b Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 2 Aug 2023 08:20:21 +0000 Subject: [PATCH 3/4] 8307766: Linux: Provide the option to override the timer slack Backport-of: 7173c3009e0999f13eaa4bee5eedee7326f9d124 --- .../jtreg/runtime/os/TestTimerSlack.java | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 test/hotspot/jtreg/runtime/os/TestTimerSlack.java diff --git a/test/hotspot/jtreg/runtime/os/TestTimerSlack.java b/test/hotspot/jtreg/runtime/os/TestTimerSlack.java new file mode 100644 index 00000000000..86aece992b5 --- /dev/null +++ b/test/hotspot/jtreg/runtime/os/TestTimerSlack.java @@ -0,0 +1,143 @@ +/* + * Copyright Amazon.com Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.util.regex.Pattern; +import java.util.regex.Matcher; + +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; + +/** + * @test + * @summary Check that timer slack options work + * @requires os.family == "linux" + * @requires vm.flagless + * @library /test/lib + * @run driver TestTimerSlack + */ +public class TestTimerSlack { + + public static void main(String[] args) throws Exception { + int defaultSlack; + + // Check the timer slack value is not printed by default + { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+thread", + "TestTimerSlack$TestMain"); + + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldHaveExitValue(0); + output.shouldNotContain("timer slack:"); + } + + // Check the timer slack value is not printed when explicitly disabled + { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+thread", + "-XX:+UnlockExperimentalVMOptions", + "-XX:TimerSlack=-1", + "TestTimerSlack$TestMain"); + + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldHaveExitValue(0); + output.shouldNotContain("timer slack:"); + } + + // Check the timer slack value is good when system-wide default is requested + { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+thread", + "-XX:+UnlockExperimentalVMOptions", + "-XX:TimerSlack=0", + "TestTimerSlack$TestMain"); + + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldHaveExitValue(0); + output.shouldContain("timer slack:"); + + defaultSlack = parseSlackValue(output); + + if (defaultSlack == 0) { + fail(output, "Default slack value (" + defaultSlack + ") is unexpected"); + } + } + + // Check the timer slack value is accepted by all threads + for (int slack : new int[] {1, 10, 100, 1000, 10000, 100000, 1000000}) { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+thread", + "-XX:+UnlockExperimentalVMOptions", + "-XX:TimerSlack=" + slack, + "TestTimerSlack$TestMain"); + + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldHaveExitValue(0); + output.shouldContain("timer slack:"); + + int actualSlack = parseSlackValue(output); + if (actualSlack != slack) { + fail(output, "Actual slack value (" + actualSlack + ") is not the requested one (" + slack + ")"); + } + } + } + + static final Pattern EXTRACT_PATTERN = Pattern.compile("(.*)timer slack: ([0-9]+)ns(.*)"); + + public static int parseSlackValue(OutputAnalyzer output) { + Integer value = null; + for (String s : output.asLines()) { + Matcher m = EXTRACT_PATTERN.matcher(s); + if (m.matches()) { + Integer parsedValue = Integer.parseInt(m.group(2)); + if (value == null) { + value = parsedValue; + } else if (!value.equals(parsedValue)) { + fail(output, "Multiple timer slack values detected"); + } + } + } + if (value == null) { + fail(output, "No timer slack values detected"); + } + return value; + } + + private static void fail(OutputAnalyzer output, String msg) { + output.reportDiagnosticSummary(); + throw new IllegalStateException(msg); + } + + public static class TestMain { + static final int THREADS = 8; + + public static void main(String... args) throws Exception { + Thread[] ts = new Thread[THREADS]; + for (int c = 0; c < THREADS; c++) { + ts[c] = new Thread(); + ts[c].start(); + } + + for (int c = 0; c < THREADS; c++) { + ts[c].join(); + } + } + } + +} From d3948a0d18d76b3a2fbf0ce6394985e6add79528 Mon Sep 17 00:00:00 2001 From: Sonia Zaldana Calles Date: Wed, 2 Aug 2023 11:00:22 +0000 Subject: [PATCH 4/4] 8273803: Zero: Handle "zero" variant in CommandLineOptionTest.java Backport-of: 2d13fb21af783ebbe3dd5c2632aea11347317026 --- test/lib/jdk/test/lib/cli/CommandLineOptionTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java b/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java index 7247d879412..b3b1b8a7e2c 100644 --- a/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java +++ b/test/lib/jdk/test/lib/cli/CommandLineOptionTest.java @@ -500,6 +500,8 @@ private static String getVMTypeOption() { return "-client"; } else if (Platform.isMinimal()) { return "-minimal"; + } else if (Platform.isZero()) { + return "-zero"; } throw new RuntimeException("Unknown VM mode."); }