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" 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; 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(); + } + } + } + +} 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."); }