Skip to content

Commit 437758b

Browse files
committed
Merge master jdk-17.0.13+4 into openj9-staging
Signed-off-by: J9 Build <[email protected]>
2 parents eb870f1 + 0683b19 commit 437758b

File tree

162 files changed

+1214
-399
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+1214
-399
lines changed

.jcheck/conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ version=17.0.13
55

66
[checks]
77
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
8+
warning=issuestitle,binary
89

910
[repository]
1011
tags=(?:jdk-(?:[1-9]([0-9]*)(?:\.(?:0|[1-9][0-9]*)){0,4})(?:\+(?:(?:[0-9]+))|(?:-ga)))|(?:jdk[4-9](?:u\d{1,3})?-(?:(?:b\d{2,3})|(?:ga)))|(?:hs\d\d(?:\.\d{1,2})?-b\d\d)

src/java.base/share/classes/sun/security/ssl/CertificateMessage.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ private void onCertificate(ServerHandshakeContext shc,
388388
ClientAuthType.CLIENT_AUTH_REQUESTED) {
389389
// unexpected or require client authentication
390390
throw shc.conContext.fatal(Alert.BAD_CERTIFICATE,
391-
"Empty server certificate chain");
391+
"Empty client certificate chain");
392392
} else {
393393
return;
394394
}
@@ -405,7 +405,7 @@ private void onCertificate(ServerHandshakeContext shc,
405405
}
406406
} catch (CertificateException ce) {
407407
throw shc.conContext.fatal(Alert.BAD_CERTIFICATE,
408-
"Failed to parse server certificates", ce);
408+
"Failed to parse client certificates", ce);
409409
}
410410

411411
checkClientCerts(shc, x509Certs);
@@ -1247,7 +1247,7 @@ private static X509Certificate[] checkClientCerts(
12471247
}
12481248
} catch (CertificateException ce) {
12491249
throw shc.conContext.fatal(Alert.BAD_CERTIFICATE,
1250-
"Failed to parse server certificates", ce);
1250+
"Failed to parse client certificates", ce);
12511251
}
12521252

12531253
// find out the types of client authentication used

test/hotspot/jtreg/compiler/codecache/CheckCodeCacheInfo.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828
* @library /test/lib
2929
* @requires vm.debug
3030
*
31-
* @run driver jdk.test.lib.helpers.ClassFileInstaller
32-
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
33-
* compiler.codecache.CheckCodeCacheInfo
31+
* @run driver compiler.codecache.CheckCodeCacheInfo
3432
*/
3533

3634
package compiler.codecache;
@@ -69,9 +67,9 @@ public class CheckCodeCacheInfo {
6967
public static void main(String[] args) throws Exception {
7068
ProcessBuilder pb;
7169

72-
pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintCodeCache",
73-
"-XX:+Verbose",
74-
"-version");
70+
pb = ProcessTools.createTestJvm("-XX:+PrintCodeCache",
71+
"-XX:+Verbose",
72+
"-version");
7573
OutputAnalyzer out = new OutputAnalyzer(pb.start());
7674
out.shouldHaveExitValue(0);
7775
out.stdoutShouldMatch(VERBOSE_REGEXP);

test/hotspot/jtreg/compiler/codecache/CodeCacheFullCountTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
* @test
3434
* @bug 8276036 8277213 8277441
3535
* @summary test for the value of full_count in the message of insufficient codecache
36+
* @requires vm.compMode != "Xint"
3637
* @library /test/lib
3738
*/
3839
public class CodeCacheFullCountTest {
@@ -54,7 +55,7 @@ public static void wasteCodeCache() throws Exception {
5455
}
5556

5657
public static void runTest() throws Throwable {
57-
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
58+
ProcessBuilder pb = ProcessTools.createTestJvm(
5859
"-XX:ReservedCodeCacheSize=2496k", "-XX:-UseCodeCacheFlushing", "CodeCacheFullCountTest", "WasteCodeCache");
5960
OutputAnalyzer oa = ProcessTools.executeProcess(pb);
6061
// Ignore adapter creation failures

test/hotspot/jtreg/compiler/codecache/cli/TestSegmentedCodeCacheOption.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* @test
2626
* @bug 8015774
2727
* @summary Verify SegmentedCodeCache option's processing
28+
* @requires vm.flagless
2829
* @library /test/lib /
2930
* @modules java.base/jdk.internal.misc
3031
* java.compiler

test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* @key randomness
2727
* @bug 8015774
2828
* @summary Verify processing of options related to code heaps sizing.
29+
* @requires vm.flagless
2930
* @library /test/lib /
3031
* @modules java.base/jdk.internal.misc
3132
* java.compiler

test/hotspot/jtreg/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* @test
2626
* @bug 8015774
2727
* @summary Verify that PrintCodeCache option print correct information.
28+
* @requires vm.flagless
2829
* @library /test/lib /
2930
* @modules java.base/jdk.internal.misc
3031
* java.compiler

test/hotspot/jtreg/compiler/lib/ir_framework/README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ The framework is intended to be used in JTreg tests. The JTreg header of the tes
1010
* @library /test/lib /
1111
* @run driver my.package.MySimpleTest
1212
*/
13-
13+
1414
package my.package;
15-
15+
1616
import compiler.lib.ir_framework.*;
1717

1818
public class MySimpleTest {
19-
19+
2020
public static void main(String[] args) {
2121
TestFramework.run(); // The framework runs all tests of this class.
2222
}
23-
23+
2424
@Test
2525
@IR(failOn = IRNode.STORE) // Fail if the IR of myTest() contains any stores.
2626
public void myTest() {
@@ -29,14 +29,14 @@ The framework is intended to be used in JTreg tests. The JTreg header of the tes
2929
}
3030

3131
There are various ways how to set up and run a test within the `main()` method of a JTreg test. These are described and can be found in the [TestFramework](./TestFramework.java) class.
32-
32+
3333
## 2. Features
3434
The framework offers various annotations and flags to control how your test code should be invoked and being checked. This section gives an overview over all these features.
3535

3636
### 2.1 Different Tests
3737
There are three kinds of tests depending on how much control is needed over the test invocation.
3838
#### Base Tests
39-
The simplest form of testing provides a single `@Test` annotated method which the framework will invoke as part of the testing. The test method has no or well-defined arguments that the framework can automatically provide.
39+
The simplest form of testing provides a single `@Test` annotated method which the framework will invoke as part of the testing. The test method has no or well-defined arguments that the framework can automatically provide.
4040

4141
More information on base tests with a precise definition can be found in the Javadocs of [Test](./Test.java). Concrete examples on how to specify a base test can be found in [BaseTestsExample](../../../testlibrary_tests/ir_framework/examples/BaseTestExample.java).
4242

@@ -57,12 +57,12 @@ The user has the possibility to add an additional `@IR` annotation to any `@Test
5757

5858
- A `failOn` check that verifies that the provided regex is not matched in the C2 IR.
5959
- A `counts` check that verifies that the provided regex is matched a user defined number of times in the C2 IR.
60-
60+
6161
A regex can either be a custom string or any of the default regexes provided by the framework in [IRNode](./IRNode.java) for some commonly used IR nodes (also provides the possibility of composite regexes).
6262

63-
An IR verification cannot always be performed. For example, a JTreg test could be run with _-Xint_ or not a debug build (_-XX:+PrintIdeal_ and _-XX:+PrintOptoAssembly_ are debug build flags). But also CI tier testing could add additional JTreg VM and Javaoptions flags which could make an IR rule unstable.
63+
An IR verification cannot always be performed. For example, a JTreg test could be run with _-Xint_ or not a debug build (_-XX:+PrintIdeal_ and _-XX:+PrintOptoAssembly_ are debug build flags). But also CI tier testing could add additional JTreg VM and Javaoptions flags which could make an IR rule unstable.
6464

65-
In general, the framework will only perform IR verification if the used VM flags allow a C2 compilation and if non-critical additional JTreg VM and Javaoptions are provided (see whiteflag list in [TestFramework](./TestFramework.java)). The user test code, however, can specify any flags which still allow an IR verification to be performed if a C2 compilation is done (expected flags by user defined `@IR` annotations).
65+
In general, the framework will only perform IR verification if the used VM flags allow a C2 compilation and if non-critical additional JTreg VM and Javaoptions are provided (see whiteflag list in [TestFramework](./TestFramework.java)). The user test code, however, can specify any flags which still allow an IR verification to be performed if a C2 compilation is done (expected flags by user defined `@IR` annotations).
6666

6767
An `@IR` annotation allows additional preconditions/restrictions on the currently present VM flags to enable or disable rules when certain flags are present or have a specific value (see `applyIfXX` properties of an `@IR` annotation).
6868

@@ -90,6 +90,7 @@ The framework provides various stress and debug flags. They should mainly be use
9090
- `-DExclude=test3`: Provide a list of `@Test` method names which should be excluded from execution.
9191
- `-DScenarios=1,2`: Provide a list of scenario indexes to specify which scenarios should be executed.
9292
- `-DWarmup=200`: Provide a new default value of the number of warm-up iterations (framework default is 2000). This might have an influence on the resulting IR and could lead to matching failures (the user can also set a fixed default warm-up value in a test with `testFrameworkObject.setDefaultWarmup(200)`).
93+
- `-DReportStdout=true`: Print the standard output of the test VM.
9394
- `-DVerbose=true`: Enable more fain-grained logging (slows the execution down).
9495
- `-DReproduce=true`: Flag to use when directly running a test VM to bypass dependencies to the driver VM state (for example, when reproducing an issue).
9596
- `-DPrintTimes=true`: Print the execution time measurements of each executed test.
@@ -99,25 +100,26 @@ The framework provides various stress and debug flags. They should mainly be use
99100
- `-DShuffleTests=false`: Disables the random execution order of all tests (such a shuffling is always done by default).
100101
- `-DDumpReplay=true`: Add the `DumpReplay` directive to the test VM.
101102
- `-DGCAfter=true`: Perform `System.gc()` after each test (slows the execution down).
102-
- `-TestCompilationTimeout=20`: Change the default waiting time (default: 10s) for a compilation of a normal `@Test` annotated method.
103+
- `-DTestCompilationTimeout=20`: Change the default waiting time (default: 10s) for a compilation of a normal `@Test` annotated method.
103104
- `-DWaitForCompilationTimeout=20`: Change the default waiting time (default: 10s) for a compilation of a `@Test` annotated method with compilation level [WAIT\_FOR\_COMPILATION](./CompLevel.java).
104-
- `-DIgnoreCompilerControls=false`: Ignore all compiler controls applied in the framework. This includes any compiler control annotations (`@DontCompile`, `@DontInline`, `@ForceCompile`, `@ForceInline`, `@ForceCompileStaticInitializer`), the exclusion of `@Run` and `@Check` methods from compilation, and the directive to not inline `@Test` annotated methods.
105-
105+
- `-DIgnoreCompilerControls=true`: Ignore all compiler controls applied in the framework. This includes any compiler control annotations (`@DontCompile`, `@DontInline`, `@ForceCompile`, `@ForceInline`, `@ForceCompileStaticInitializer`), the exclusion of `@Run` and `@Check` methods from compilation, and the directive to not inline `@Test` annotated methods.
106+
- `-DExcludeRandom=true`: Randomly exclude some methods from compilation.
107+
- `-DPreferCommandLineFlags=true`: Prefer flags set via the command line over flags specified by the tests.
106108

107109
## 3. Test Framework Execution
108110
This section gives an overview of how the framework is executing a JTreg test that calls the framework from within its `main()` method.
109111

110112
The framework will spawn a new "test VM" to execute the user defined tests. The test VM collects all tests of the test class specified by the user code in `main()` and ensures that there is no violation of the required format by the framework. In a next step, the framework does the following for each test in general:
111-
1. Warm the test up for a predefined number of times (default 2000). This can also be adapted for all tests by using `testFrameworkobject.setDefaultWarmup(100)` or for individual tests with an additional [@Warmup](./Warmup.java) annotation.
113+
1. Warm the test up for a predefined number of times (default 2000). This can also be adapted for all tests by using `testFrameworkobject.setDefaultWarmup(100)` or for individual tests with an additional [@Warmup](./Warmup.java) annotation.
112114
2. After the warm-up is finished, the framework compiles the associated `@Test` annotated method at the specified compilation level (default: C2).
113115
3. After the compilation, the test is invoked one more time.
114116

115117
Once the test VM terminates, IR verification (if possible) is performed on the output of the test VM. If any test throws an exception during its execution or if IR matching fails, the failures are collected and reported in a pretty format. Check the standard error and output for more information and how to reproduce these failures.
116118

117119
Some of the steps above can be different due to the kind of the test or due to using non-default annotation properties. These details and differences are described in the Javadocs for the three tests (see section 2.1 Different Tests).
118120

119-
More information about the internals and the workflow of the framework can be found in the Javadocs of [TestFramework](./TestFramework.java).
120-
121+
More information about the internals and the workflow of the framework can be found in the Javadocs of [TestFramework](./TestFramework.java).
122+
121123
## 4. Internal Framework Tests
122124
There are various tests to verify the correctness of the test framework. These tests can be found in [ir_framework](../../../testlibrary_tests/ir_framework) and can directly be run with JTreg. The tests are part of the normal JTreg tests of HotSpot and should be run upon changing the framework code as a minimal form of testing.
123125

test/hotspot/jtreg/gc/arguments/TestDisableDefaultGC.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -40,13 +40,13 @@
4040
public class TestDisableDefaultGC {
4141
public static void main(String[] args) throws Exception {
4242
// Start VM, disabling all possible default GCs
43-
ProcessBuilder pb = GCArguments.createJavaProcessBuilder("-XX:-UseSerialGC",
44-
"-XX:-UseParallelGC",
45-
"-XX:-UseG1GC",
46-
"-XX:-UseZGC",
47-
"-XX:+UnlockExperimentalVMOptions",
48-
"-XX:-UseShenandoahGC",
49-
"-version");
43+
ProcessBuilder pb = GCArguments.createTestJvm("-XX:-UseSerialGC",
44+
"-XX:-UseParallelGC",
45+
"-XX:-UseG1GC",
46+
"-XX:-UseZGC",
47+
"-XX:+UnlockExperimentalVMOptions",
48+
"-XX:-UseShenandoahGC",
49+
"-version");
5050
OutputAnalyzer output = new OutputAnalyzer(pb.start());
5151
output.shouldMatch("Garbage collector not selected");
5252
output.shouldHaveExitValue(1);

test/hotspot/jtreg/vmTestbase/nsk/share/Log.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ public class Log extends FinalizableObject {
8080

8181
/**
8282
* Is log-mode verbose?
83-
* Default value is <code>false</code>.
83+
* Always enabled.
8484
*/
85-
private boolean verbose = false;
85+
private final boolean verbose = true;
8686

8787
/**
8888
* Should log messages prefixed with timestamps?
89-
* Default value is <code>false</code>.
89+
* Always enabled.
9090
*/
91-
private boolean timestamp = false;
91+
private final boolean timestamp = true;
9292

9393
/**
9494
* Names for trace levels
@@ -212,7 +212,6 @@ public Log(PrintStream stream) {
212212
*/
213213
public Log(PrintStream stream, boolean verbose) {
214214
this(stream);
215-
this.verbose = verbose;
216215
}
217216

218217
/**
@@ -223,7 +222,6 @@ public Log(PrintStream stream, boolean verbose) {
223222
public Log(PrintStream stream, ArgumentParser argsParser) {
224223
this(stream, argsParser.verbose());
225224
traceLevel = argsParser.getTraceLevel();
226-
timestamp = argsParser.isTimestamp();
227225
}
228226

229227
/////////////////////////////////////////////////////////////////
@@ -267,10 +265,9 @@ public void enableVerboseOnError(boolean enable) {
267265
* Enable or disable verbose mode for printing messages.
268266
*/
269267
public void enableVerbose(boolean enable) {
270-
if (!verbose) {
271-
flushLogBuffer();
268+
if (!enable) {
269+
throw new RuntimeException("The non-verbose logging is not supported.");
272270
}
273-
verbose = enable;
274271
}
275272

276273
public int getTraceLevel() {
@@ -472,7 +469,6 @@ private void logExceptionForFailureAnalysis(String msg) {
472469
protected synchronized void logTo(PrintStream stream) {
473470
finalize(); // flush older log stream
474471
out = stream;
475-
verbose = true;
476472
}
477473

478474
/////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)