Skip to content

Commit

Permalink
Merge master jdk-17.0.9+2 into openj9-staging
Browse files Browse the repository at this point in the history
Signed-off-by: J9 Build <j9build@ca.ibm.com>
  • Loading branch information
j9build committed Aug 10, 2023
2 parents d428364 + d3948a0 commit 7654ae0
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/java.desktop/share/native/libharfbuzz/hb-subset.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions test/hotspot/jtreg/compiler/lib/ir_framework/IRNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
143 changes: 143 additions & 0 deletions test/hotspot/jtreg/runtime/os/TestTimerSlack.java
Original file line number Diff line number Diff line change
@@ -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();
}
}
}

}
2 changes: 2 additions & 0 deletions test/lib/jdk/test/lib/cli/CommandLineOptionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
Expand Down

0 comments on commit 7654ae0

Please sign in to comment.