Skip to content

Commit 87cd609

Browse files
committed
Merge branch 'lworld' into JDK-8384871
2 parents a53195a + c5fafa9 commit 87cd609

8 files changed

Lines changed: 260 additions & 234 deletions

File tree

src/hotspot/share/opto/c2_globals.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@
510510
"If node count exceeds limit stop inlining") \
511511
range(0, max_jint) \
512512
\
513-
product(bool, DelayAfterInliningCutoff, true, DIAGNOSTIC, \
513+
product(bool, DelayAfterInliningCutoff, false, DIAGNOSTIC, \
514514
"If node count exceeds limit during parsing, attempt inlining " \
515515
"later instead of giving up completely") \
516516
\

src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ JVMFlag::Error CICompilerCountConstraintFunc(intx value, bool verbose) {
6767
#ifndef ASSERT
6868
int active_processor_count = os::active_processor_count();
6969
// On a single-CPU machine we still can run C1 and C2 compiler threads, so allow up to 2x for tiered.
70-
int reasonable_threads_num = CompilerConfig::is_tiered() ? active_processor_count * 2 : active_processor_count;
70+
int reasonable_threads_num = MAX2(2, CompilerConfig::is_tiered() ? active_processor_count * 2 : active_processor_count);
7171
if (value > reasonable_threads_num) {
7272
JVMFlag::printError(verbose, "CICompilerCount is too large (%" PRIdPTR ") for current active processor count %d \n",
7373
CICompilerCount, active_processor_count);

test/hotspot/jtreg/ProblemList-Virtual.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
####
2525
# Bugs
2626

27+
runtime/jni/critical/SuspendInCritical.java 8384369 generic-all
2728
serviceability/AsyncGetCallTrace/MyPackage/ASGCTBaseTest.java 8308026 generic-all
2829
serviceability/jvmti/Heap/IterateHeapWithEscapeAnalysisEnabled.java 8264699 generic-all
2930
vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2manyDiff_a/TestDescription.java 8308367 generic-all

test/hotspot/jtreg/ProblemList-Xcomp.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,9 @@ gc/arguments/TestNewSizeFlags.java 8299116 macosx-aarch64
6565

6666
# Valhalla failures start here:
6767

68+
compiler/valhalla/inlinetypes/TestArrayNullMarkers.java#AVF 8374742 generic-all
69+
compiler/valhalla/inlinetypes/TestArrayNullMarkers.java#NVF 8374742 generic-all
70+
compiler/valhalla/inlinetypes/TestArrayNullMarkers.java#NVF-AVF 8374742 generic-all
71+
compiler/valhalla/inlinetypes/TestArrayNullMarkers.java#NVF-nAVF 8374742 generic-all
72+
6873
runtime/cds/appcds/cacheObject/ArchivedFlatArrayTest.java 8378071 generic-all

test/hotspot/jtreg/ProblemList.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ serviceability/sa/TestJhsdbJstackMixedWithXComp.java#xcomp-disable-tiered-compil
216216

217217
vmTestbase/nsk/jdb/exclude/exclude001/exclude001.java 8375062 windows-x64
218218
vmTestbase/nsk/jdi/Scenarios/invokeMethod/popframes001/TestDescription.java 8375076 windows-x64
219+
vmTestbase/nsk/jvmti/IterateOverReachableObjects/iterreachobj002/TestDescription.java 8384882 linux-all
219220

220221
# The following test failures DID NOT reproduce during Tier[1-8] testing
221222
# done for 8377828. Further analysis is being done with 8376235:

test/hotspot/jtreg/compiler/arguments/CheckCICompilerCount.java

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
/*
2525
* @test CheckCheckCICompilerCount
26-
* @bug 8130858 8132525 8162881 8379396
26+
* @bug 8130858 8132525 8162881 8379396 8384124
2727
* @summary Check that correct range of values for CICompilerCount are allowed depending on whether tiered is enabled or not
2828
* @library /test/lib /
2929
* @requires vm.flagless
@@ -204,6 +204,41 @@ public class CheckCICompilerCount {
204204
1,
205205
};
206206

207+
private static final String[][] ACTIVE_PROCESSOR_ARGUMENTS = {
208+
{
209+
"-server",
210+
"-XX:ActiveProcessorCount=1",
211+
"-XX:TieredStopAtLevel=0",
212+
"-XX:+PrintFlagsFinal",
213+
"-version"
214+
},
215+
{
216+
"-server",
217+
"-XX:ActiveProcessorCount=1",
218+
"-XX:TieredStopAtLevel=1",
219+
"-XX:+PrintFlagsFinal",
220+
"-version"
221+
},
222+
{
223+
"-server",
224+
"-XX:ActiveProcessorCount=1",
225+
"-XX:+PrintFlagsFinal",
226+
"-version"
227+
},
228+
};
229+
230+
private static final String[] ACTIVE_PROCESSOR_EXPECTED_OUTPUTS = {
231+
"intx CICompilerCount = 0 {product}",
232+
"intx CICompilerCount = 1 {product}",
233+
"intx CICompilerCount = 2 {product}",
234+
};
235+
236+
private static final int[] ACTIVE_PROCESSOR_EXIT = {
237+
0,
238+
0,
239+
0,
240+
};
241+
207242
private static void verifyOptionBehavior(String[] arguments, String expected_output, int exit, boolean tiered) throws Exception {
208243
ProcessBuilder pb;
209244
OutputAnalyzer out;
@@ -232,6 +267,14 @@ public static void main(String[] args) throws Exception {
232267
throw new RuntimeException("Test is set up incorrectly: length of arguments, expected outputs and exit codes in tiered mode of operation do not match.");
233268
}
234269

270+
if (INVALID_ARGUMENTS.length != INVALID_EXPECTED_OUTPUTS.length || INVALID_ARGUMENTS.length != INVALID_EXIT.length) {
271+
throw new RuntimeException("Test is set up incorrectly: length of arguments, expected outputs and exit codes in invalid arguments cases do not match.");
272+
}
273+
274+
if (ACTIVE_PROCESSOR_ARGUMENTS.length != ACTIVE_PROCESSOR_EXPECTED_OUTPUTS.length || ACTIVE_PROCESSOR_ARGUMENTS.length != ACTIVE_PROCESSOR_EXIT.length) {
275+
throw new RuntimeException("Test is set up incorrectly: length of arguments, expected outputs and exit codes in ActiveProcessorCount cases do not match.");
276+
}
277+
235278
for (int i = 0; i < NON_TIERED_ARGUMENTS.length; i++) {
236279
verifyOptionBehavior(NON_TIERED_ARGUMENTS[i], NON_TIERED_EXPECTED_OUTPUTS[i], NON_TIERED_EXIT[i], false);
237280
}
@@ -243,5 +286,12 @@ public static void main(String[] args) throws Exception {
243286
for (int i = 0; i < INVALID_ARGUMENTS.length; i++) {
244287
verifyOptionBehavior(INVALID_ARGUMENTS[i], INVALID_EXPECTED_OUTPUTS[i], INVALID_EXIT[i], true);
245288
}
289+
290+
for (int i = 0; i < ACTIVE_PROCESSOR_ARGUMENTS.length; i++) {
291+
verifyOptionBehavior(ACTIVE_PROCESSOR_ARGUMENTS[i],
292+
ACTIVE_PROCESSOR_EXPECTED_OUTPUTS[i],
293+
ACTIVE_PROCESSOR_EXIT[i],
294+
false);
295+
}
246296
}
247297
}
Lines changed: 68 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2026, 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
@@ -21,89 +21,91 @@
2121
* questions.
2222
*/
2323

24-
//
25-
// Security properties, once set, cannot revert to unset. To avoid
26-
// conflicts with tests running in the same VM isolate this test by
27-
// running it in otherVM mode.
28-
//
29-
3024
/*
3125
* @test
3226
* @bug 6302644
3327
* @summary X509KeyManager implementation for NewSunX509 doesn't return most
3428
* preferable key
35-
* @run main/othervm PreferredKey
29+
* @modules java.base/sun.security.x509
30+
* java.base/sun.security.util
31+
* @library /test/lib
3632
*/
37-
import java.io.*;
38-
import java.net.*;
39-
import java.security.*;
40-
import javax.net.ssl.*;
33+
import jdk.test.lib.Asserts;
34+
import jdk.test.lib.security.CertificateBuilder;
35+
36+
import javax.net.ssl.KeyManagerFactory;
37+
import javax.net.ssl.X509KeyManager;
38+
import java.io.IOException;
39+
import java.math.BigInteger;
40+
import java.security.KeyPair;
41+
import java.security.KeyPairGenerator;
42+
import java.security.KeyStore;
43+
import java.security.SecureRandom;
44+
import java.security.cert.Certificate;
45+
import java.security.cert.CertificateException;
46+
import java.security.cert.X509Certificate;
4147

4248
public class PreferredKey {
4349

44-
/*
45-
* =============================================================
46-
* Set the various variables needed for the tests, then
47-
* specify what tests to run on each side.
48-
*/
50+
public static void main(String[] args) throws Exception {
51+
X509KeyManager km = getKeyManager();
52+
53+
testPreferredKey(km, "RSA", new String[] {"RSA", "DSA"});
54+
testPreferredKey(km, "DSA", new String[] {"DSA", "RSA"});
55+
}
4956

50-
/*
51-
* Where do we find the keystores?
52-
*/
53-
static String pathToStores = "../../../../javax/net/ssl/etc";
54-
static String keyStoreFile = "keystore";
55-
static String passwd = "passphrase";
57+
private static void testPreferredKey(X509KeyManager km,
58+
String keyType,
59+
String[] multiKeyTypes) {
60+
String[] aliases = km.getClientAliases(keyType, null);
61+
String alias = km.chooseClientAlias(multiKeyTypes, null, null);
5662

63+
Asserts.assertTrue(aliases != null && alias != null,
64+
"Should return preferred alias");
5765

58-
public static void main(String[] args) throws Exception {
59-
// MD5 is used in this test case, don't disable MD5 algorithm.
60-
Security.setProperty("jdk.certpath.disabledAlgorithms",
61-
"MD2, RSA keySize < 1024");
62-
Security.setProperty("jdk.tls.disabledAlgorithms",
63-
"SSLv3, RC4, DH keySize < 768");
66+
String algorithm = km.getPrivateKey(alias).getAlgorithm();
67+
Asserts.assertTrue(algorithm.equals(keyType) && algorithm.equals(
68+
km.getPrivateKey(aliases[0]).getAlgorithm()),
69+
"Failed to get the preferable key aliases");
70+
}
6471

65-
KeyStore ks;
66-
KeyManagerFactory kmf;
67-
X509KeyManager km;
72+
private static X509KeyManager getKeyManager() throws Exception {
73+
char[] passphrase = "passphrase".toCharArray();
6874

69-
String keyFilename =
70-
System.getProperty("test.src", ".") + "/" + pathToStores +
71-
"/" + keyStoreFile;
72-
char [] password = passwd.toCharArray();
75+
KeyPair rsaKey = KeyPairGenerator.getInstance("RSA").generateKeyPair();
76+
KeyPair dsaKey = KeyPairGenerator.getInstance("DSA").generateKeyPair();
7377

74-
ks = KeyStore.getInstance(new File(keyFilename), password);
75-
kmf = KeyManagerFactory.getInstance("NewSunX509");
76-
kmf.init(ks, password);
77-
km = (X509KeyManager) kmf.getKeyManagers()[0];
78+
// create a key store
79+
KeyStore ks = KeyStore.getInstance("PKCS12");
80+
ks.load(null, passphrase);
7881

79-
/*
80-
* There should be both an rsa and a dsa entry in the
81-
* keystore, otherwise the test will no work.
82-
*/
83-
String[] aliases = km.getClientAliases("RSA", null);
84-
String alias = km.chooseClientAlias(new String[] {"RSA", "DSA"},
85-
null, null);
82+
ks.setKeyEntry("dummyrsa",
83+
rsaKey.getPrivate(),
84+
passphrase,
85+
new Certificate[]{createSelfSignedCert(rsaKey,
86+
"SHA256withRSA")});
87+
ks.setKeyEntry("dummydsa",
88+
dsaKey.getPrivate(),
89+
passphrase,
90+
new Certificate[]{createSelfSignedCert(dsaKey,
91+
"SHA256withDSA")});
8692

87-
// there're should both be null or nonnull
88-
if (aliases != null || alias != null) {
89-
String algorithm = km.getPrivateKey(alias).getAlgorithm();
90-
if (!algorithm.equals("RSA") || !algorithm.equals(
91-
km.getPrivateKey(aliases[0]).getAlgorithm())) {
92-
throw new Exception("Failed to get the preferable key aliases");
93-
}
94-
}
93+
KeyManagerFactory kmf = KeyManagerFactory.getInstance("NewSunX509");
94+
kmf.init(ks, passphrase);
9595

96-
aliases = km.getClientAliases("DSA", null);
97-
alias = km.chooseClientAlias(new String[] {"DSA", "RSA"},
98-
null, null);
96+
return (X509KeyManager) kmf.getKeyManagers()[0];
97+
}
9998

100-
// there're should both be null or nonnull
101-
if (aliases != null || alias != null) {
102-
String algorithm = km.getPrivateKey(alias).getAlgorithm();
103-
if (!algorithm.equals("DSA") || !algorithm.equals(
104-
km.getPrivateKey(aliases[0]).getAlgorithm())) {
105-
throw new Exception("Failed to get the preferable key aliases");
106-
}
107-
}
99+
private static X509Certificate createSelfSignedCert(KeyPair caKeys,
100+
String keyAlg)
101+
throws CertificateException, IOException {
102+
return (new CertificateBuilder()
103+
.setSubjectName("CN=dummy.example.com, OU=Dummy, " +
104+
"O=Dummy, L=Cupertino, ST=CA, C=US")
105+
.setPublicKey(caKeys.getPublic())
106+
.setOneHourValidity()
107+
.setSerialNumber(BigInteger.valueOf(
108+
new SecureRandom().nextLong(1000000) + 1))
109+
).build(null, caKeys.getPrivate(), keyAlg);
108110
}
109111
}

0 commit comments

Comments
 (0)