From dbf5a9a4006020ddebcce89692ce8826b6b2db46 Mon Sep 17 00:00:00 2001
From: Doug Simon
Date: Fri, 21 Jun 2024 13:43:03 +0000
Subject: [PATCH 001/288] 8334706: [JVMCI] APX registers incorrectly exposed on
AMD64
Reviewed-by: yzheng, never
---
.../share/classes/jdk/vm/ci/amd64/AMD64.java | 9 ++++-----
.../share/classes/jdk/vm/ci/code/Architecture.java | 8 ++++++++
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/amd64/AMD64.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/amd64/AMD64.java
index 9f3fc0cdbd6a9..83401fed62033 100644
--- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/amd64/AMD64.java
+++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/amd64/AMD64.java
@@ -83,11 +83,10 @@ public class AMD64 extends Architecture {
public static final Register r30 = new Register(30, 30, "r30", CPU);
public static final Register r31 = new Register(31, 31, "r31", CPU);
+ // The set of common CPU registers available on all x64 platforms.
public static final Register[] cpuRegisters = {
rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi,
- r8, r9, r10, r11, r12, r13, r14, r15,
- r16, r17, r18, r19, r20, r21, r22, r23,
- r24, r25, r26, r27, r28, r29, r30, r31
+ r8, r9, r10, r11, r12, r13, r14, r15
};
public static final RegisterCategory XMM = new RegisterCategory("XMM");
@@ -162,8 +161,6 @@ public class AMD64 extends Architecture {
public static final RegisterArray valueRegistersAVX512 = new RegisterArray(
rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi,
r8, r9, r10, r11, r12, r13, r14, r15,
- r16, r17, r18, r19, r20, r21, r22, r23,
- r24, r25, r26, r27, r28, r29, r30, r31,
xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,
xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,
xmm16, xmm17, xmm18, xmm19, xmm20, xmm21, xmm22, xmm23,
@@ -179,6 +176,8 @@ public class AMD64 extends Architecture {
public static final RegisterArray allRegisters = new RegisterArray(
rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi,
r8, r9, r10, r11, r12, r13, r14, r15,
+ r16, r17, r18, r19, r20, r21, r22, r23,
+ r24, r25, r26, r27, r28, r29, r30, r31,
xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,
xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15,
xmm16, xmm17, xmm18, xmm19, xmm20, xmm21, xmm22, xmm23,
diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/Architecture.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/Architecture.java
index 0b00628aceaf3..f14855cd6b995 100644
--- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/Architecture.java
+++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/Architecture.java
@@ -26,6 +26,7 @@
import java.util.Set;
import jdk.vm.ci.code.Register.RegisterCategory;
+import jdk.vm.ci.common.JVMCIError;
import jdk.vm.ci.meta.JavaKind;
import jdk.vm.ci.meta.PlatformKind;
@@ -81,6 +82,13 @@ public abstract class Architecture {
protected Architecture(String name, PlatformKind wordKind, ByteOrder byteOrder, boolean unalignedMemoryAccess, RegisterArray registers, int implicitMemoryBarriers,
int nativeCallDisplacementOffset,
int returnAddressSize) {
+ // registers is expected to mention all registers in order of their encoding.
+ for (int i = 0; i < registers.size(); ++i) {
+ if (registers.get(i).number != i) {
+ Register reg = registers.get(i);
+ throw new JVMCIError("%s: %d != %d", reg, reg.number, i);
+ }
+ }
this.name = name;
this.registers = registers;
this.wordKind = wordKind;
From 9f8de221d7f0186718411ab3f5217e3883237e84 Mon Sep 17 00:00:00 2001
From: Kevin Walls
Date: Fri, 21 Jun 2024 13:51:06 +0000
Subject: [PATCH 002/288] 8327793: Deprecate jstatd for removal
Reviewed-by: alanb, cjplummer
---
src/jdk.jstatd/share/classes/module-info.java | 3 ++-
src/jdk.jstatd/share/classes/sun/tools/jstatd/Jstatd.java | 4 +++-
test/jdk/sun/tools/jstatd/JstatdTest.java | 2 +-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/jdk.jstatd/share/classes/module-info.java b/src/jdk.jstatd/share/classes/module-info.java
index ade59da4248cd..e9a9521ac73fc 100644
--- a/src/jdk.jstatd/share/classes/module-info.java
+++ b/src/jdk.jstatd/share/classes/module-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2024, Oracle and/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
@@ -32,6 +32,7 @@
* @moduleGraph
* @since 9
*/
+@Deprecated(since="24", forRemoval=true)
module jdk.jstatd {
requires java.rmi;
requires jdk.internal.jvmstat;
diff --git a/src/jdk.jstatd/share/classes/sun/tools/jstatd/Jstatd.java b/src/jdk.jstatd/share/classes/sun/tools/jstatd/Jstatd.java
index 5dc7f1fa2fbce..cfd1212a67aba 100644
--- a/src/jdk.jstatd/share/classes/sun/tools/jstatd/Jstatd.java
+++ b/src/jdk.jstatd/share/classes/sun/tools/jstatd/Jstatd.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2024, Oracle and/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
@@ -80,6 +80,8 @@ public static void main(String[] args) {
int rmiPort = 0;
int argc = 0;
+ System.err.println("WARNING: jstatd is deprecated and will be removed in a future release.");
+
for ( ; (argc < args.length) && (args[argc].startsWith("-")); argc++) {
String arg = args[argc];
diff --git a/test/jdk/sun/tools/jstatd/JstatdTest.java b/test/jdk/sun/tools/jstatd/JstatdTest.java
index b2ac3804f6805..5041bc40d7510 100644
--- a/test/jdk/sun/tools/jstatd/JstatdTest.java
+++ b/test/jdk/sun/tools/jstatd/JstatdTest.java
@@ -356,7 +356,7 @@ private void runTest(boolean useShortSyntax) throws Throwable {
OutputAnalyzer output = jstatdThread.getOutput();
List stdout = output.asLinesWithoutVMWarnings();
output.reportDiagnosticSummary();
- assertEquals(stdout.size(), 1, "Output should contain one line");
+ assertEquals(stdout.size(), 2, "Output should contain two lines"); // includes deprecation warning
assertTrue(stdout.get(0).startsWith("jstatd started"), "List should start with 'jstatd started'");
assertNotEquals(output.getExitValue(), 0,
"jstatd process exited with unexpected exit code");
From 75bea280b9adb6dac9fefafbb3f4b212f100fbb5 Mon Sep 17 00:00:00 2001
From: Ferenc Rakoczi
Date: Fri, 21 Jun 2024 14:16:23 +0000
Subject: [PATCH 003/288] 8333867: SHA3 performance can be improved
Reviewed-by: kvn, valeriep
---
src/hotspot/share/opto/library_call.cpp | 4 +-
.../sun/security/provider/DigestBase.java | 4 +-
.../classes/sun/security/provider/SHA3.java | 105 ++++++++----------
3 files changed, 51 insertions(+), 62 deletions(-)
diff --git a/src/hotspot/share/opto/library_call.cpp b/src/hotspot/share/opto/library_call.cpp
index b3253a817a408..596e637652dfb 100644
--- a/src/hotspot/share/opto/library_call.cpp
+++ b/src/hotspot/share/opto/library_call.cpp
@@ -7681,7 +7681,7 @@ bool LibraryCallKit::inline_digestBase_implCompress(vmIntrinsics::ID id) {
break;
case vmIntrinsics::_sha3_implCompress:
assert(UseSHA3Intrinsics, "need SHA3 instruction support");
- state = get_state_from_digest_object(digestBase_obj, T_BYTE);
+ state = get_state_from_digest_object(digestBase_obj, T_LONG);
stubAddr = StubRoutines::sha3_implCompress();
stubName = "sha3_implCompress";
block_size = get_block_size_from_digest_object(digestBase_obj);
@@ -7781,7 +7781,7 @@ bool LibraryCallKit::inline_digestBase_implCompressMB(int predicate) {
klass_digestBase_name = "sun/security/provider/SHA3";
stub_name = "sha3_implCompressMB";
stub_addr = StubRoutines::sha3_implCompressMB();
- elem_type = T_BYTE;
+ elem_type = T_LONG;
}
break;
default:
diff --git a/src/java.base/share/classes/sun/security/provider/DigestBase.java b/src/java.base/share/classes/sun/security/provider/DigestBase.java
index dbe59396ac0b6..2aaf0a2fac6fd 100644
--- a/src/java.base/share/classes/sun/security/provider/DigestBase.java
+++ b/src/java.base/share/classes/sun/security/provider/DigestBase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, Oracle and/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
@@ -61,7 +61,7 @@ abstract class DigestBase extends MessageDigestSpi implements Cloneable {
private final int digestLength;
// size of the input to the compression function in bytes
- private final int blockSize;
+ protected final int blockSize;
// buffer to store partial blocks, blockSize bytes large
// Subclasses should not access this array directly except possibly in their
// implDigest() method. See MD5.java as an example.
diff --git a/src/java.base/share/classes/sun/security/provider/SHA3.java b/src/java.base/share/classes/sun/security/provider/SHA3.java
index 2b8bf8afbedaf..eaccf2a88e922 100644
--- a/src/java.base/share/classes/sun/security/provider/SHA3.java
+++ b/src/java.base/share/classes/sun/security/provider/SHA3.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2024, Oracle and/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
@@ -25,13 +25,14 @@
package sun.security.provider;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.VarHandle;
+import java.nio.ByteOrder;
import java.security.ProviderException;
import java.util.Arrays;
import java.util.Objects;
import jdk.internal.vm.annotation.IntrinsicCandidate;
-import static sun.security.provider.ByteArrayAccess.b2lLittle;
-import static sun.security.provider.ByteArrayAccess.l2bLittle;
/**
* This class implements the Secure Hash Algorithm SHA-3 developed by
@@ -48,7 +49,7 @@
abstract class SHA3 extends DigestBase {
private static final int WIDTH = 200; // in bytes, e.g. 1600 bits
- private static final int DM = 5; // dimension of lanes
+ private static final int DM = 5; // dimension of state matrix
private static final int NR = 24; // number of rounds
@@ -65,8 +66,11 @@ abstract class SHA3 extends DigestBase {
};
private final byte suffix;
- private byte[] state = new byte[WIDTH];
- private long[] lanes = new long[DM*DM];
+ private long[] state = new long[DM*DM];
+
+ static final VarHandle asLittleEndian
+ = MethodHandles.byteArrayViewVarHandle(long[].class,
+ ByteOrder.LITTLE_ENDIAN).withInvokeExactBehavior();
/**
* Creates a new SHA-3 object.
@@ -91,10 +95,12 @@ void implCompress(byte[] b, int ofs) {
@IntrinsicCandidate
private void implCompress0(byte[] b, int ofs) {
- for (int i = 0; i < buffer.length; i++) {
- state[i] ^= b[ofs++];
- }
- keccak();
+ for (int i = 0; i < blockSize / 8; i++) {
+ state[i] ^= (long) asLittleEndian.get(b, ofs);
+ ofs += 8;
+ }
+
+ keccak();
}
/**
@@ -102,29 +108,43 @@ private void implCompress0(byte[] b, int ofs) {
* DigestBase calls implReset() when necessary.
*/
void implDigest(byte[] out, int ofs) {
+ byte[] byteState = new byte[8];
int numOfPadding =
- setPaddingBytes(suffix, buffer, (int)(bytesProcessed % buffer.length));
+ setPaddingBytes(suffix, buffer, (int)(bytesProcessed % blockSize));
if (numOfPadding < 1) {
throw new ProviderException("Incorrect pad size: " + numOfPadding);
}
implCompress(buffer, 0);
- int availableBytes = buffer.length;
+ int availableBytes = blockSize; // i.e. buffer.length
int numBytes = engineGetDigestLength();
while (numBytes > availableBytes) {
- System.arraycopy(state, 0, out, ofs, availableBytes);
+ for (int i = 0; i < availableBytes / 8 ; i++) {
+ asLittleEndian.set(out, ofs, state[i]);
+ ofs += 8;
+ }
numBytes -= availableBytes;
- ofs += availableBytes;
keccak();
}
- System.arraycopy(state, 0, out, ofs, numBytes);
+ int numLongs = (numBytes + 7) / 8;
+
+ for (int i = 0; i < numLongs - 1; i++) {
+ asLittleEndian.set(out, ofs, state[i]);
+ ofs += 8;
+ }
+ if (numBytes == numLongs * 8) {
+ asLittleEndian.set(out, ofs, state[numLongs - 1]);
+ } else {
+ asLittleEndian.set(byteState, 0, state[numLongs - 1]);
+ System.arraycopy(byteState, 0,
+ out, ofs, numBytes - (numLongs - 1) * 8);
+ }
}
/**
* Resets the internal state to start a new hash.
*/
void implReset() {
- Arrays.fill(state, (byte)0);
- Arrays.fill(lanes, 0L);
+ Arrays.fill(state, 0L);
}
/**
@@ -144,46 +164,19 @@ private static int setPaddingBytes(byte suffix, byte[] in, int len) {
return (in.length - len);
}
- /**
- * Utility function for transforming the specified byte array 's'
- * into array of lanes 'm' as defined in section 3.1.2.
- */
- private static void bytes2Lanes(byte[] s, long[] m) {
- int sOfs = 0;
- // Conversion traverses along x-axis before y-axis
- for (int y = 0; y < DM; y++, sOfs += 40) {
- b2lLittle(s, sOfs, m, DM*y, 40);
- }
- }
-
- /**
- * Utility function for transforming the specified array of
- * lanes 'm' into a byte array 's' as defined in section 3.1.3.
- */
- private static void lanes2Bytes(long[] m, byte[] s) {
- int sOfs = 0;
- // Conversion traverses along x-axis before y-axis
- for (int y = 0; y < DM; y++, sOfs += 40) {
- l2bLittle(m, DM*y, s, sOfs, 40);
- }
- }
-
/**
* The function Keccak as defined in section 5.2 with
* rate r = 1600 and capacity c.
*/
private void keccak() {
- // convert the 200-byte state into 25 lanes
- bytes2Lanes(state, lanes);
-
long a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12;
long a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23, a24;
// move data into local variables
- a0 = lanes[0]; a1 = lanes[1]; a2 = lanes[2]; a3 = lanes[3]; a4 = lanes[4];
- a5 = lanes[5]; a6 = lanes[6]; a7 = lanes[7]; a8 = lanes[8]; a9 = lanes[9];
- a10 = lanes[10]; a11 = lanes[11]; a12 = lanes[12]; a13 = lanes[13]; a14 = lanes[14];
- a15 = lanes[15]; a16 = lanes[16]; a17 = lanes[17]; a18 = lanes[18]; a19 = lanes[19];
- a20 = lanes[20]; a21 = lanes[21]; a22 = lanes[22]; a23 = lanes[23]; a24 = lanes[24];
+ a0 = state[0]; a1 = state[1]; a2 = state[2]; a3 = state[3]; a4 = state[4];
+ a5 = state[5]; a6 = state[6]; a7 = state[7]; a8 = state[8]; a9 = state[9];
+ a10 = state[10]; a11 = state[11]; a12 = state[12]; a13 = state[13]; a14 = state[14];
+ a15 = state[15]; a16 = state[16]; a17 = state[17]; a18 = state[18]; a19 = state[19];
+ a20 = state[20]; a21 = state[21]; a22 = state[22]; a23 = state[23]; a24 = state[24];
// process the lanes through step mappings
for (int ir = 0; ir < NR; ir++) {
@@ -287,20 +280,16 @@ private void keccak() {
a0 ^= RC_CONSTANTS[ir];
}
- lanes[0] = a0; lanes[1] = a1; lanes[2] = a2; lanes[3] = a3; lanes[4] = a4;
- lanes[5] = a5; lanes[6] = a6; lanes[7] = a7; lanes[8] = a8; lanes[9] = a9;
- lanes[10] = a10; lanes[11] = a11; lanes[12] = a12; lanes[13] = a13; lanes[14] = a14;
- lanes[15] = a15; lanes[16] = a16; lanes[17] = a17; lanes[18] = a18; lanes[19] = a19;
- lanes[20] = a20; lanes[21] = a21; lanes[22] = a22; lanes[23] = a23; lanes[24] = a24;
-
- // convert the resulting 25 lanes back into 200-byte state
- lanes2Bytes(lanes, state);
+ state[0] = a0; state[1] = a1; state[2] = a2; state[3] = a3; state[4] = a4;
+ state[5] = a5; state[6] = a6; state[7] = a7; state[8] = a8; state[9] = a9;
+ state[10] = a10; state[11] = a11; state[12] = a12; state[13] = a13; state[14] = a14;
+ state[15] = a15; state[16] = a16; state[17] = a17; state[18] = a18; state[19] = a19;
+ state[20] = a20; state[21] = a21; state[22] = a22; state[23] = a23; state[24] = a24;
}
public Object clone() throws CloneNotSupportedException {
SHA3 copy = (SHA3) super.clone();
copy.state = copy.state.clone();
- copy.lanes = new long[DM*DM];
return copy;
}
From c41293a70834a79c79e859ebcdb8869884ac87dc Mon Sep 17 00:00:00 2001
From: Jie Fu
Date: Fri, 21 Jun 2024 14:23:38 +0000
Subject: [PATCH 004/288] 8334695: Fix build failure without zgc after
JDK-8333300
Reviewed-by: dnsimon, chagedorn
---
src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp | 4 +++-
src/hotspot/share/jvmci/jvmciCompilerToVM.hpp | 4 +++-
src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp | 4 +++-
src/hotspot/share/jvmci/vmStructs_jvmci.cpp | 2 +-
4 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp b/src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp
index 21095692d19dc..8eff2590bfcea 100644
--- a/src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp
+++ b/src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2024, Oracle and/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
@@ -220,6 +220,7 @@ bool CodeInstaller::pd_relocate(address pc, jint mark) {
// see comment above for POLL_FAR
_instructions->relocate(pc, relocInfo::poll_return_type, Assembler::imm_operand);
return true;
+#if INCLUDE_ZGC
case Z_BARRIER_RELOCATION_FORMAT_LOAD_GOOD_BEFORE_SHL:
_instructions->relocate(pc, barrier_Relocation::spec(), ZBarrierRelocationFormatLoadGoodBeforeShl);
return true;
@@ -241,6 +242,7 @@ bool CodeInstaller::pd_relocate(address pc, jint mark) {
case Z_BARRIER_RELOCATION_FORMAT_STORE_GOOD_AFTER_MOV:
_instructions->relocate(pc, barrier_Relocation::spec(), ZBarrierRelocationFormatStoreGoodAfterMov);
return true;
+#endif
default:
return false;
}
diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp b/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp
index b7ae365c1936d..2208813f170d6 100644
--- a/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2024, Oracle and/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
@@ -104,7 +104,9 @@ class CompilerToVM {
static int sizeof_narrowKlass;
static int sizeof_arrayOopDesc;
static int sizeof_BasicLock;
+#if INCLUDE_ZGC
static int sizeof_ZStoreBarrierEntry;
+#endif
static address dsin;
static address dcos;
diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp
index 220667ad2ced0..8595ac193fb8b 100644
--- a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2024, Oracle and/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
@@ -123,7 +123,9 @@ int CompilerToVM::Data::sizeof_ConstantPool = sizeof(ConstantPool);
int CompilerToVM::Data::sizeof_narrowKlass = sizeof(narrowKlass);
int CompilerToVM::Data::sizeof_arrayOopDesc = sizeof(arrayOopDesc);
int CompilerToVM::Data::sizeof_BasicLock = sizeof(BasicLock);
+#if INCLUDE_ZGC
int CompilerToVM::Data::sizeof_ZStoreBarrierEntry = sizeof(ZStoreBarrierEntry);
+#endif
address CompilerToVM::Data::dsin;
address CompilerToVM::Data::dcos;
diff --git a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp
index 73bac7bd0909c..fea308503cf71 100644
--- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp
+++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp
@@ -121,7 +121,7 @@
static_field(CompilerToVM::Data, sizeof_narrowKlass, int) \
static_field(CompilerToVM::Data, sizeof_arrayOopDesc, int) \
static_field(CompilerToVM::Data, sizeof_BasicLock, int) \
- static_field(CompilerToVM::Data, sizeof_ZStoreBarrierEntry, int) \
+ ZGC_ONLY(static_field(CompilerToVM::Data, sizeof_ZStoreBarrierEntry, int)) \
\
static_field(CompilerToVM::Data, dsin, address) \
static_field(CompilerToVM::Data, dcos, address) \
From 93d98027649615afeeeb6a9510230d9655a74a8f Mon Sep 17 00:00:00 2001
From: SendaoYan
Date: Fri, 21 Jun 2024 15:48:38 +0000
Subject: [PATCH 005/288] 8334715: [riscv] Mixed use of tab and whitespace in
riscv.ad
Reviewed-by: chagedorn, amitkumar
---
src/hotspot/cpu/riscv/riscv.ad | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/hotspot/cpu/riscv/riscv.ad b/src/hotspot/cpu/riscv/riscv.ad
index 533b548c88109..798caee7375d8 100644
--- a/src/hotspot/cpu/riscv/riscv.ad
+++ b/src/hotspot/cpu/riscv/riscv.ad
@@ -242,7 +242,7 @@ reg_def V0_H ( SOC, SOC, Op_VecA, 0, v0->as_VMReg()->next() );
reg_def V0_J ( SOC, SOC, Op_VecA, 0, v0->as_VMReg()->next(2) );
reg_def V0_K ( SOC, SOC, Op_VecA, 0, v0->as_VMReg()->next(3) );
-reg_def V1 ( SOC, SOC, Op_VecA, 1, v1->as_VMReg() );
+reg_def V1 ( SOC, SOC, Op_VecA, 1, v1->as_VMReg() );
reg_def V1_H ( SOC, SOC, Op_VecA, 1, v1->as_VMReg()->next() );
reg_def V1_J ( SOC, SOC, Op_VecA, 1, v1->as_VMReg()->next(2) );
reg_def V1_K ( SOC, SOC, Op_VecA, 1, v1->as_VMReg()->next(3) );
@@ -262,7 +262,7 @@ reg_def V4_H ( SOC, SOC, Op_VecA, 4, v4->as_VMReg()->next() );
reg_def V4_J ( SOC, SOC, Op_VecA, 4, v4->as_VMReg()->next(2) );
reg_def V4_K ( SOC, SOC, Op_VecA, 4, v4->as_VMReg()->next(3) );
-reg_def V5 ( SOC, SOC, Op_VecA, 5, v5->as_VMReg() );
+reg_def V5 ( SOC, SOC, Op_VecA, 5, v5->as_VMReg() );
reg_def V5_H ( SOC, SOC, Op_VecA, 5, v5->as_VMReg()->next() );
reg_def V5_J ( SOC, SOC, Op_VecA, 5, v5->as_VMReg()->next(2) );
reg_def V5_K ( SOC, SOC, Op_VecA, 5, v5->as_VMReg()->next(3) );
@@ -272,7 +272,7 @@ reg_def V6_H ( SOC, SOC, Op_VecA, 6, v6->as_VMReg()->next() );
reg_def V6_J ( SOC, SOC, Op_VecA, 6, v6->as_VMReg()->next(2) );
reg_def V6_K ( SOC, SOC, Op_VecA, 6, v6->as_VMReg()->next(3) );
-reg_def V7 ( SOC, SOC, Op_VecA, 7, v7->as_VMReg() );
+reg_def V7 ( SOC, SOC, Op_VecA, 7, v7->as_VMReg() );
reg_def V7_H ( SOC, SOC, Op_VecA, 7, v7->as_VMReg()->next() );
reg_def V7_J ( SOC, SOC, Op_VecA, 7, v7->as_VMReg()->next(2) );
reg_def V7_K ( SOC, SOC, Op_VecA, 7, v7->as_VMReg()->next(3) );
From 8e1d2b091c9a311d98a0b886a803fb18d4405d8a Mon Sep 17 00:00:00 2001
From: Rajan Halade
Date: Fri, 21 Jun 2024 16:37:57 +0000
Subject: [PATCH 006/288] 8334441: Mark tests in jdk_security_infra group as
manual
Reviewed-by: clanger, mullan
---
test/jdk/ProblemList.txt | 2 -
test/jdk/TEST.groups | 5 +-
.../certification/CAInterop.java | 268 +++++++++---------
.../certification/CertignaCA.java | 6 +-
.../certification/DTrustCA.java | 6 +-
.../certification/DigicertCSRootG5.java | 6 +-
.../certification/EmSignRootG2CA.java | 6 +-
.../certification/HaricaCA.java | 6 +-
.../certification/LuxTrustCA.java | 6 +-
.../javax/net/ssl/HttpsURLConnectionTest.java | 2 +-
10 files changed, 158 insertions(+), 155 deletions(-)
diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt
index 4ea08fa2bbc18..546f95b0054b1 100644
--- a/test/jdk/ProblemList.txt
+++ b/test/jdk/ProblemList.txt
@@ -620,8 +620,6 @@ javax/net/ssl/SSLSession/CertMsgCheck.java 8326705 generic-
sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java 8316183,8333317 generic-all
-security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java#teliasonerarootcav1 8333640 generic-all
-
############################################################################
# jdk_sound
diff --git a/test/jdk/TEST.groups b/test/jdk/TEST.groups
index fa868699aab38..0a8d27484652a 100644
--- a/test/jdk/TEST.groups
+++ b/test/jdk/TEST.groups
@@ -251,6 +251,8 @@ jdk_security = \
:jdk_security3 \
:jdk_security4
+# Tests in this group are manual as they depend on external infra
+# and may fail with external reasons, for instance - change in CA test portal.
jdk_security_infra = \
security/infra
@@ -618,6 +620,7 @@ jdk_core_manual_no_input = \
javax/xml/jaxp/datatype/8033980/GregorianCalAndDurSerDataUtil.java
jdk_security_manual_no_input = \
+ :jdk_security_infra \
com/sun/crypto/provider/Cipher/DES/PerformanceTest.java \
com/sun/crypto/provider/Cipher/AEAD/GCMIncrementByte4.java \
com/sun/crypto/provider/Cipher/AEAD/GCMIncrementDirect4.java \
@@ -661,4 +664,4 @@ jdk_containers_extended = \
jdk_core_no_security = \
:jdk_core \
- -:jdk_security
\ No newline at end of file
+ -:jdk_security
diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java
index 9f071bc145087..889926077a9fe 100644
--- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java
+++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java
@@ -27,12 +27,12 @@
* @summary Interoperability tests with Actalis CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp
* CAInterop actalisauthenticationrootca OCSP
- * @run main/othervm/timeout=180 -Djava.security.debug=certpath,ocsp
+ * @run main/othervm/manual/timeout=180 -Djava.security.debug=certpath,ocsp
* -Dcom.sun.security.ocsp.useget=false
* CAInterop actalisauthenticationrootca OCSP
- * @run main/othervm/timeout=180 -Djava.security.debug=certpath,ocsp
+ * @run main/othervm/manual/timeout=180 -Djava.security.debug=certpath,ocsp
* CAInterop actalisauthenticationrootca CRL
*/
@@ -42,9 +42,9 @@
* @summary Interoperability tests with Amazon's CA1
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop amazonrootca1 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop amazonrootca1 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop amazonrootca1 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop amazonrootca1 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop amazonrootca1 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop amazonrootca1 CRL
*/
/*
@@ -53,9 +53,9 @@
* @summary Interoperability tests with Amazon's CA2
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop amazonrootca2 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop amazonrootca2 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop amazonrootca2 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop amazonrootca2 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop amazonrootca2 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop amazonrootca2 CRL
*/
/*
@@ -64,9 +64,9 @@
* @summary Interoperability tests with Amazon's CA3
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop amazonrootca3 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop amazonrootca3 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop amazonrootca3 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop amazonrootca3 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop amazonrootca3 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop amazonrootca3 CRL
*/
/*
@@ -75,9 +75,9 @@
* @summary Interoperability tests with Amazon's CA4
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop amazonrootca4 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop amazonrootca4 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop amazonrootca4 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop amazonrootca4 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop amazonrootca4 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop amazonrootca4 CRL
*/
/*
@@ -86,9 +86,9 @@
* @summary Interoperability tests with Buypass Class 2 CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop buypassclass2ca OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop buypassclass2ca OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop buypassclass2ca CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop buypassclass2ca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop buypassclass2ca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop buypassclass2ca CRL
*/
/*
@@ -97,9 +97,9 @@
* @summary Interoperability tests with Buypass Class 3 CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop buypassclass3ca OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop buypassclass3ca OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop buypassclass3ca CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop buypassclass3ca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop buypassclass3ca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop buypassclass3ca CRL
*/
/*
@@ -108,9 +108,9 @@
* @summary Interoperability tests with Comodo RSA CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop comodorsaca OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop comodorsaca OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop comodorsaca CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop comodorsaca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop comodorsaca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop comodorsaca CRL
*/
/*
@@ -119,9 +119,9 @@
* @summary Interoperability tests with Comodo ECC CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop comodoeccca OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop comodoeccca OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop comodoeccca CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop comodoeccca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop comodoeccca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop comodoeccca CRL
*/
/*
@@ -130,9 +130,9 @@
* @summary Interoperability tests with Comodo userTrust RSA CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop usertrustrsaca OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop usertrustrsaca OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop usertrustrsaca CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop usertrustrsaca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop usertrustrsaca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop usertrustrsaca CRL
*/
/*
@@ -141,9 +141,9 @@
* @summary Interoperability tests with Comodo userTrust ECC CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop usertrusteccca OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop usertrusteccca OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop usertrusteccca CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop usertrusteccca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop usertrusteccca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop usertrusteccca CRL
*/
/*
@@ -152,8 +152,8 @@
* @summary Interoperability tests with Let's Encrypt ISRG Root X1 CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop letsencryptisrgx1 DEFAULT
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop letsencryptisrgx1 DEFAULT
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop letsencryptisrgx1 DEFAULT
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop letsencryptisrgx1 DEFAULT
*/
/*
@@ -162,8 +162,8 @@
* @summary Interoperability tests with Let's Encrypt ISRG Root X2 CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop letsencryptisrgx2 DEFAULT
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop letsencryptisrgx2 DEFAULT
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop letsencryptisrgx2 DEFAULT
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop letsencryptisrgx2 DEFAULT
*/
/*
@@ -172,9 +172,9 @@
* @summary Interoperability tests with GlobalSign R6 CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop globalsignrootcar6 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop globalsignrootcar6 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop globalsignrootcar6 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop globalsignrootcar6 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop globalsignrootcar6 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop globalsignrootcar6 CRL
*/
/*
@@ -183,9 +183,9 @@
* @summary Interoperability tests with Entrust CAs
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop entrustrootcaec1 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop entrustrootcaec1 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop entrustrootcaec1 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop entrustrootcaec1 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop entrustrootcaec1 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop entrustrootcaec1 CRL
*/
/*
@@ -194,9 +194,9 @@
* @summary Interoperability tests with Entrust CAs
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop entrustrootcag4 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop entrustrootcag4 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop entrustrootcag4 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop entrustrootcag4 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop entrustrootcag4 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop entrustrootcag4 CRL
*/
/*
@@ -205,9 +205,9 @@
* @summary Interoperability tests with GoDaddy CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop godaddyrootg2ca OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop godaddyrootg2ca OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop godaddyrootg2ca CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop godaddyrootg2ca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop godaddyrootg2ca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop godaddyrootg2ca CRL
*/
/*
@@ -216,9 +216,9 @@
* @summary Interoperability tests with Starfield CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop starfieldrootg2ca OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop starfieldrootg2ca OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop starfieldrootg2ca CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop starfieldrootg2ca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop starfieldrootg2ca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop starfieldrootg2ca CRL
*/
/*
@@ -227,8 +227,8 @@
* @summary Interoperability tests with Google's GlobalSign R4 and GTS Root certificates
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop globalsigneccrootcar4 DEFAULT
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop globalsigneccrootcar4 DEFAULT
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop globalsigneccrootcar4 DEFAULT
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop globalsigneccrootcar4 DEFAULT
*/
/*
@@ -237,8 +237,8 @@
* @summary Interoperability tests with Google's GlobalSign R4 and GTS Root certificates
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop gtsrootcar1 DEFAULT
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop gtsrootcar1 DEFAULT
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop gtsrootcar1 DEFAULT
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop gtsrootcar1 DEFAULT
*/
/*
@@ -247,8 +247,8 @@
* @summary Interoperability tests with Google's GlobalSign R4 and GTS Root certificates
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop gtsrootcar2 DEFAULT
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop gtsrootcar2 DEFAULT
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop gtsrootcar2 DEFAULT
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop gtsrootcar2 DEFAULT
*/
/*
@@ -257,8 +257,8 @@
* @summary Interoperability tests with Google's GlobalSign R4 and GTS Root certificates
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop gtsrootecccar3 DEFAULT
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop gtsrootecccar3 DEFAULT
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop gtsrootecccar3 DEFAULT
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop gtsrootecccar3 DEFAULT
*/
/*
@@ -267,8 +267,8 @@
* @summary Interoperability tests with Google's GlobalSign R4 and GTS Root certificates
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop gtsrootecccar4 DEFAULT
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop gtsrootecccar4 DEFAULT
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop gtsrootecccar4 DEFAULT
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop gtsrootecccar4 DEFAULT
*/
/*
@@ -277,9 +277,9 @@
* @summary Interoperability tests with Microsoft TLS root CAs
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop microsoftecc2017 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop microsoftecc2017 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop microsoftecc2017 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop microsoftecc2017 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop microsoftecc2017 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop microsoftecc2017 CRL
*/
/*
@@ -288,9 +288,9 @@
* @summary Interoperability tests with Microsoft TLS root CAs
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop microsoftrsa2017 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop microsoftrsa2017 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop microsoftrsa2017 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop microsoftrsa2017 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop microsoftrsa2017 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop microsoftrsa2017 CRL
*/
/*
@@ -299,9 +299,9 @@
* @summary Interoperability tests with QuoVadis Root CA1 G3 CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop quovadisrootca1g3 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop quovadisrootca1g3 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop quovadisrootca1g3 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop quovadisrootca1g3 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop quovadisrootca1g3 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop quovadisrootca1g3 CRL
*/
/*
@@ -310,9 +310,9 @@
* @summary Interoperability tests with QuoVadis Root CA2 G3 CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop quovadisrootca2g3 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop quovadisrootca2g3 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop quovadisrootca2g3 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop quovadisrootca2g3 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop quovadisrootca2g3 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop quovadisrootca2g3 CRL
*/
/*
@@ -321,9 +321,9 @@
* @summary Interoperability tests with QuoVadis Root CA3 G3 CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop quovadisrootca3g3 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop quovadisrootca3g3 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop quovadisrootca3g3 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop quovadisrootca3g3 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop quovadisrootca3g3 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop quovadisrootca3g3 CRL
*/
/*
@@ -332,9 +332,9 @@
* @summary Interoperability tests with DigiCert TLS ECC P384 Root G5
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop digicerttlseccrootg5 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop digicerttlseccrootg5 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop digicerttlseccrootg5 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop digicerttlseccrootg5 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop digicerttlseccrootg5 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop digicerttlseccrootg5 CRL
*/
/*
@@ -343,9 +343,9 @@
* @summary Interoperability tests with DigiCert TLS RSA4096 Root G5
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop digicerttlsrsarootg5 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop digicerttlsrsarootg5 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop digicerttlsrsarootg5 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop digicerttlsrsarootg5 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop digicerttlsrsarootg5 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop digicerttlsrsarootg5 CRL
*/
/*
@@ -354,9 +354,9 @@
* @summary Interoperability tests with SSL.com's RSA CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop sslrootrsaca OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop sslrootrsaca OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop sslrootrsaca CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop sslrootrsaca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop sslrootrsaca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop sslrootrsaca CRL
*/
/*
@@ -365,9 +365,9 @@
* @summary Interoperability tests with SSL.com's EV RSA CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop sslrootevrsaca OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop sslrootevrsaca OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop sslrootevrsaca CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop sslrootevrsaca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop sslrootevrsaca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop sslrootevrsaca CRL
*/
/*
@@ -376,9 +376,9 @@
* @summary Interoperability tests with SSL.com's ECC CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop sslrooteccca OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop sslrooteccca OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop sslrooteccca CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop sslrooteccca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop sslrooteccca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop sslrooteccca CRL
*/
/*
@@ -387,9 +387,9 @@
* @summary Interoperability tests with TeliaSonera Root CA v1
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop teliasonerarootcav1 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop teliasonerarootcav1 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop teliasonerarootcav1 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop teliasonerarootcav1 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop teliasonerarootcav1 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop teliasonerarootcav1 CRL
*/
/*
@@ -398,9 +398,9 @@
* @summary Interoperability tests with TWCA Global Root CA from TAIWAN-CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop twcaglobalrootca OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop twcaglobalrootca OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop twcaglobalrootca CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop twcaglobalrootca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop twcaglobalrootca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop twcaglobalrootca CRL
*/
/*
@@ -409,9 +409,9 @@
* @summary Interoperability tests with Certigna Root CAs from Dhimyotis
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop certignarootca OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop certignarootca OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop certignarootca CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop certignarootca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop certignarootca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop certignarootca CRL
*/
/*
@@ -420,9 +420,9 @@
* @summary Interoperability tests with AffirmTrust Commercial CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop affirmtrustcommercialca OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop affirmtrustcommercialca OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop affirmtrustcommercialca CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop affirmtrustcommercialca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop affirmtrustcommercialca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop affirmtrustcommercialca CRL
*/
/*
@@ -431,9 +431,9 @@
* @summary Interoperability tests with AffirmTrust Networking CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop affirmtrustnetworkingca OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop affirmtrustnetworkingca OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop affirmtrustnetworkingca CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop affirmtrustnetworkingca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop affirmtrustnetworkingca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop affirmtrustnetworkingca CRL
*/
/*
@@ -442,9 +442,9 @@
* @summary Interoperability tests with AffirmTrust Premium CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop affirmtrustpremiumca OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop affirmtrustpremiumca OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop affirmtrustpremiumca CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop affirmtrustpremiumca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop affirmtrustpremiumca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop affirmtrustpremiumca CRL
*/
/*
@@ -453,9 +453,9 @@
* @summary Interoperability tests with AffirmTrust Premium ECC CA
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop affirmtrustpremiumeccca OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop affirmtrustpremiumeccca OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop affirmtrustpremiumeccca CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop affirmtrustpremiumeccca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop affirmtrustpremiumeccca OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop affirmtrustpremiumeccca CRL
*/
/*
@@ -464,9 +464,9 @@
* @summary Interoperability tests with Telia Root CA V2
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop teliarootcav2 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop teliarootcav2 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop teliarootcav2 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop teliarootcav2 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop teliarootcav2 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop teliarootcav2 CRL
*/
/*
@@ -475,9 +475,9 @@
* @summary Interoperability tests with eMudhra Root CA G1
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop emsignrootcag1 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop emsignrootcag1 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop emsignrootcag1 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop emsignrootcag1 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop emsignrootcag1 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop emsignrootcag1 CRL
*/
/*
@@ -486,9 +486,9 @@
* @summary Interoperability tests with eMudhra ECC Root CA G3
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop emsigneccrootcag3 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop emsigneccrootcag3 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop emsigneccrootcag3 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop emsigneccrootcag3 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop emsigneccrootcag3 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop emsigneccrootcag3 CRL
*/
/*
@@ -497,8 +497,8 @@
* @summary Interoperability tests with Certainly Root R1
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop certainlyrootr1 DEFAULT
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop certainlyrootr1 DEFAULT
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop certainlyrootr1 DEFAULT
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop certainlyrootr1 DEFAULT
*/
/*
@@ -507,8 +507,8 @@
* @summary Interoperability tests with Certainly Root E1
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop certainlyroote1 DEFAULT
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop certainlyroote1 DEFAULT
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop certainlyroote1 DEFAULT
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop certainlyroote1 DEFAULT
*/
/*
@@ -517,9 +517,9 @@
* @summary Interoperability tests with GlobalSign Root R46
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop globalsignr46 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop globalsignr46 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop globalsignr46 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop globalsignr46 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop globalsignr46 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop globalsignr46 CRL
*/
/*
@@ -528,13 +528,15 @@
* @summary Interoperability tests with GlobalSign Root E46
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
- * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop globalsigne46 OCSP
- * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop globalsigne46 OCSP
- * @run main/othervm -Djava.security.debug=certpath CAInterop globalsigne46 CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp CAInterop globalsigne46 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop globalsigne46 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CAInterop globalsigne46 CRL
*/
/**
- * Collection of certificate validation tests for interoperability with external CAs
+ * Collection of certificate validation tests for interoperability with external CAs.
+ * These tests are marked as manual as they depend on external infrastructure and may fail
+ * with external reasons, for instance - change in CA test portal.
*/
public class CAInterop {
diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaCA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaCA.java
index f1dd2d6229a47..eb09d56a14e56 100644
--- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaCA.java
+++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaCA.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 2024, Oracle and/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
@@ -26,8 +26,8 @@
* @bug 8245654 8256895
* @summary Interoperability tests with Certigna Root CAs from Dhimyotis
* @build ValidatePathWithParams
- * @run main/othervm -Djava.security.debug=certpath CertignaCA OCSP
- * @run main/othervm -Djava.security.debug=certpath CertignaCA CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath CertignaCA OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath CertignaCA CRL
*/
public class CertignaCA {
// Owner: CN=Certigna Services CA, OID.2.5.4.97=NTRFR-48146308100036,
diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/DTrustCA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/DTrustCA.java
index 152e77907bb30..13a2e8044dac7 100644
--- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/DTrustCA.java
+++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/DTrustCA.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2024, Oracle and/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
@@ -27,8 +27,8 @@
* @summary Interoperability tests with "D-Trust Root Class 3 CA 2 2009" and
* "D-Trust Root Class 3 CA 2 EV 2009" CAs
* @build ValidatePathWithParams
- * @run main/othervm -Djava.security.debug=certpath DTrustCA OCSP
- * @run main/othervm -Djava.security.debug=certpath DTrustCA CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath DTrustCA OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath DTrustCA CRL
*/
public class DTrustCA {
diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/DigicertCSRootG5.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/DigicertCSRootG5.java
index 30ad81b1755c8..4b45bb857ba45 100644
--- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/DigicertCSRootG5.java
+++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/DigicertCSRootG5.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 2024, Oracle and/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
@@ -26,8 +26,8 @@
* @bug 8318759
* @summary Interoperability tests with Digicert CS Root G5 certificates
* @build ValidatePathWithParams
- * @run main/othervm -Djava.security.debug=ocsp,certpath DigicertCSRootG5 OCSP
- * @run main/othervm -Djava.security.debug=certpath DigicertCSRootG5 CRL
+ * @run main/othervm/manual -Djava.security.debug=ocsp,certpath DigicertCSRootG5 OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath DigicertCSRootG5 CRL
*/
public class DigicertCSRootG5 {
diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EmSignRootG2CA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EmSignRootG2CA.java
index 8f5df9cce755b..14e48a6e78fb1 100644
--- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EmSignRootG2CA.java
+++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EmSignRootG2CA.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2023, 2024, Oracle and/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
@@ -26,8 +26,8 @@
* @bug 8319187
* @summary Interoperability tests with eMudhra emSign Root CA G2 CS root
* @build ValidatePathWithParams
- * @run main/othervm -Djava.security.debug=certpath EmSignRootG2CA OCSP
- * @run main/othervm -Djava.security.debug=certpath EmSignRootG2CA CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath EmSignRootG2CA OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath EmSignRootG2CA CRL
*/
public class EmSignRootG2CA {
diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/HaricaCA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/HaricaCA.java
index 247502e6e6cfe..744e9b6bf34ed 100644
--- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/HaricaCA.java
+++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/HaricaCA.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021, 2024, Oracle and/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
@@ -26,8 +26,8 @@
* @bug 8256421
* @summary Interoperability tests with Harica CAs
* @build ValidatePathWithParams
- * @run main/othervm -Djava.security.debug=certpath HaricaCA OCSP
- * @run main/othervm -Djava.security.debug=certpath HaricaCA CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath HaricaCA OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath HaricaCA CRL
*/
/*
diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/LuxTrustCA.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/LuxTrustCA.java
index 469501c70c2f6..3e9631848c247 100644
--- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/LuxTrustCA.java
+++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/LuxTrustCA.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2024, Oracle and/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
@@ -26,8 +26,8 @@
* @bug 8232019 8256895
* @summary Interoperability tests with LuxTrust Global Root 2 CA
* @build ValidatePathWithParams
- * @run main/othervm -Djava.security.debug=certpath LuxTrustCA OCSP
- * @run main/othervm -Djava.security.debug=certpath LuxTrustCA CRL
+ * @run main/othervm/manual -Djava.security.debug=certpath LuxTrustCA OCSP
+ * @run main/othervm/manual -Djava.security.debug=certpath LuxTrustCA CRL
*/
/*
diff --git a/test/jdk/security/infra/javax/net/ssl/HttpsURLConnectionTest.java b/test/jdk/security/infra/javax/net/ssl/HttpsURLConnectionTest.java
index 7aeb67e842d5b..7e08d6cd4fefe 100644
--- a/test/jdk/security/infra/javax/net/ssl/HttpsURLConnectionTest.java
+++ b/test/jdk/security/infra/javax/net/ssl/HttpsURLConnectionTest.java
@@ -28,7 +28,7 @@
* KEYCHAINSTORE-ROOT trust store
* @library /test/lib
* @requires os.family == "mac"
- * @run main/othervm HttpsURLConnectionTest https://github.com KeychainStore-Root
+ * @run main/othervm/manual HttpsURLConnectionTest https://github.com KeychainStore-Root
*/
import java.io.*;
import java.net.*;
From 689cee3d0950e15e88a1f6738bfded00655dca9c Mon Sep 17 00:00:00 2001
From: Prasanta Sadhukhan
Date: Fri, 21 Jun 2024 18:02:57 +0000
Subject: [PATCH 007/288] 8334509: Cancelling PageDialog does not return the
same PageFormat object
Reviewed-by: aivanov, prr
---
.../native/libawt/windows/awt_PrintJob.cpp | 16 ++---
.../PrinterJob/PageDialogCancelTest.java | 58 +++++++++++++++++++
2 files changed, 67 insertions(+), 7 deletions(-)
create mode 100644 test/jdk/java/awt/print/PrinterJob/PageDialogCancelTest.java
diff --git a/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp b/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp
index c761533621870..9f126bded9418 100644
--- a/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp
+++ b/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp
@@ -522,6 +522,7 @@ Java_sun_awt_windows_WPageDialogPeer__1show(JNIEnv *env, jobject peer)
AwtComponent *awtParent = (parent != NULL) ? (AwtComponent *)JNI_GET_PDATA(parent) : NULL;
HWND hwndOwner = awtParent ? awtParent->GetHWnd() : NULL;
+ jboolean doIt = JNI_FALSE;
PAGESETUPDLG setup;
memset(&setup, 0, sizeof(setup));
@@ -577,7 +578,7 @@ Java_sun_awt_windows_WPageDialogPeer__1show(JNIEnv *env, jobject peer)
*/
if ((setup.hDevMode == NULL) && (setup.hDevNames == NULL)) {
CLEANUP_SHOW;
- return JNI_FALSE;
+ return doIt;
}
} else {
int measure = PSD_INTHOUSANDTHSOFINCHES;
@@ -605,7 +606,7 @@ Java_sun_awt_windows_WPageDialogPeer__1show(JNIEnv *env, jobject peer)
pageFormatToSetup(env, self, page, &setup, AwtPrintControl::getPrintDC(env, self));
if (env->ExceptionCheck()) {
CLEANUP_SHOW;
- return JNI_FALSE;
+ return doIt;
}
setup.lpfnPageSetupHook = reinterpret_cast(pageDlgHook);
@@ -619,7 +620,7 @@ Java_sun_awt_windows_WPageDialogPeer__1show(JNIEnv *env, jobject peer)
jobject paper = getPaper(env, page);
if (paper == NULL) {
CLEANUP_SHOW;
- return JNI_FALSE;
+ return doIt;
}
int units = setup.Flags & PSD_INTHOUSANDTHSOFINCHES ?
MM_HIENGLISH :
@@ -661,7 +662,7 @@ Java_sun_awt_windows_WPageDialogPeer__1show(JNIEnv *env, jobject peer)
setPaperValues(env, paper, &paperSize, &margins, units);
if (env->ExceptionCheck()) {
CLEANUP_SHOW;
- return JNI_FALSE;
+ return doIt;
}
/*
* Put the updated Paper instance and the orientation into
@@ -670,7 +671,7 @@ Java_sun_awt_windows_WPageDialogPeer__1show(JNIEnv *env, jobject peer)
setPaper(env, page, paper);
if (env->ExceptionCheck()) {
CLEANUP_SHOW;
- return JNI_FALSE;
+ return doIt;
}
setPageFormatOrientation(env, page, orientation);
if (env->ExceptionCheck()) {
@@ -684,12 +685,13 @@ Java_sun_awt_windows_WPageDialogPeer__1show(JNIEnv *env, jobject peer)
jboolean err = setPrintPaperSize(env, self, devmode->dmPaperSize);
if (err) {
CLEANUP_SHOW;
- return JNI_FALSE;
+ return doIt;
}
}
}
::GlobalUnlock(setup.hDevMode);
}
+ doIt = JNI_TRUE;
}
AwtDialog::CheckUninstallModalHook();
@@ -708,7 +710,7 @@ Java_sun_awt_windows_WPageDialogPeer__1show(JNIEnv *env, jobject peer)
CLEANUP_SHOW;
- return JNI_TRUE;
+ return doIt;
CATCH_BAD_ALLOC_RET(0);
}
diff --git a/test/jdk/java/awt/print/PrinterJob/PageDialogCancelTest.java b/test/jdk/java/awt/print/PrinterJob/PageDialogCancelTest.java
new file mode 100644
index 0000000000000..f9ce1b7c196a0
--- /dev/null
+++ b/test/jdk/java/awt/print/PrinterJob/PageDialogCancelTest.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2024, Oracle and/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.
+ */
+
+/*
+ * @test
+ * @bug 8334366
+ * @key headful printer
+ * @summary Verifies original pageobject is returned unmodified
+ * on cancelling pagedialog
+ * @requires (os.family == "windows")
+ * @run main PageDialogCancelTest
+ */
+
+import java.awt.Robot;
+import java.awt.event.KeyEvent;
+import java.awt.print.PageFormat;
+import java.awt.print.PrinterJob;
+
+public class PageDialogCancelTest {
+
+ public static void main(String[] args) throws Exception {
+ PrinterJob pj = PrinterJob.getPrinterJob();
+ PageFormat oldFormat = new PageFormat();
+ Robot robot = new Robot();
+ Thread t1 = new Thread(() -> {
+ robot.delay(2000);
+ robot.keyPress(KeyEvent.VK_ESCAPE);
+ robot.keyRelease(KeyEvent.VK_ESCAPE);
+ robot.waitForIdle();
+ });
+ t1.start();
+ PageFormat newFormat = pj.pageDialog(oldFormat);
+ if (!newFormat.equals(oldFormat)) {
+ throw new RuntimeException("Original PageFormat not returned on cancelling PageDialog");
+ }
+ }
+}
+
From 1ff5acdafff1ccd3e64c70eebbfbff75e0d783eb Mon Sep 17 00:00:00 2001
From: Nizar Benalla
Date: Fri, 21 Jun 2024 20:13:26 +0000
Subject: [PATCH 008/288] 8332099: since-checker - Add @ since to package-info
in jdk.jsobject
Reviewed-by: prr
---
.../share/classes/netscape/javascript/package-info.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/jdk.jsobject/share/classes/netscape/javascript/package-info.java b/src/jdk.jsobject/share/classes/netscape/javascript/package-info.java
index d3770732bc001..fcc97132a5074 100644
--- a/src/jdk.jsobject/share/classes/netscape/javascript/package-info.java
+++ b/src/jdk.jsobject/share/classes/netscape/javascript/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2024, Oracle and/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
@@ -33,6 +33,8 @@
* The classes in this package were initially specified by Netscape, and are the
* de facto standard mechanism for calling JavaScript from the Java runtime.
*
+ *
+ * @since 1.5
*/
package netscape.javascript;
From 7e55ed3b106ed08956d2d38b7c99fb81704667c9 Mon Sep 17 00:00:00 2001
From: Chen Liang
Date: Fri, 21 Jun 2024 22:38:38 +0000
Subject: [PATCH 009/288] 8333748: javap crash - Fatal error: Unmatched bit
position 0x2 for location CLASS
Reviewed-by: asotona
---
.../com/sun/tools/javap/AttributeWriter.java | 4 +-
.../com/sun/tools/javap/BasicWriter.java | 42 +++++-
.../com/sun/tools/javap/ClassWriter.java | 70 ++--------
.../tools/javap/UndefinedAccessFlagTest.java | 128 ++++++++++++++++++
4 files changed, 184 insertions(+), 60 deletions(-)
create mode 100644 test/langtools/tools/javap/UndefinedAccessFlagTest.java
diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java b/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java
index 839ac2fd041b7..3b9336c499d9c 100644
--- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2024, Oracle and/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
@@ -208,7 +208,7 @@ public void write(Attribute> a, CodeAttribute lr) {
indent(+1);
first = false;
}
- for (var flag : info.flags()) {
+ for (var flag : maskToAccessFlagsReportUnknown(access_flags, AccessFlag.Location.INNER_CLASS)) {
if (flag.sourceModifier() && (flag != AccessFlag.ABSTRACT
|| !info.has(AccessFlag.INTERFACE))) {
print(Modifier.toString(flag.mask()) + " ");
diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/javap/BasicWriter.java b/src/jdk.jdeps/share/classes/com/sun/tools/javap/BasicWriter.java
index 8629957f907fd..64eecf920829a 100644
--- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/BasicWriter.java
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/BasicWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2024, Oracle and/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
@@ -26,6 +26,12 @@
package com.sun.tools.javap;
import java.io.PrintWriter;
+import java.lang.classfile.AccessFlags;
+import java.lang.reflect.AccessFlag;
+import java.lang.reflect.Modifier;
+import java.util.EnumMap;
+import java.util.Map;
+import java.util.Set;
import java.util.function.Supplier;
/*
@@ -38,6 +44,26 @@
* deletion without notice.
*/
public class BasicWriter {
+ private static final Map LOCATION_MASKS;
+
+ static {
+ var map = new EnumMap(AccessFlag.Location.class);
+ for (var loc : AccessFlag.Location.values()) {
+ map.put(loc, 0);
+ }
+
+ for (var flag : AccessFlag.values()) {
+ for (var loc : flag.locations()) {
+ map.compute(loc, (_, v) -> v | flag.mask());
+ }
+ }
+
+ // Peculiarities from AccessFlag.maskToAccessFlag
+ map.compute(AccessFlag.Location.METHOD, (_, v) -> v | Modifier.STRICT);
+
+ LOCATION_MASKS = map;
+ }
+
protected BasicWriter(Context context) {
lineWriter = LineWriter.instance(context);
out = context.get(PrintWriter.class);
@@ -46,6 +72,20 @@ protected BasicWriter(Context context) {
throw new AssertionError();
}
+ protected Set flagsReportUnknown(AccessFlags flags) {
+ return maskToAccessFlagsReportUnknown(flags.flagsMask(), flags.location());
+ }
+
+ protected Set maskToAccessFlagsReportUnknown(int mask, AccessFlag.Location location) {
+ try {
+ return AccessFlag.maskToAccessFlags(mask, location);
+ } catch (IllegalArgumentException ex) {
+ mask &= LOCATION_MASKS.get(location);
+ report("Access Flags: " + ex.getMessage());
+ return AccessFlag.maskToAccessFlags(mask, location);
+ }
+ }
+
protected void print(String s) {
lineWriter.print(s);
}
diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/javap/ClassWriter.java b/src/jdk.jdeps/share/classes/com/sun/tools/javap/ClassWriter.java
index edf3d803af321..2483e99e49ad9 100644
--- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/ClassWriter.java
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/javap/ClassWriter.java
@@ -417,7 +417,7 @@ protected void writeField(FieldModel f) {
return;
var flags = AccessFlags.ofField(f.flags().flagsMask());
- writeModifiers(flags.flags().stream().filter(fl -> fl.sourceModifier())
+ writeModifiers(flagsReportUnknown(flags).stream().filter(fl -> fl.sourceModifier())
.map(fl -> Modifier.toString(fl.mask())).toList());
print(() -> sigPrinter.print(
f.findAttribute(Attributes.signature())
@@ -446,7 +446,7 @@ protected void writeField(FieldModel f) {
if (options.verbose)
writeList(String.format("flags: (0x%04x) ", flags.flagsMask()),
- flags.flags().stream().map(fl -> "ACC_" + fl.name()).toList(),
+ flagsReportUnknown(flags).stream().map(fl -> "ACC_" + fl.name()).toList(),
"\n");
if (options.showAllAttrs) {
@@ -478,7 +478,7 @@ protected void writeMethod(MethodModel m) {
int flags = m.flags().flagsMask();
var modifiers = new ArrayList();
- for (var f : AccessFlags.ofMethod(flags).flags())
+ for (var f : flagsReportUnknown(m.flags()))
if (f.sourceModifier()) modifiers.add(Modifier.toString(f.mask()));
String name = "???";
@@ -561,7 +561,7 @@ protected void writeMethod(MethodModel m) {
StringBuilder sb = new StringBuilder();
String sep = "";
sb.append(String.format("flags: (0x%04x) ", flags));
- for (var f : AccessFlags.ofMethod(flags).flags()) {
+ for (var f : flagsReportUnknown(m.flags())) {
sb.append(sep).append("ACC_").append(f.name());
sep = ", ";
}
@@ -794,17 +794,9 @@ else switch (c) {
}
}
- private static Set getClassModifiers(int mask) {
- return getModifiers(AccessFlags.ofClass((mask & ACC_INTERFACE) != 0
- ? mask & ~ACC_ABSTRACT : mask).flags());
- }
-
- private static Set getMethodModifiers(int mask) {
- return getModifiers(AccessFlags.ofMethod(mask).flags());
- }
-
- private static Set getFieldModifiers(int mask) {
- return getModifiers(AccessFlags.ofField(mask).flags());
+ private Set getClassModifiers(int mask) {
+ return getModifiers(flagsReportUnknown(AccessFlags.ofClass((mask & ACC_INTERFACE) != 0
+ ? mask & ~ACC_ABSTRACT : mask)));
}
private static Set getModifiers(Set flags) {
@@ -814,16 +806,16 @@ private static Set getModifiers(Set flags)
return s;
}
- private static Set getClassFlags(int mask) {
- return getFlags(mask, AccessFlags.ofClass(mask).flags());
+ private Set getClassFlags(int mask) {
+ return getFlags(mask, flagsReportUnknown(AccessFlags.ofClass(mask)));
}
- private static Set getMethodFlags(int mask) {
- return getFlags(mask, AccessFlags.ofMethod(mask).flags());
+ private Set getMethodFlags(int mask) {
+ return getFlags(mask, flagsReportUnknown(AccessFlags.ofMethod(mask)));
}
- private static Set getFieldFlags(int mask) {
- return getFlags(mask, AccessFlags.ofField(mask).flags());
+ private Set getFieldFlags(int mask) {
+ return getFlags(mask, flagsReportUnknown(AccessFlags.ofField(mask)));
}
private static Set getFlags(int mask, Set flags) {
@@ -840,42 +832,6 @@ private static Set getFlags(int mask, Set
return s;
}
- public static enum AccessFlag {
- ACC_PUBLIC (ClassFile.ACC_PUBLIC, "public", true, true, true, true ),
- ACC_PRIVATE (ClassFile.ACC_PRIVATE, "private", false, true, true, true ),
- ACC_PROTECTED (ClassFile.ACC_PROTECTED, "protected", false, true, true, true ),
- ACC_STATIC (ClassFile.ACC_STATIC, "static", false, true, true, true ),
- ACC_FINAL (ClassFile.ACC_FINAL, "final", true, true, true, true ),
- ACC_SUPER (ClassFile.ACC_SUPER, null, true, false, false, false),
- ACC_SYNCHRONIZED(ClassFile.ACC_SYNCHRONIZED, "synchronized", false, false, false, true ),
- ACC_VOLATILE (ClassFile.ACC_VOLATILE, "volatile", false, false, true, false),
- ACC_BRIDGE (ClassFile.ACC_BRIDGE, null, false, false, false, true ),
- ACC_TRANSIENT (ClassFile.ACC_TRANSIENT, "transient", false, false, true, false),
- ACC_VARARGS (ClassFile.ACC_VARARGS, null, false, false, false, true ),
- ACC_NATIVE (ClassFile.ACC_NATIVE, "native", false, false, false, true ),
- ACC_INTERFACE (ClassFile.ACC_INTERFACE, null, true, true, false, false),
- ACC_ABSTRACT (ClassFile.ACC_ABSTRACT, "abstract", true, true, false, true ),
- ACC_STRICT (ClassFile.ACC_STRICT, "strictfp", false, false, false, true ),
- ACC_SYNTHETIC (ClassFile.ACC_SYNTHETIC, null, true, true, true, true ),
- ACC_ANNOTATION (ClassFile.ACC_ANNOTATION, null, true, true, false, false),
- ACC_ENUM (ClassFile.ACC_ENUM, null, true, true, true, false),
- ACC_MODULE (ClassFile.ACC_MODULE, null, true, false, false, false);
-
- public final int flag;
- public final String modifier;
- public final boolean isClass, isInnerClass, isField, isMethod;
-
- AccessFlag(int flag, String modifier, boolean isClass,
- boolean isInnerClass, boolean isField, boolean isMethod) {
- this.flag = flag;
- this.modifier = modifier;
- this.isClass = isClass;
- this.isInnerClass = isInnerClass;
- this.isField = isField;
- this.isMethod = isMethod;
- }
- }
-
private final Options options;
private final AttributeWriter attrWriter;
private final CodeWriter codeWriter;
diff --git a/test/langtools/tools/javap/UndefinedAccessFlagTest.java b/test/langtools/tools/javap/UndefinedAccessFlagTest.java
new file mode 100644
index 0000000000000..bb531fa369c16
--- /dev/null
+++ b/test/langtools/tools/javap/UndefinedAccessFlagTest.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2024, Oracle and/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.
+ */
+
+/*
+ * @test 8333748
+ * @summary javap should not fail if reserved access flag bits are set to 1
+ * @library /tools/lib
+ * @modules jdk.jdeps/com.sun.tools.javap
+ * @enablePreview
+ * @run junit UndefinedAccessFlagTest
+ */
+
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.EnumSource;
+import toolbox.JavapTask;
+import toolbox.Task;
+import toolbox.ToolBox;
+
+import java.lang.classfile.AccessFlags;
+import java.lang.classfile.ClassModel;
+import java.lang.classfile.FieldModel;
+import java.lang.classfile.MethodModel;
+import java.lang.classfile.attribute.InnerClassInfo;
+import java.lang.classfile.attribute.InnerClassesAttribute;
+import java.nio.file.Files;
+import java.nio.file.Path;
+
+import static java.lang.classfile.ClassFile.*;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class UndefinedAccessFlagTest {
+
+ final ToolBox toolBox = new ToolBox();
+
+ enum TestLocation {
+ NONE(false), CLASS, FIELD, METHOD, INNER_CLASS(false);
+
+ final boolean fails;
+ TestLocation() { this(true); }
+ TestLocation(boolean fails) { this.fails = fails; }
+ }
+
+ @ParameterizedTest
+ @EnumSource(TestLocation.class)
+ void test(TestLocation location) throws Throwable {
+ var cf = of();
+ ClassModel cm;
+ try (var is = UndefinedAccessFlagTest.class.getResourceAsStream(
+ "/UndefinedAccessFlagTest$SampleInnerClass.class"
+ )) {
+ cm = cf.parse(is.readAllBytes());
+ }
+ var bytes = cf.transform(cm, (cb, ce) -> {
+ switch (ce) {
+ case AccessFlags flags when location == TestLocation.CLASS -> cb
+ .withFlags(flags.flagsMask() | ACC_PRIVATE);
+ case FieldModel f when location == TestLocation.FIELD -> cb
+ .transformField(f, (fb, fe) -> {
+ if (fe instanceof AccessFlags flags) {
+ fb.withFlags(flags.flagsMask() | ACC_SYNCHRONIZED);
+ } else {
+ fb.with(fe);
+ }
+ });
+ case MethodModel m when location == TestLocation.METHOD -> cb
+ .transformMethod(m, (mb, me) -> {
+ if (me instanceof AccessFlags flags) {
+ mb.withFlags(flags.flagsMask() | ACC_INTERFACE);
+ } else {
+ mb.with(me);
+ }
+ });
+ case InnerClassesAttribute attr when location == TestLocation.INNER_CLASS -> cb
+ .with(InnerClassesAttribute.of(attr.classes().stream()
+ .map(ic -> InnerClassInfo.of(ic.innerClass(), ic.outerClass(), ic.innerName(), ic.flagsMask() | 0x0020))
+ .toList()));
+ default -> cb.with(ce);
+ }
+ });
+
+ Files.write(Path.of("transformed.class"), bytes);
+
+ var lines = new JavapTask(toolBox)
+ .classes("transformed.class")
+ .options("-c", "-p", "-v")
+ .run(location.fails ? Task.Expect.FAIL : Task.Expect.SUCCESS)
+ .writeAll()
+ .getOutputLines(Task.OutputKind.DIRECT);
+
+ // No termination when access flag error happens
+ assertTrue(lines.stream().anyMatch(l -> l.contains("java.lang.String field;")));
+ assertTrue(lines.stream().anyMatch(l -> l.contains("UndefinedAccessFlagTest$SampleInnerClass();")));
+ assertTrue(lines.stream().anyMatch(l -> l.contains("void method();")));
+ assertTrue(lines.stream().anyMatch(l -> l.contains("SampleInnerClass=class UndefinedAccessFlagTest$SampleInnerClass of class UndefinedAccessFlagTest")));
+
+ // Remove non-error lines
+ assertTrue(lines.removeIf(st -> !st.startsWith("Error:")));
+ // Desired locations has errors
+ assertTrue(location == TestLocation.NONE || !lines.isEmpty());
+ // Access Flag errors only
+ assertTrue(lines.stream().allMatch(l -> l.contains("Access Flags:")), () -> String.join("\n", lines));
+ }
+
+ static class SampleInnerClass {
+ String field;
+ void method() {}
+ }
+}
From 72ca7bafcd49a98c1fe09da72e4e47683f052e9d Mon Sep 17 00:00:00 2001
From: Hannes Greule
Date: Sat, 22 Jun 2024 12:16:50 +0000
Subject: [PATCH 010/288] 8334708: FFM: two javadoc problems
Reviewed-by: mcimadamore
---
src/java.base/share/classes/java/lang/foreign/Linker.java | 2 +-
src/java.base/share/classes/java/lang/foreign/MemoryLayout.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/java.base/share/classes/java/lang/foreign/Linker.java b/src/java.base/share/classes/java/lang/foreign/Linker.java
index 545a83984f867..fd6e820d01662 100644
--- a/src/java.base/share/classes/java/lang/foreign/Linker.java
+++ b/src/java.base/share/classes/java/lang/foreign/Linker.java
@@ -222,7 +222,7 @@
*
* MemoryLayout.structLayout(
* ValueLayout.JAVA_INT.withName("x"),
- * MemoryLayout.paddingLayout(32),
+ * MemoryLayout.paddingLayout(4),
* ValueLayout.JAVA_LONG.withName("y")
* );
*
diff --git a/src/java.base/share/classes/java/lang/foreign/MemoryLayout.java b/src/java.base/share/classes/java/lang/foreign/MemoryLayout.java
index 372b10aab1389..989fc134a2628 100644
--- a/src/java.base/share/classes/java/lang/foreign/MemoryLayout.java
+++ b/src/java.base/share/classes/java/lang/foreign/MemoryLayout.java
@@ -369,7 +369,7 @@
* int size = ...
* MemorySegment points = ...
* for (int i = 0 ; i < size ; i++) {
- * ... POINT_ARR_X.get(segment, 0L, (long)i) ...
+ * ... POINT_ARR_X.get(points, 0L, (long)i) ...
* }
* }
*
From 652784c803863f40ee3d81695a19e705365cb800 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Johan=20Sj=C3=B6len?=
Date: Sun, 23 Jun 2024 08:19:28 +0000
Subject: [PATCH 011/288] 8334392: Switch RNG in NMT's treap
Reviewed-by: stuefe, azafari, gziemski
---
src/hotspot/share/nmt/nmtTreap.hpp | 24 +++++++++++------------
test/hotspot/gtest/nmt/test_nmt_treap.cpp | 12 ++++++++----
2 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/src/hotspot/share/nmt/nmtTreap.hpp b/src/hotspot/share/nmt/nmtTreap.hpp
index 97a5cddcb81ed..99c8655525c95 100644
--- a/src/hotspot/share/nmt/nmtTreap.hpp
+++ b/src/hotspot/share/nmt/nmtTreap.hpp
@@ -25,13 +25,12 @@
#ifndef SHARE_NMT_NMTTREAP_HPP
#define SHARE_NMT_NMTTREAP_HPP
-#include "memory/allocation.hpp"
#include "runtime/os.hpp"
#include "utilities/debug.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/macros.hpp"
-#include
+#include "utilities/powerOfTwo.hpp"
// A Treap is a self-balanced binary tree where each node is equipped with a
// priority. It adds the invariant that the priority of a parent P is strictly larger
@@ -84,16 +83,16 @@ class Treap {
private:
ALLOCATOR _allocator;
TreapNode* _root;
+
+ // A random number
+ static constexpr const uint64_t _initial_seed = 0xC8DD2114AE0543A3;
uint64_t _prng_seed;
int _node_count;
uint64_t prng_next() {
- // Taken directly off of JFRPrng
- static const constexpr uint64_t PrngMult = 0x5DEECE66DLL;
- static const constexpr uint64_t PrngAdd = 0xB;
- static const constexpr uint64_t PrngModPower = 48;
- static const constexpr uint64_t PrngModMask = (static_cast(1) << PrngModPower) - 1;
- _prng_seed = (PrngMult * _prng_seed + PrngAdd) & PrngModMask;
+ uint64_t first_half = os::next_random(_prng_seed);
+ uint64_t second_half = os::next_random(_prng_seed >> 32);
+ _prng_seed = first_half | (second_half << 32);
return _prng_seed;
}
@@ -173,9 +172,9 @@ class Treap {
#ifdef ASSERT
void verify_self() {
// A balanced binary search tree should have a depth on the order of log(N).
- // We take the ceiling of log_2(N + 1) * 2.5 as our maximum bound.
+ // We take the ceiling of log_2(N + 1) * 3 as our maximum bound.
// For comparison, a RB-tree has a proven max depth of log_2(N + 1) * 2.
- const int expected_maximum_depth = ceil((log(this->_node_count+1) / log(2)) * 2.5);
+ const int expected_maximum_depth = ceil(log2i(this->_node_count+1) * 3);
// Find the maximum depth through DFS and ensure that the priority invariant holds.
int maximum_depth_found = 0;
@@ -225,11 +224,10 @@ class Treap {
public:
NONCOPYABLE(Treap);
- Treap(uint64_t seed = static_cast(os::random())
- | (static_cast(os::random()) << 32))
+ Treap()
: _allocator(),
_root(nullptr),
- _prng_seed(seed),
+ _prng_seed(_initial_seed),
_node_count(0) {}
~Treap() {
diff --git a/test/hotspot/gtest/nmt/test_nmt_treap.cpp b/test/hotspot/gtest/nmt/test_nmt_treap.cpp
index 9cd7f36aad6a7..3c98029d28f58 100644
--- a/test/hotspot/gtest/nmt/test_nmt_treap.cpp
+++ b/test/hotspot/gtest/nmt/test_nmt_treap.cpp
@@ -300,7 +300,9 @@ TEST_VM_F(TreapTest, VerifyItThroughStressTest) {
} else {
treap.remove(i);
}
- verify_it(treap);
+ if (i % 100 == 0) {
+ verify_it(treap);
+ }
}
for (int i = 0; i < ten_thousand; i++) {
int r = os::random();
@@ -309,14 +311,16 @@ TEST_VM_F(TreapTest, VerifyItThroughStressTest) {
} else {
treap.remove(i);
}
- verify_it(treap);
+ if (i % 100 == 0) {
+ verify_it(treap);
+ }
}
}
{ // Make a very large treap and verify at the end
struct Nothing {};
TreapCHeap treap;
- constexpr const int five_million = 5000000;
- for (int i = 0; i < five_million; i++) {
+ constexpr const int one_hundred_thousand = 100000;
+ for (int i = 0; i < one_hundred_thousand; i++) {
treap.upsert(i, Nothing());
}
verify_it(treap);
From eb110bdc6e8bcb87b9b8b24ac66eb9b4c57106fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Johan=20Sj=C3=B6len?=
Date: Sun, 23 Jun 2024 12:33:38 +0000
Subject: [PATCH 012/288] 8334180: NMT gtests introduced with 8312132 should be
labeled as NMT
Reviewed-by: gziemski, stuefe
---
src/hotspot/share/nmt/memoryFileTracker.hpp | 4 ++--
src/hotspot/share/nmt/nmtTreap.hpp | 4 ++--
src/hotspot/share/nmt/vmatree.hpp | 2 +-
.../gtest/nmt/test_nmt_memoryfiletracker.cpp | 4 ++--
.../gtest/nmt/test_nmt_nativecallstackstorage.cpp | 6 +++---
test/hotspot/gtest/nmt/test_nmt_treap.cpp | 14 +++++++-------
test/hotspot/gtest/nmt/test_vmatree.cpp | 12 ++++++------
7 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/src/hotspot/share/nmt/memoryFileTracker.hpp b/src/hotspot/share/nmt/memoryFileTracker.hpp
index f662893af0a6b..432b6f9d99e1e 100644
--- a/src/hotspot/share/nmt/memoryFileTracker.hpp
+++ b/src/hotspot/share/nmt/memoryFileTracker.hpp
@@ -40,7 +40,7 @@
// storage with its own memory space separate from the process.
// A typical example of such a file is a memory mapped file.
class MemoryFileTracker {
- friend class MemoryFileTrackerTest;
+ friend class NMTMemoryFileTrackerTest;
// Provide caching of stacks.
NativeCallStackStorage _stack_storage;
@@ -48,7 +48,7 @@ class MemoryFileTracker {
public:
class MemoryFile : public CHeapObj {
friend MemoryFileTracker;
- friend class MemoryFileTrackerTest;
+ friend class NMTMemoryFileTrackerTest;
const char* _descriptive_name;
VirtualMemorySnapshot _summary;
VMATree _tree;
diff --git a/src/hotspot/share/nmt/nmtTreap.hpp b/src/hotspot/share/nmt/nmtTreap.hpp
index 99c8655525c95..700634974393a 100644
--- a/src/hotspot/share/nmt/nmtTreap.hpp
+++ b/src/hotspot/share/nmt/nmtTreap.hpp
@@ -52,8 +52,8 @@
template
class Treap {
- friend class VMATreeTest;
- friend class TreapTest;
+ friend class NMTVMATreeTest;
+ friend class NMTTreapTest;
public:
class TreapNode {
friend Treap;
diff --git a/src/hotspot/share/nmt/vmatree.hpp b/src/hotspot/share/nmt/vmatree.hpp
index b8946b3b8c155..a93c282f4d272 100644
--- a/src/hotspot/share/nmt/vmatree.hpp
+++ b/src/hotspot/share/nmt/vmatree.hpp
@@ -38,7 +38,7 @@
// or from committed memory of a certain MEMFLAGS to committed memory of a different MEMFLAGS.
// The set of points is stored in a balanced binary tree for efficient querying and updating.
class VMATree {
- friend class VMATreeTest;
+ friend class NMTVMATreeTest;
// A position in memory.
public:
using position = size_t;
diff --git a/test/hotspot/gtest/nmt/test_nmt_memoryfiletracker.cpp b/test/hotspot/gtest/nmt/test_nmt_memoryfiletracker.cpp
index 018b9c49d544e..d32c8192f2cd0 100644
--- a/test/hotspot/gtest/nmt/test_nmt_memoryfiletracker.cpp
+++ b/test/hotspot/gtest/nmt/test_nmt_memoryfiletracker.cpp
@@ -27,7 +27,7 @@
#include "nmt/memTracker.hpp"
#include "unittest.hpp"
-class MemoryFileTrackerTest : public testing::Test {
+class NMTMemoryFileTrackerTest : public testing::Test {
public:
size_t sz(int x) { return (size_t) x; }
void basics() {
@@ -48,6 +48,6 @@ class MemoryFileTrackerTest : public testing::Test {
};
};
-TEST_VM_F(MemoryFileTrackerTest, Basics) {
+TEST_VM_F(NMTMemoryFileTrackerTest, Basics) {
this->basics();
}
diff --git a/test/hotspot/gtest/nmt/test_nmt_nativecallstackstorage.cpp b/test/hotspot/gtest/nmt/test_nmt_nativecallstackstorage.cpp
index 92c2dde210415..71e924b7b9dc7 100644
--- a/test/hotspot/gtest/nmt/test_nmt_nativecallstackstorage.cpp
+++ b/test/hotspot/gtest/nmt/test_nmt_nativecallstackstorage.cpp
@@ -29,9 +29,9 @@
using NCSS = NativeCallStackStorage;
-class NativeCallStackStorageTest : public testing::Test {};
+class NMTNativeCallStackStorageTest : public testing::Test {};
-TEST_VM_F(NativeCallStackStorageTest, DoNotStoreStackIfNotDetailed) {
+TEST_VM_F(NMTNativeCallStackStorageTest, DoNotStoreStackIfNotDetailed) {
NativeCallStack ncs{};
NCSS ncss(false);
NCSS::StackIndex si = ncss.push(ncs);
@@ -40,7 +40,7 @@ TEST_VM_F(NativeCallStackStorageTest, DoNotStoreStackIfNotDetailed) {
EXPECT_TRUE(ncs_received.is_empty());
}
-TEST_VM_F(NativeCallStackStorageTest, CollisionsReceiveDifferentIndexes) {
+TEST_VM_F(NMTNativeCallStackStorageTest, CollisionsReceiveDifferentIndexes) {
constexpr const int nr_of_stacks = 10;
NativeCallStack ncs_arr[nr_of_stacks];
for (int i = 0; i < nr_of_stacks; i++) {
diff --git a/test/hotspot/gtest/nmt/test_nmt_treap.cpp b/test/hotspot/gtest/nmt/test_nmt_treap.cpp
index 3c98029d28f58..6e04cfce1a82d 100644
--- a/test/hotspot/gtest/nmt/test_nmt_treap.cpp
+++ b/test/hotspot/gtest/nmt/test_nmt_treap.cpp
@@ -28,7 +28,7 @@
#include "runtime/os.hpp"
#include "unittest.hpp"
-class TreapTest : public testing::Test {
+class NMTTreapTest : public testing::Test {
public:
struct Cmp {
static int cmp(int a, int b) {
@@ -147,15 +147,15 @@ class TreapTest : public testing::Test {
}
};
-TEST_VM_F(TreapTest, InsertingDuplicatesResultsInOneValue) {
+TEST_VM_F(NMTTreapTest, InsertingDuplicatesResultsInOneValue) {
this->inserting_duplicates_results_in_one_value();
}
-TEST_VM_F(TreapTest, TreapOughtNotLeak) {
+TEST_VM_F(NMTTreapTest, TreapOughtNotLeak) {
this->treap_ought_not_leak();
}
-TEST_VM_F(TreapTest, TestVisitors) {
+TEST_VM_F(NMTTreapTest, TestVisitors) {
{ // Tests with 'default' ordering (ascending)
TreapCHeap treap;
using Node = TreapCHeap::TreapNode;
@@ -259,11 +259,11 @@ TEST_VM_F(TreapTest, TestVisitors) {
}
}
-TEST_VM_F(TreapTest, TestFind) {
+TEST_VM_F(NMTTreapTest, TestFind) {
test_find();
}
-TEST_VM_F(TreapTest, TestClosestLeq) {
+TEST_VM_F(NMTTreapTest, TestClosestLeq) {
using Node = TreapCHeap::TreapNode;
{
TreapCHeap treap;
@@ -289,7 +289,7 @@ TEST_VM_F(TreapTest, TestClosestLeq) {
#ifdef ASSERT
-TEST_VM_F(TreapTest, VerifyItThroughStressTest) {
+TEST_VM_F(NMTTreapTest, VerifyItThroughStressTest) {
{ // Repeatedly verify a treap of moderate size
TreapCHeap treap;
constexpr const int ten_thousand = 10000;
diff --git a/test/hotspot/gtest/nmt/test_vmatree.cpp b/test/hotspot/gtest/nmt/test_vmatree.cpp
index 17eb61352cd0f..1c1bc31b5b498 100644
--- a/test/hotspot/gtest/nmt/test_vmatree.cpp
+++ b/test/hotspot/gtest/nmt/test_vmatree.cpp
@@ -34,14 +34,14 @@ using Tree = VMATree;
using Node = Tree::TreapNode;
using NCS = NativeCallStackStorage;
-class VMATreeTest : public testing::Test {
+class NMTVMATreeTest : public testing::Test {
public:
NCS ncs;
constexpr static const int si_len = 2;
NCS::StackIndex si[si_len];
NativeCallStack stacks[si_len];
- VMATreeTest() : ncs(true) {
+ NMTVMATreeTest() : ncs(true) {
stacks[0] = make_stack(0xA);
stacks[1] = make_stack(0xB);
si[0] = ncs.push(stacks[0]);
@@ -172,7 +172,7 @@ class VMATreeTest : public testing::Test {
-TEST_VM_F(VMATreeTest, OverlappingReservationsResultInTwoNodes) {
+TEST_VM_F(NMTVMATreeTest, OverlappingReservationsResultInTwoNodes) {
VMATree::RegionData rd{si[0], mtTest};
Tree tree;
for (int i = 99; i >= 0; i--) {
@@ -182,7 +182,7 @@ TEST_VM_F(VMATreeTest, OverlappingReservationsResultInTwoNodes) {
}
// Low-level tests inspecting the state of the tree.
-TEST_VM_F(VMATreeTest, LowLevel) {
+TEST_VM_F(NMTVMATreeTest, LowLevel) {
adjacent_2_nodes(VMATree::empty_regiondata);
remove_all_leaves_empty_tree(VMATree::empty_regiondata);
commit_middle(VMATree::empty_regiondata);
@@ -268,7 +268,7 @@ TEST_VM_F(VMATreeTest, LowLevel) {
}
// Tests for summary accounting
-TEST_VM_F(VMATreeTest, SummaryAccounting) {
+TEST_VM_F(NMTVMATreeTest, SummaryAccounting) {
{ // Fully enclosed re-reserving works correctly.
Tree::RegionData rd(NCS::StackIndex(), mtTest);
Tree::RegionData rd2(NCS::StackIndex(), mtNMT);
@@ -416,7 +416,7 @@ struct SimpleVMATracker : public CHeapObj {
constexpr const size_t SimpleVMATracker::num_pages;
-TEST_VM_F(VMATreeTest, TestConsistencyWithSimpleTracker) {
+TEST_VM_F(NMTVMATreeTest, TestConsistencyWithSimpleTracker) {
// In this test we use ASSERT macros from gtest instead of EXPECT
// as any error will propagate and become larger as the test progresses.
SimpleVMATracker* tr = new SimpleVMATracker();
From 7baddc202a9ab2b85401aa05f827678b514ebf55 Mon Sep 17 00:00:00 2001
From: SendaoYan
Date: Sun, 23 Jun 2024 18:00:28 +0000
Subject: [PATCH 013/288] 8334339: Test
java/nio/file/attribute/BasicFileAttributeView/CreationTime.java fails on
alinux3
Reviewed-by: alanb
---
.../BasicFileAttributeView/CreationTime.java | 37 +++++++++++++++----
1 file changed, 29 insertions(+), 8 deletions(-)
diff --git a/test/jdk/java/nio/file/attribute/BasicFileAttributeView/CreationTime.java b/test/jdk/java/nio/file/attribute/BasicFileAttributeView/CreationTime.java
index 1898f584bcd63..ad85da7ae63b1 100644
--- a/test/jdk/java/nio/file/attribute/BasicFileAttributeView/CreationTime.java
+++ b/test/jdk/java/nio/file/attribute/BasicFileAttributeView/CreationTime.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2024, Oracle and/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
@@ -21,15 +21,24 @@
* questions.
*/
-/* @test
- * @bug 8011536 8151430 8316304
+/* @test id=tmp
+ * @bug 8011536 8151430 8316304 8334339
* @summary Basic test for creationTime attribute on platforms/file systems
- * that support it.
+ * that support it, tests using /tmp directory.
* @library ../.. /test/lib
* @build jdk.test.lib.Platform
* @run main CreationTime
*/
+/* @test id=cwd
+ * @summary Basic test for creationTime attribute on platforms/file systems
+ * that support it, tests using the test scratch directory, the test
+ * scratch directory maybe at diff disk partition to /tmp on linux.
+ * @library ../.. /test/lib
+ * @build jdk.test.lib.Platform
+ * @run main CreationTime .
+ */
+
import java.lang.foreign.Linker;
import java.nio.file.Path;
import java.nio.file.Files;
@@ -38,6 +47,7 @@
import java.io.IOException;
import jdk.test.lib.Platform;
+import jtreg.SkippedException;
public class CreationTime {
@@ -68,8 +78,14 @@ static void test(Path top) throws IOException {
FileTime creationTime = creationTime(file);
Instant now = Instant.now();
if (Math.abs(creationTime.toMillis()-now.toEpochMilli()) > 10000L) {
- err.println("File creation time reported as: " + creationTime);
- throw new RuntimeException("Expected to be close to: " + now);
+ System.out.println("creationTime.toMillis() == " + creationTime.toMillis());
+ // If the file system doesn't support birth time, then skip this test
+ if (creationTime.toMillis() == 0) {
+ throw new SkippedException("birth time not support for: " + file);
+ } else {
+ err.println("File creation time reported as: " + creationTime);
+ throw new RuntimeException("Expected to be close to: " + now);
+ }
}
/**
@@ -95,7 +111,7 @@ static void test(Path top) throws IOException {
// Creation time updates are not supported on Linux
supportsCreationTimeWrite = false;
}
- System.out.println("supportsCreationTimeRead == " + supportsCreationTimeRead);
+ System.out.println(top + " supportsCreationTimeRead == " + supportsCreationTimeRead);
/**
* If the creation-time attribute is supported then change the file's
@@ -127,7 +143,12 @@ static void test(Path top) throws IOException {
public static void main(String[] args) throws IOException {
// create temporary directory to run tests
- Path dir = TestUtil.createTemporaryDirectory();
+ Path dir;
+ if (args.length == 0) {
+ dir = TestUtil.createTemporaryDirectory();
+ } else {
+ dir = TestUtil.createTemporaryDirectory(args[0]);
+ }
try {
test(dir);
} finally {
From a4582a8957d604b50249e1f59679393966456a14 Mon Sep 17 00:00:00 2001
From: Zhao Song
Date: Mon, 24 Jun 2024 05:15:32 +0000
Subject: [PATCH 014/288] 8334166: Enable binary check
Reviewed-by: kcr, ihse, prr, erikj
---
.jcheck/conf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.jcheck/conf b/.jcheck/conf
index ecc41e341d926..f666ff69d5ee3 100644
--- a/.jcheck/conf
+++ b/.jcheck/conf
@@ -5,7 +5,7 @@ version=24
[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
-warning=issuestitle
+warning=issuestitle,binary
[repository]
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)
From 863b2a991df9204560c4680fc10dd0f68b260217 Mon Sep 17 00:00:00 2001
From: Axel Boldt-Christmas
Date: Mon, 24 Jun 2024 06:06:45 +0000
Subject: [PATCH 015/288] 8329994: Zap alignment padding bits for ArrayOops in
non-release builds
Reviewed-by: ayang, sjohanss
---
src/hotspot/share/gc/shared/memAllocator.cpp | 15 +++++++++++++++
src/hotspot/share/gc/shared/memAllocator.hpp | 1 +
src/hotspot/share/gc/z/zObjArrayAllocator.cpp | 2 ++
3 files changed, 18 insertions(+)
diff --git a/src/hotspot/share/gc/shared/memAllocator.cpp b/src/hotspot/share/gc/shared/memAllocator.cpp
index 156b55c104621..318ab00188b3d 100644
--- a/src/hotspot/share/gc/shared/memAllocator.cpp
+++ b/src/hotspot/share/gc/shared/memAllocator.cpp
@@ -388,6 +388,7 @@ oop ObjArrayAllocator::initialize(HeapWord* mem) const {
assert(_length >= 0, "length should be non-negative");
if (_do_zero) {
mem_clear(mem);
+ mem_zap_start_padding(mem);
mem_zap_end_padding(mem);
}
arrayOopDesc::set_length(mem, _length);
@@ -395,6 +396,20 @@ oop ObjArrayAllocator::initialize(HeapWord* mem) const {
}
#ifndef PRODUCT
+void ObjArrayAllocator::mem_zap_start_padding(HeapWord* mem) const {
+ const BasicType element_type = ArrayKlass::cast(_klass)->element_type();
+ const size_t base_offset_in_bytes = arrayOopDesc::base_offset_in_bytes(element_type);
+ const size_t header_size_in_bytes = arrayOopDesc::header_size_in_bytes();
+
+ const address base = reinterpret_cast(mem) + base_offset_in_bytes;
+ const address header_end = reinterpret_cast(mem) + header_size_in_bytes;
+
+ if (header_end < base) {
+ const size_t padding_in_bytes = base - header_end;
+ Copy::fill_to_bytes(header_end, padding_in_bytes, heapPaddingByteVal);
+ }
+}
+
void ObjArrayAllocator::mem_zap_end_padding(HeapWord* mem) const {
const size_t length_in_bytes = static_cast(_length) << ArrayKlass::cast(_klass)->log2_element_size();
const BasicType element_type = ArrayKlass::cast(_klass)->element_type();
diff --git a/src/hotspot/share/gc/shared/memAllocator.hpp b/src/hotspot/share/gc/shared/memAllocator.hpp
index a0450af4450ec..ec67616adbaaf 100644
--- a/src/hotspot/share/gc/shared/memAllocator.hpp
+++ b/src/hotspot/share/gc/shared/memAllocator.hpp
@@ -94,6 +94,7 @@ class ObjArrayAllocator: public MemAllocator {
const int _length;
const bool _do_zero;
+ void mem_zap_start_padding(HeapWord* mem) const PRODUCT_RETURN;
void mem_zap_end_padding(HeapWord* mem) const PRODUCT_RETURN;
public:
diff --git a/src/hotspot/share/gc/z/zObjArrayAllocator.cpp b/src/hotspot/share/gc/z/zObjArrayAllocator.cpp
index 1b2f3804e3d24..ad19f273dcf0f 100644
--- a/src/hotspot/share/gc/z/zObjArrayAllocator.cpp
+++ b/src/hotspot/share/gc/z/zObjArrayAllocator.cpp
@@ -139,6 +139,8 @@ oop ZObjArrayAllocator::initialize(HeapWord* mem) const {
return true;
};
+ mem_zap_start_padding(mem);
+
if (!initialize_memory()) {
// Re-color with 11 remset bits if we got intercepted by a GC safepoint
const bool result = initialize_memory();
From 13dce296fc3924b269757ce1279c57afe18faeeb Mon Sep 17 00:00:00 2001
From: Richard Reingruber
Date: Mon, 24 Jun 2024 06:33:39 +0000
Subject: [PATCH 016/288] 8334560: [PPC64]:
postalloc_expand_java_dynamic_call_sched does not copy all fields
Reviewed-by: mbaesken, mdoerr
---
src/hotspot/cpu/ppc/ppc.ad | 1 +
test/jdk/com/sun/jdi/EATests.java | 91 +++++++++++++++++++++++++++++++
2 files changed, 92 insertions(+)
diff --git a/src/hotspot/cpu/ppc/ppc.ad b/src/hotspot/cpu/ppc/ppc.ad
index 8917b344e54cb..38485da958132 100644
--- a/src/hotspot/cpu/ppc/ppc.ad
+++ b/src/hotspot/cpu/ppc/ppc.ad
@@ -3429,6 +3429,7 @@ encode %{
call->_oop_map = _oop_map;
call->_jvms = _jvms;
call->_jvmadj = _jvmadj;
+ call->_has_ea_local_in_scope = _has_ea_local_in_scope;
call->_in_rms = _in_rms;
call->_nesting = _nesting;
call->_override_symbolic_info = _override_symbolic_info;
diff --git a/test/jdk/com/sun/jdi/EATests.java b/test/jdk/com/sun/jdi/EATests.java
index cd80d01a07f11..7285948165989 100644
--- a/test/jdk/com/sun/jdi/EATests.java
+++ b/test/jdk/com/sun/jdi/EATests.java
@@ -289,6 +289,7 @@ public static void main(String[] args) {
// Relocking test cases
new EARelockingSimpleTarget() .run();
new EARelockingSimpleWithAccessInOtherThreadTarget() .run();
+ new EARelockingSimpleWithAccessInOtherThread_02_DynamicCall_Target() .run();
new EARelockingRecursiveTarget() .run();
new EARelockingNestedInflatedTarget() .run();
new EARelockingNestedInflated_02Target() .run();
@@ -413,6 +414,7 @@ protected void runTests() throws Exception {
// Relocking test cases
new EARelockingSimple() .run(this);
new EARelockingSimpleWithAccessInOtherThread() .run(this);
+ new EARelockingSimpleWithAccessInOtherThread_02_DynamicCall() .run(this);
new EARelockingRecursive() .run(this);
new EARelockingNestedInflated() .run(this);
new EARelockingNestedInflated_02() .run(this);
@@ -1851,6 +1853,95 @@ public int getExpectedIResult() {
/////////////////////////////////////////////////////////////////////////////
+// The debugger reads and publishes an object with eliminated locking to an instance field.
+// A 2nd thread in the debuggee finds it there and changes its state using a synchronized method.
+// Without eager relocking the accesses are unsynchronized which can be observed.
+// This is a variant of EARelockingSimpleWithAccessInOtherThread with a dynamic call (not devirtualized).
+class EARelockingSimpleWithAccessInOtherThread_02_DynamicCall extends EATestCaseBaseDebugger {
+
+ public void runTestCase() throws Exception {
+ BreakpointEvent bpe = resumeTo(TARGET_TESTCASE_BASE_NAME, "dontinline_brkpt", "()V");
+ printStack(bpe.thread());
+ String l1ClassName = EARelockingSimpleWithAccessInOtherThread_02_DynamicCall_Target.SyncCounter.class.getName();
+ ObjectReference ctr = getLocalRef(bpe.thread().frame(2), l1ClassName, "l1");
+ setField(testCase, "sharedCounter", ctr);
+ terminateEndlessLoop();
+ }
+}
+
+class EARelockingSimpleWithAccessInOtherThread_02_DynamicCall_Target extends EATestCaseBaseTarget {
+
+ public static final BrkPtDispatchA[] disp =
+ {new BrkPtDispatchA(), new BrkPtDispatchB(), new BrkPtDispatchC(), new BrkPtDispatchD()};
+
+ public static class BrkPtDispatchA {
+ public EATestCaseBaseTarget testCase;
+ public void dontinline_brkpt() { testCase.dontinline_brkpt(); }
+ }
+
+ public static class BrkPtDispatchB extends BrkPtDispatchA {
+ @Override
+ public void dontinline_brkpt() { testCase.dontinline_brkpt(); }
+ }
+
+ public static class BrkPtDispatchC extends BrkPtDispatchA {
+ @Override
+ public void dontinline_brkpt() { testCase.dontinline_brkpt(); }
+ }
+
+ public static class BrkPtDispatchD extends BrkPtDispatchA {
+ @Override
+ public void dontinline_brkpt() {
+ testCase.dontinline_brkpt();
+ }
+ }
+
+ public static class SyncCounter {
+ private int val;
+ public synchronized int inc() { return val++; }
+ }
+
+ public volatile SyncCounter sharedCounter;
+
+ @Override
+ public void setUp() {
+ super.setUp();
+ testMethodDepth = 2;
+ for (BrkPtDispatchA d : disp) {
+ d.testCase = this;
+ }
+ doLoop = true;
+ new Thread(() -> {
+ while (doLoop) {
+ SyncCounter ctr = sharedCounter;
+ if (ctr != null) {
+ ctr.inc();
+ }
+ }
+ }).start();
+ }
+
+ public int dispCount;
+ public void dontinline_testMethod() {
+ SyncCounter l1 = new SyncCounter();
+ synchronized (l1) { // Eliminated locking
+ l1.inc();
+ // Use different types for the subsequent call to prevent devirtualization.
+ BrkPtDispatchA d = disp[(dispCount++) & 3];
+ d.dontinline_brkpt(); // Dynamic call. Debugger publishes l1 to sharedCounter.
+ iResult = l1.inc(); // Changes by the 2nd thread will be observed if l1
+ // was not relocked before passing it to the debugger.
+ }
+ }
+
+ @Override
+ public int getExpectedIResult() {
+ return 1;
+ }
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
// Test recursive locking
class EARelockingRecursiveTarget extends EATestCaseBaseTarget {
From edf7f055ee010a2c19bce26c15726d5b58e2e832 Mon Sep 17 00:00:00 2001
From: Emanuel Peter
Date: Mon, 24 Jun 2024 07:14:57 +0000
Subject: [PATCH 017/288] 8334083: C2 SuperWord:
TestCompatibleUseDefTypeSize.java fails with -XX:+AlignVector after
JDK-8325155
Reviewed-by: chagedorn, kvn
---
.../loopopts/superword/TestCompatibleUseDefTypeSize.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/test/hotspot/jtreg/compiler/loopopts/superword/TestCompatibleUseDefTypeSize.java b/test/hotspot/jtreg/compiler/loopopts/superword/TestCompatibleUseDefTypeSize.java
index e1aa91369d473..43580f4dee246 100644
--- a/test/hotspot/jtreg/compiler/loopopts/superword/TestCompatibleUseDefTypeSize.java
+++ b/test/hotspot/jtreg/compiler/loopopts/superword/TestCompatibleUseDefTypeSize.java
@@ -359,6 +359,7 @@ static Object[] test2(byte[] src, char[] dst) {
IRNode.ADD_VI, "> 0",
IRNode.STORE_VECTOR, "> 0"},
applyIfPlatform = {"64-bit", "true"},
+ applyIf = {"AlignVector", "false"}, // a[i] and a[i+1] cannot both be aligned.
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"})
// Used to not vectorize because of "alignment boundaries".
// Assume 64 byte vector width:
@@ -376,6 +377,7 @@ static Object[] test3(int[] a, int[] b) {
IRNode.ADD_VI, "> 0",
IRNode.STORE_VECTOR, "> 0"},
applyIfPlatform = {"64-bit", "true"},
+ applyIf = {"AlignVector", "false"}, // a[i] and a[i+1] cannot both be aligned.
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"})
// same as test3, but hand-unrolled
static Object[] test4(int[] a, int[] b) {
From 05a63d80b9c1e312512c707ccf6b255c16a9edf5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Johan=20Sj=C3=B6len?=
Date: Mon, 24 Jun 2024 07:51:01 +0000
Subject: [PATCH 018/288] 8334489: Add function os::used_memory
Reviewed-by: eosterlund, dholmes, stuefe
---
src/hotspot/share/runtime/os.cpp | 17 +++++++++++++++++
src/hotspot/share/runtime/os.hpp | 1 +
2 files changed, 18 insertions(+)
diff --git a/src/hotspot/share/runtime/os.cpp b/src/hotspot/share/runtime/os.cpp
index bdf93e1d3b403..9860251fc3308 100644
--- a/src/hotspot/share/runtime/os.cpp
+++ b/src/hotspot/share/runtime/os.cpp
@@ -78,6 +78,10 @@
#include "utilities/macros.hpp"
#include "utilities/powerOfTwo.hpp"
+#ifdef LINUX
+#include "osContainer_linux.hpp"
+#endif
+
#ifndef _WINDOWS
# include
#endif
@@ -2064,6 +2068,19 @@ static void assert_nonempty_range(const char* addr, size_t bytes) {
p2i(addr), p2i(addr) + bytes);
}
+julong os::used_memory() {
+#ifdef LINUX
+ if (OSContainer::is_containerized()) {
+ jlong mem_usage = OSContainer::memory_usage_in_bytes();
+ if (mem_usage > 0) {
+ return mem_usage;
+ }
+ }
+#endif
+ return os::physical_memory() - os::available_memory();
+}
+
+
bool os::commit_memory(char* addr, size_t bytes, bool executable) {
assert_nonempty_range(addr, bytes);
bool res = pd_commit_memory(addr, bytes, executable);
diff --git a/src/hotspot/share/runtime/os.hpp b/src/hotspot/share/runtime/os.hpp
index ce7a07d4c43a0..f3f44ddb2e659 100644
--- a/src/hotspot/share/runtime/os.hpp
+++ b/src/hotspot/share/runtime/os.hpp
@@ -336,6 +336,7 @@ class os: AllStatic {
// than "free" memory (`MemFree` in `/proc/meminfo`) because Linux can free memory
// aggressively (e.g. clear caches) so that it becomes available.
static julong available_memory();
+ static julong used_memory();
static julong free_memory();
static jlong total_swap_space();
From 05ff3185edd25b381a97f6879f496e97b62dddc2 Mon Sep 17 00:00:00 2001
From: Aleksey Shipilev
Date: Mon, 24 Jun 2024 08:46:10 +0000
Subject: [PATCH 019/288] 8334594: Generational ZGC: Deadlock after OopMap
rewrites in 8331572
Reviewed-by: stefank, eosterlund, coleenp, zgu
---
src/hotspot/share/gc/shared/gcVMOperations.cpp | 2 +-
.../share/gc/shenandoah/shenandoahVMOperations.cpp | 2 +-
src/hotspot/share/gc/x/xDriver.cpp | 2 +-
src/hotspot/share/gc/z/zGeneration.cpp | 2 +-
src/hotspot/share/interpreter/oopMapCache.cpp | 9 ++++++---
src/hotspot/share/interpreter/oopMapCache.hpp | 4 ++--
6 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/hotspot/share/gc/shared/gcVMOperations.cpp b/src/hotspot/share/gc/shared/gcVMOperations.cpp
index 4cf1a4ccbafd0..4cc75f4745991 100644
--- a/src/hotspot/share/gc/shared/gcVMOperations.cpp
+++ b/src/hotspot/share/gc/shared/gcVMOperations.cpp
@@ -132,7 +132,7 @@ bool VM_GC_Operation::doit_prologue() {
void VM_GC_Operation::doit_epilogue() {
// GC thread root traversal likely used OopMapCache a lot, which
// might have created lots of old entries. Trigger the cleanup now.
- OopMapCache::trigger_cleanup();
+ OopMapCache::try_trigger_cleanup();
if (Universe::has_reference_pending_list()) {
Heap_lock->notify_all();
}
diff --git a/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.cpp b/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.cpp
index af221550c69ab..9d2782502fefc 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.cpp
@@ -44,7 +44,7 @@ void VM_ShenandoahOperation::doit_epilogue() {
assert(!ShenandoahHeap::heap()->has_gc_state_changed(), "GC State was not synchronized to java threads.");
// GC thread root traversal likely used OopMapCache a lot, which
// might have created lots of old entries. Trigger the cleanup now.
- OopMapCache::trigger_cleanup();
+ OopMapCache::try_trigger_cleanup();
}
bool VM_ShenandoahReferenceOperation::doit_prologue() {
diff --git a/src/hotspot/share/gc/x/xDriver.cpp b/src/hotspot/share/gc/x/xDriver.cpp
index c477f4a135c32..3e6fd03134e12 100644
--- a/src/hotspot/share/gc/x/xDriver.cpp
+++ b/src/hotspot/share/gc/x/xDriver.cpp
@@ -134,7 +134,7 @@ class VM_XOperation : public VM_Operation {
// GC thread root traversal likely used OopMapCache a lot, which
// might have created lots of old entries. Trigger the cleanup now.
- OopMapCache::trigger_cleanup();
+ OopMapCache::try_trigger_cleanup();
}
bool gc_locked() const {
diff --git a/src/hotspot/share/gc/z/zGeneration.cpp b/src/hotspot/share/gc/z/zGeneration.cpp
index 5c3afa9db8cc6..be86550d32171 100644
--- a/src/hotspot/share/gc/z/zGeneration.cpp
+++ b/src/hotspot/share/gc/z/zGeneration.cpp
@@ -456,7 +456,7 @@ class VM_ZOperation : public VM_Operation {
// GC thread root traversal likely used OopMapCache a lot, which
// might have created lots of old entries. Trigger the cleanup now.
- OopMapCache::trigger_cleanup();
+ OopMapCache::try_trigger_cleanup();
}
bool success() const {
diff --git a/src/hotspot/share/interpreter/oopMapCache.cpp b/src/hotspot/share/interpreter/oopMapCache.cpp
index cae0efae9b26d..7b60e4869e368 100644
--- a/src/hotspot/share/interpreter/oopMapCache.cpp
+++ b/src/hotspot/share/interpreter/oopMapCache.cpp
@@ -592,10 +592,13 @@ bool OopMapCache::has_cleanup_work() {
return Atomic::load(&_old_entries) != nullptr;
}
-void OopMapCache::trigger_cleanup() {
- if (has_cleanup_work()) {
- MutexLocker ml(Service_lock, Mutex::_no_safepoint_check_flag);
+void OopMapCache::try_trigger_cleanup() {
+ // See we can take the lock for the notification without blocking.
+ // This allows triggering the cleanup from GC paths, that can hold
+ // the service lock for e.g. oop iteration in service thread.
+ if (has_cleanup_work() && Service_lock->try_lock_without_rank_check()) {
Service_lock->notify_all();
+ Service_lock->unlock();
}
}
diff --git a/src/hotspot/share/interpreter/oopMapCache.hpp b/src/hotspot/share/interpreter/oopMapCache.hpp
index 3c124631377ef..46c85f6e87985 100644
--- a/src/hotspot/share/interpreter/oopMapCache.hpp
+++ b/src/hotspot/share/interpreter/oopMapCache.hpp
@@ -183,8 +183,8 @@ class OopMapCache : public CHeapObj {
// Check if we need to clean up old entries
static bool has_cleanup_work();
- // Request cleanup if work is needed
- static void trigger_cleanup();
+ // Request cleanup if work is needed and notification is currently possible
+ static void try_trigger_cleanup();
// Clean up the old entries
static void cleanup();
From ca5a438e5a4612c66f70c70a9d425eca0e49e84d Mon Sep 17 00:00:00 2001
From: Christian Hagedorn
Date: Mon, 24 Jun 2024 08:58:02 +0000
Subject: [PATCH 020/288] 8334571: Extract control dependency rewiring out of
PhaseIdealLoop::dominated_by() into separate method
Reviewed-by: roland, kvn
---
src/hotspot/share/opto/loopPredicate.cpp | 52 ++++++++++++++----------
src/hotspot/share/opto/loopnode.hpp | 4 +-
src/hotspot/share/opto/loopopts.cpp | 39 ++++++++++--------
3 files changed, 56 insertions(+), 39 deletions(-)
diff --git a/src/hotspot/share/opto/loopPredicate.cpp b/src/hotspot/share/opto/loopPredicate.cpp
index bccc01a86ddb0..998d3a27178e1 100644
--- a/src/hotspot/share/opto/loopPredicate.cpp
+++ b/src/hotspot/share/opto/loopPredicate.cpp
@@ -1152,7 +1152,6 @@ bool PhaseIdealLoop::loop_predication_impl_helper(IdealLoopTree* loop, IfProjNod
ParsePredicateSuccessProj* parse_predicate_proj, CountedLoopNode* cl,
ConNode* zero, Invariance& invar, Deoptimization::DeoptReason reason) {
// Following are changed to nonnull when a predicate can be hoisted
- IfProjNode* new_predicate_proj = nullptr;
IfNode* iff = if_success_proj->in(0)->as_If();
Node* test = iff->in(1);
if (!test->is_Bool()) { //Conv2B, ...
@@ -1163,10 +1162,9 @@ bool PhaseIdealLoop::loop_predication_impl_helper(IdealLoopTree* loop, IfProjNod
if (invar.is_invariant(bol)) {
C->print_method(PHASE_BEFORE_LOOP_PREDICATION_IC, 4, iff);
// Invariant test
- new_predicate_proj = create_new_if_for_predicate(parse_predicate_proj, nullptr,
- reason,
- iff->Opcode());
- Node* ctrl = new_predicate_proj->in(0)->as_If()->in(0);
+ IfProjNode* hoisted_check_predicate_proj = create_new_if_for_predicate(parse_predicate_proj, nullptr, reason,
+ iff->Opcode());
+ Node* ctrl = hoisted_check_predicate_proj->in(0)->as_If()->in(0);
BoolNode* hoisted_check_predicate_bool = invar.clone(bol, ctrl)->as_Bool();
// Negate test if necessary (Parse Predicates always have IfTrue as success projection and IfFalse as uncommon trap)
@@ -1177,11 +1175,16 @@ bool PhaseIdealLoop::loop_predication_impl_helper(IdealLoopTree* loop, IfProjNod
register_new_node(hoisted_check_predicate_bool, ctrl);
negated = true;
}
- IfNode* new_predicate_iff = new_predicate_proj->in(0)->as_If();
+ IfNode* new_predicate_iff = hoisted_check_predicate_proj->in(0)->as_If();
_igvn.hash_delete(new_predicate_iff);
new_predicate_iff->set_req(1, hoisted_check_predicate_bool);
- C->print_method(PHASE_AFTER_LOOP_PREDICATION_IC, 4, new_predicate_proj->in(0));
+ invar.map_ctrl(if_success_proj, hoisted_check_predicate_proj); // Mark hoisted check as invariant
+
+ // Eliminate the old If in the loop body.
+ dominated_by(hoisted_check_predicate_proj, iff, negated);
+
+ C->print_method(PHASE_AFTER_LOOP_PREDICATION_IC, 4, hoisted_check_predicate_proj->in(0));
#ifndef PRODUCT
if (TraceLoopPredicate) {
@@ -1193,10 +1196,10 @@ bool PhaseIdealLoop::loop_predication_impl_helper(IdealLoopTree* loop, IfProjNod
}
#endif
} else if (cl != nullptr && loop->is_range_check_if(if_success_proj, this, invar DEBUG_ONLY(COMMA parse_predicate_proj))) {
- range_check_predicate = true;
C->print_method(PHASE_BEFORE_LOOP_PREDICATION_RC, 4, iff);
// Range check for counted loops
assert(if_success_proj->is_IfTrue(), "trap must be on false projection for a range check");
+ IfTrueNode* hoisted_check_proj = if_success_proj->as_IfTrue();
const Node* cmp = bol->in(1)->as_Cmp();
Node* idx = cmp->in(1);
assert(!invar.is_invariant(idx), "index is variant");
@@ -1265,10 +1268,18 @@ bool PhaseIdealLoop::loop_predication_impl_helper(IdealLoopTree* loop, IfProjNod
// Fall through into rest of the cleanup code which will move any dependent nodes to the skeleton predicates of the
// upper bound test. We always need to create skeleton predicates in order to properly remove dead loops when later
// splitting the predicated loop into (unreachable) sub-loops (i.e. done by unrolling, peeling, pre/main/post etc.).
- new_predicate_proj = add_template_assertion_predicate(iff, loop, if_success_proj, parse_predicate_proj, upper_bound_proj, scale,
- offset, init, limit, stride, rng, overflow, reason);
+ IfTrueNode* template_assertion_predicate_proj =
+ add_template_assertion_predicate(iff, loop, hoisted_check_proj, parse_predicate_proj, upper_bound_proj, scale,
+ offset, init, limit, stride, rng, overflow, reason);
+
+ // Eliminate the old range check in the loop body.
+ // When a range check is eliminated, data dependent nodes (Load and range check CastII nodes) are now dependent on 2
+ // Hoisted Check Predicates (one for the start of the loop, one for the end) but we can only keep track of one control
+ // dependency: pin the data dependent nodes.
+ eliminate_hoisted_range_check(hoisted_check_proj, template_assertion_predicate_proj);
+ invar.map_ctrl(hoisted_check_proj, template_assertion_predicate_proj); // Mark hoisted check as invariant
- C->print_method(PHASE_AFTER_LOOP_PREDICATION_RC, 4, new_predicate_proj->in(0));
+ C->print_method(PHASE_AFTER_LOOP_PREDICATION_RC, 4, template_assertion_predicate_proj->in(0));
#ifndef PRODUCT
if (TraceLoopOpts && !TraceLoopPredicate) {
@@ -1281,24 +1292,21 @@ bool PhaseIdealLoop::loop_predication_impl_helper(IdealLoopTree* loop, IfProjNod
// with uncommon trap.
return false;
}
- assert(new_predicate_proj != nullptr, "sanity");
- // Success - attach condition (new_predicate_bol) to predicate if
- invar.map_ctrl(if_success_proj, new_predicate_proj); // so that invariance test can be appropriate
-
- // Eliminate the old If in the loop body
- // If a range check is eliminated, data dependent nodes (Load and range check CastII nodes) are now dependent on 2
- // Hoisted Check Predicates (one for the start of the loop, one for the end) but we can only keep track of one control
- // dependency: pin the data dependent nodes.
- dominated_by(new_predicate_proj, iff, if_success_proj->_con != new_predicate_proj->_con, range_check_predicate);
C->set_major_progress();
return true;
}
+void PhaseIdealLoop::eliminate_hoisted_range_check(IfTrueNode* hoisted_check_proj,
+ IfTrueNode* template_assertion_predicate_proj) {
+ _igvn.replace_input_of(hoisted_check_proj->in(0), 1, _igvn.intcon(1));
+ rewire_safe_outputs_to_dominator(hoisted_check_proj, template_assertion_predicate_proj, true);
+}
+
// Each newly created Hoisted Check Predicate is accompanied by two Template Assertion Predicates. Later, we initialize
// them by making a copy of them when splitting a loop into sub loops. The Assertion Predicates ensure that dead sub
// loops are removed properly.
-IfProjNode* PhaseIdealLoop::add_template_assertion_predicate(IfNode* iff, IdealLoopTree* loop, IfProjNode* if_proj,
+IfTrueNode* PhaseIdealLoop::add_template_assertion_predicate(IfNode* iff, IdealLoopTree* loop, IfProjNode* if_proj,
ParsePredicateSuccessProj* parse_predicate_proj,
IfProjNode* upper_bound_proj, const int scale, Node* offset,
Node* init, Node* limit, const jint stride,
@@ -1312,7 +1320,7 @@ IfProjNode* PhaseIdealLoop::add_template_assertion_predicate(IfNode* iff, IdealL
Node* opaque_bol = new Opaque4Node(C, bol, _igvn.intcon(1)); // This will go away once loop opts are over
C->add_template_assertion_predicate_opaq(opaque_bol);
register_new_node(opaque_bol, upper_bound_proj);
- IfProjNode* new_proj = create_new_if_for_predicate(parse_predicate_proj, nullptr, reason, overflow ? Op_If : iff->Opcode());
+ IfTrueNode* new_proj = create_new_if_for_predicate(parse_predicate_proj, nullptr, reason, overflow ? Op_If : iff->Opcode());
_igvn.replace_input_of(new_proj->in(0), 1, opaque_bol);
assert(opaque_init->outcnt() > 0, "should be used");
diff --git a/src/hotspot/share/opto/loopnode.hpp b/src/hotspot/share/opto/loopnode.hpp
index 8d9d4b3e0e543..17145c825a420 100644
--- a/src/hotspot/share/opto/loopnode.hpp
+++ b/src/hotspot/share/opto/loopnode.hpp
@@ -1377,10 +1377,11 @@ class PhaseIdealLoop : public PhaseTransform {
void loop_predication_follow_branches(Node *c, IdealLoopTree *loop, float loop_trip_cnt,
PathFrequency& pf, Node_Stack& stack, VectorSet& seen,
Node_List& if_proj_list);
- IfProjNode* add_template_assertion_predicate(IfNode* iff, IdealLoopTree* loop, IfProjNode* if_proj,
+ IfTrueNode* add_template_assertion_predicate(IfNode* iff, IdealLoopTree* loop, IfProjNode* if_proj,
ParsePredicateSuccessProj* parse_predicate_proj,
IfProjNode* upper_bound_proj, int scale, Node* offset, Node* init, Node* limit,
jint stride, Node* rng, bool& overflow, Deoptimization::DeoptReason reason);
+ void eliminate_hoisted_range_check(IfTrueNode* hoisted_check_proj, IfTrueNode* template_assertion_predicate_proj);
Node* add_range_check_elimination_assertion_predicate(IdealLoopTree* loop, Node* predicate_proj, int scale_con,
Node* offset, Node* limit, int stride_con, Node* value,
bool is_template);
@@ -1535,6 +1536,7 @@ class PhaseIdealLoop : public PhaseTransform {
// Mark an IfNode as being dominated by a prior test,
// without actually altering the CFG (and hence IDOM info).
void dominated_by(IfProjNode* prevdom, IfNode* iff, bool flip = false, bool pin_array_access_nodes = false);
+ void rewire_safe_outputs_to_dominator(Node* source, Node* dominator, bool pin_array_access_nodes);
// Split Node 'n' through merge point
RegionNode* split_thru_region(Node* n, RegionNode* region);
diff --git a/src/hotspot/share/opto/loopopts.cpp b/src/hotspot/share/opto/loopopts.cpp
index 23b2edce6549a..182947e552e88 100644
--- a/src/hotspot/share/opto/loopopts.cpp
+++ b/src/hotspot/share/opto/loopopts.cpp
@@ -340,24 +340,31 @@ void PhaseIdealLoop::dominated_by(IfProjNode* prevdom, IfNode* iff, bool flip, b
// I can assume this path reaches an infinite loop. In this case it's not
// important to optimize the data Nodes - either the whole compilation will
// be tossed or this path (and all data Nodes) will go dead.
- if (iff->outcnt() != 2) return;
+ if (iff->outcnt() != 2) {
+ return;
+ }
// Make control-dependent data Nodes on the live path (path that will remain
// once the dominated IF is removed) become control-dependent on the
// dominating projection.
Node* dp = iff->proj_out_or_null(pop == Op_IfTrue);
- if (dp == nullptr)
+ if (dp == nullptr) {
return;
+ }
+
+ rewire_safe_outputs_to_dominator(dp, prevdom, pin_array_access_nodes);
+}
- IdealLoopTree* old_loop = get_loop(dp);
+void PhaseIdealLoop::rewire_safe_outputs_to_dominator(Node* source, Node* dominator, const bool pin_array_access_nodes) {
+ IdealLoopTree* old_loop = get_loop(source);
- for (DUIterator_Fast imax, i = dp->fast_outs(imax); i < imax; i++) {
- Node* cd = dp->fast_out(i); // Control-dependent node
+ for (DUIterator_Fast imax, i = source->fast_outs(imax); i < imax; i++) {
+ Node* out = source->fast_out(i); // Control-dependent node
// Do not rewire Div and Mod nodes which could have a zero divisor to avoid skipping their zero check.
- if (cd->depends_only_on_test() && _igvn.no_dependent_zero_check(cd)) {
- assert(cd->in(0) == dp, "");
- _igvn.replace_input_of(cd, 0, prevdom);
+ if (out->depends_only_on_test() && _igvn.no_dependent_zero_check(out)) {
+ assert(out->in(0) == source, "must be control dependent on source");
+ _igvn.replace_input_of(out, 0, dominator);
if (pin_array_access_nodes) {
// Because of Loop Predication, Loads and range check Cast nodes that are control dependent on this range
// check (that is about to be removed) now depend on multiple dominating Hoisted Check Predicates. After the
@@ -365,21 +372,21 @@ void PhaseIdealLoop::dominated_by(IfProjNode* prevdom, IfNode* iff, bool flip, b
// in the graph. To ensure that these Loads/Casts do not float above any of the dominating checks (even when the
// lowest dominating check is later replaced by yet another dominating check), we need to pin them at the lowest
// dominating check.
- Node* clone = cd->pin_array_access_node();
+ Node* clone = out->pin_array_access_node();
if (clone != nullptr) {
- clone = _igvn.register_new_node_with_optimizer(clone, cd);
- _igvn.replace_node(cd, clone);
- cd = clone;
+ clone = _igvn.register_new_node_with_optimizer(clone, out);
+ _igvn.replace_node(out, clone);
+ out = clone;
}
}
- set_early_ctrl(cd, false);
- IdealLoopTree* new_loop = get_loop(get_ctrl(cd));
+ set_early_ctrl(out, false);
+ IdealLoopTree* new_loop = get_loop(get_ctrl(out));
if (old_loop != new_loop) {
if (!old_loop->_child) {
- old_loop->_body.yank(cd);
+ old_loop->_body.yank(out);
}
if (!new_loop->_child) {
- new_loop->_body.push(cd);
+ new_loop->_body.push(out);
}
}
--i;
From 9d4a4bd2c2a4bd16bbc80b602b15b448c52220f6 Mon Sep 17 00:00:00 2001
From: Matthew Donovan
Date: Mon, 24 Jun 2024 11:15:33 +0000
Subject: [PATCH 021/288] 8324841: PKCS11 tests still skip execution
Reviewed-by: valeriep
---
test/jdk/sun/security/pkcs11/PKCS11Test.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/jdk/sun/security/pkcs11/PKCS11Test.java b/test/jdk/sun/security/pkcs11/PKCS11Test.java
index ffd1c42fd88f4..2810040e376a6 100644
--- a/test/jdk/sun/security/pkcs11/PKCS11Test.java
+++ b/test/jdk/sun/security/pkcs11/PKCS11Test.java
@@ -791,8 +791,8 @@ private static Path findNSSLibrary(Path path, Path libraryName) throws IOExcepti
(tp, attr) -> tp.getFileName().equals(libraryName))) {
return files.findAny()
- .orElseThrow(() -> new SkippedException(
- "NSS library \"" + libraryName + "\" was not found in " + path));
+ .orElseThrow(() ->
+ new RuntimeException("NSS library \"" + libraryName + "\" was not found in " + path));
}
}
From 2e64d15144be03388104c762816c1ba629da9639 Mon Sep 17 00:00:00 2001
From: Lutz Schmidt
Date: Mon, 24 Jun 2024 11:27:18 +0000
Subject: [PATCH 022/288] 8334564: VM startup: fatal error: FLAG_SET_ERGO
cannot be used to set an invalid value for NonNMethodCodeHeapSize
Reviewed-by: mdoerr, kvn, stuefe
---
src/hotspot/share/code/codeCache.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp
index 20583ce492ddd..36656515942c3 100644
--- a/src/hotspot/share/code/codeCache.cpp
+++ b/src/hotspot/share/code/codeCache.cpp
@@ -227,6 +227,11 @@ void CodeCache::initialize_heaps() {
if (!non_nmethod.set) {
non_nmethod.size += compiler_buffer_size;
+ // Further down, just before FLAG_SET_ERGO(), all segment sizes are
+ // aligned down to the next lower multiple of min_size. For large page
+ // sizes, this may result in (non_nmethod.size == 0) which is not acceptable.
+ // Therefore, force non_nmethod.size to at least min_size.
+ non_nmethod.size = MAX2(non_nmethod.size, min_size);
}
if (!profiled.set && !non_profiled.set) {
From 5ac2149b7bde947886533bf5996d977bb8ec66f1 Mon Sep 17 00:00:00 2001
From: Coleen Phillimore
Date: Mon, 24 Jun 2024 12:37:53 +0000
Subject: [PATCH 023/288] 8334299: Deprecate LockingMode option, along with
LM_LEGACY and LM_MONITOR
Reviewed-by: stuefe, dholmes
---
src/hotspot/share/runtime/arguments.cpp | 1 +
src/hotspot/share/runtime/globals.hpp | 6 +++---
.../jtreg/runtime/CommandLine/VMDeprecatedOptions.java | 1 +
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
index 0949e9e2aacac..f428403fa3002 100644
--- a/src/hotspot/share/runtime/arguments.cpp
+++ b/src/hotspot/share/runtime/arguments.cpp
@@ -505,6 +505,7 @@ static SpecialFlag const special_jvm_flags[] = {
{ "DontYieldALot", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
{ "PreserveAllAnnotations", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
{ "UseNotificationThread", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
+ { "LockingMode", JDK_Version::jdk(24), JDK_Version::jdk(26), JDK_Version::jdk(27) },
// --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in:
{ "CreateMinidumpOnCrash", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() },
diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp
index b8b9c846bb4d1..e4eb8d3e9e90c 100644
--- a/src/hotspot/share/runtime/globals.hpp
+++ b/src/hotspot/share/runtime/globals.hpp
@@ -1957,9 +1957,9 @@ const int ObjectAlignmentInBytes = 8;
"fence. Add cleanliness checks.") \
\
product(int, LockingMode, LM_LIGHTWEIGHT, \
- "Select locking mode: " \
- "0: monitors only (LM_MONITOR), " \
- "1: monitors & legacy stack-locking (LM_LEGACY), " \
+ "(Deprecated) Select locking mode: " \
+ "0: (Deprecated) monitors only (LM_MONITOR), " \
+ "1: (Deprecated) monitors & legacy stack-locking (LM_LEGACY), " \
"2: monitors & new lightweight locking (LM_LIGHTWEIGHT, default)") \
range(0, 2) \
\
diff --git a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java
index 7904b01495fc7..4e6252ae20510 100644
--- a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java
+++ b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java
@@ -58,6 +58,7 @@ public class VMDeprecatedOptions {
// deprecated non-alias flags:
{"AllowRedefinitionToAddDeleteMethods", "true"},
{"ZGenerational", "false"},
+ {"LockingMode", "1"},
// deprecated alias flags (see also aliased_jvm_flags):
{"CreateMinidumpOnCrash", "false"}
From e825ccfe6652577e4e828e8e4dfe19be0ea77813 Mon Sep 17 00:00:00 2001
From: Robert Toyonaga
Date: Mon, 24 Jun 2024 13:33:20 +0000
Subject: [PATCH 024/288] 8332362: Implement os::committed_in_range for MacOS
and AIX
Reviewed-by: stuefe
---
src/hotspot/os/linux/os_linux.cpp | 75 ---------------
src/hotspot/os/posix/os_posix.cpp | 91 +++++++++++++++++++
src/hotspot/share/runtime/os.cpp | 7 --
.../runtime/test_committed_virtualmemory.cpp | 43 +++++++++
.../Thread/TestAlwaysPreTouchStacks.java | 39 ++++++--
5 files changed, 166 insertions(+), 89 deletions(-)
diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp
index 52866a44b26c6..87150365ed576 100644
--- a/src/hotspot/os/linux/os_linux.cpp
+++ b/src/hotspot/os/linux/os_linux.cpp
@@ -3525,81 +3525,6 @@ static address get_stack_commited_bottom(address bottom, size_t size) {
return nbot;
}
-bool os::committed_in_range(address start, size_t size, address& committed_start, size_t& committed_size) {
- int mincore_return_value;
- const size_t stripe = 1024; // query this many pages each time
- unsigned char vec[stripe + 1];
- // set a guard
- vec[stripe] = 'X';
-
- const size_t page_sz = os::vm_page_size();
- uintx pages = size / page_sz;
-
- assert(is_aligned(start, page_sz), "Start address must be page aligned");
- assert(is_aligned(size, page_sz), "Size must be page aligned");
-
- committed_start = nullptr;
-
- int loops = checked_cast((pages + stripe - 1) / stripe);
- int committed_pages = 0;
- address loop_base = start;
- bool found_range = false;
-
- for (int index = 0; index < loops && !found_range; index ++) {
- assert(pages > 0, "Nothing to do");
- uintx pages_to_query = (pages >= stripe) ? stripe : pages;
- pages -= pages_to_query;
-
- // Get stable read
- while ((mincore_return_value = mincore(loop_base, pages_to_query * page_sz, vec)) == -1 && errno == EAGAIN);
-
- // During shutdown, some memory goes away without properly notifying NMT,
- // E.g. ConcurrentGCThread/WatcherThread can exit without deleting thread object.
- // Bailout and return as not committed for now.
- if (mincore_return_value == -1 && errno == ENOMEM) {
- return false;
- }
-
- // If mincore is not supported.
- if (mincore_return_value == -1 && errno == ENOSYS) {
- return false;
- }
-
- assert(vec[stripe] == 'X', "overflow guard");
- assert(mincore_return_value == 0, "Range must be valid");
- // Process this stripe
- for (uintx vecIdx = 0; vecIdx < pages_to_query; vecIdx ++) {
- if ((vec[vecIdx] & 0x01) == 0) { // not committed
- // End of current contiguous region
- if (committed_start != nullptr) {
- found_range = true;
- break;
- }
- } else { // committed
- // Start of region
- if (committed_start == nullptr) {
- committed_start = loop_base + page_sz * vecIdx;
- }
- committed_pages ++;
- }
- }
-
- loop_base += pages_to_query * page_sz;
- }
-
- if (committed_start != nullptr) {
- assert(committed_pages > 0, "Must have committed region");
- assert(committed_pages <= int(size / page_sz), "Can not commit more than it has");
- assert(committed_start >= start && committed_start < start + size, "Out of range");
- committed_size = page_sz * committed_pages;
- return true;
- } else {
- assert(committed_pages == 0, "Should not have committed region");
- return false;
- }
-}
-
-
// Linux uses a growable mapping for the stack, and if the mapping for
// the stack guard pages is not removed when we detach a thread the
// stack cannot grow beyond the pages where the stack guard was
diff --git a/src/hotspot/os/posix/os_posix.cpp b/src/hotspot/os/posix/os_posix.cpp
index 1e7473eea1dc1..26bff6c8bd4e6 100644
--- a/src/hotspot/os/posix/os_posix.cpp
+++ b/src/hotspot/os/posix/os_posix.cpp
@@ -93,6 +93,9 @@
#define MAP_ANONYMOUS MAP_ANON
#endif
+/* Input/Output types for mincore(2) */
+typedef LINUX_ONLY(unsigned) char mincore_vec_t;
+
static jlong initial_time_count = 0;
static int clock_tics_per_sec = 100;
@@ -146,6 +149,94 @@ void os::check_dump_limit(char* buffer, size_t bufferSize) {
VMError::record_coredump_status(buffer, success);
}
+bool os::committed_in_range(address start, size_t size, address& committed_start, size_t& committed_size) {
+
+#ifdef _AIX
+ committed_start = start;
+ committed_size = size;
+ return true;
+#else
+
+ int mincore_return_value;
+ constexpr size_t stripe = 1024; // query this many pages each time
+ mincore_vec_t vec [stripe + 1];
+
+ // set a guard
+ DEBUG_ONLY(vec[stripe] = 'X');
+
+ size_t page_sz = os::vm_page_size();
+ uintx pages = size / page_sz;
+
+ assert(is_aligned(start, page_sz), "Start address must be page aligned");
+ assert(is_aligned(size, page_sz), "Size must be page aligned");
+
+ committed_start = nullptr;
+
+ int loops = checked_cast((pages + stripe - 1) / stripe);
+ int committed_pages = 0;
+ address loop_base = start;
+ bool found_range = false;
+
+ for (int index = 0; index < loops && !found_range; index ++) {
+ assert(pages > 0, "Nothing to do");
+ uintx pages_to_query = (pages >= stripe) ? stripe : pages;
+ pages -= pages_to_query;
+
+ // Get stable read
+ int fail_count = 0;
+ while ((mincore_return_value = mincore(loop_base, pages_to_query * page_sz, vec)) == -1 && errno == EAGAIN){
+ if (++fail_count == 1000){
+ return false;
+ }
+ }
+
+ // During shutdown, some memory goes away without properly notifying NMT,
+ // E.g. ConcurrentGCThread/WatcherThread can exit without deleting thread object.
+ // Bailout and return as not committed for now.
+ if (mincore_return_value == -1 && errno == ENOMEM) {
+ return false;
+ }
+
+ // If mincore is not supported.
+ if (mincore_return_value == -1 && errno == ENOSYS) {
+ return false;
+ }
+
+ assert(vec[stripe] == 'X', "overflow guard");
+ assert(mincore_return_value == 0, "Range must be valid");
+ // Process this stripe
+ for (uintx vecIdx = 0; vecIdx < pages_to_query; vecIdx ++) {
+ if ((vec[vecIdx] & 0x01) == 0) { // not committed
+ // End of current contiguous region
+ if (committed_start != nullptr) {
+ found_range = true;
+ break;
+ }
+ } else { // committed
+ // Start of region
+ if (committed_start == nullptr) {
+ committed_start = loop_base + page_sz * vecIdx;
+ }
+ committed_pages ++;
+ }
+ }
+
+ loop_base += pages_to_query * page_sz;
+ }
+
+ if (committed_start != nullptr) {
+ assert(committed_pages > 0, "Must have committed region");
+ assert(committed_pages <= int(size / page_sz), "Can not commit more than it has");
+ assert(committed_start >= start && committed_start < start + size, "Out of range");
+ committed_size = page_sz * committed_pages;
+ return true;
+ } else {
+ assert(committed_pages == 0, "Should not have committed region");
+ return false;
+ }
+#endif
+}
+
int os::get_native_stack(address* stack, int frames, int toSkip) {
int frame_idx = 0;
int num_of_frames; // number of frames captured
diff --git a/src/hotspot/share/runtime/os.cpp b/src/hotspot/share/runtime/os.cpp
index 9860251fc3308..97bf33fbaaa7c 100644
--- a/src/hotspot/share/runtime/os.cpp
+++ b/src/hotspot/share/runtime/os.cpp
@@ -276,13 +276,6 @@ bool os::dll_build_name(char* buffer, size_t size, const char* fname) {
return (n != -1);
}
-#if !defined(LINUX) && !defined(_WINDOWS)
-bool os::committed_in_range(address start, size_t size, address& committed_start, size_t& committed_size) {
- committed_start = start;
- committed_size = size;
- return true;
-}
-#endif
// Helper for dll_locate_lib.
// Pass buffer and printbuffer as we already printed the path to buffer
diff --git a/test/hotspot/gtest/runtime/test_committed_virtualmemory.cpp b/test/hotspot/gtest/runtime/test_committed_virtualmemory.cpp
index d4959cfa00854..2ffef1e211fdd 100644
--- a/test/hotspot/gtest/runtime/test_committed_virtualmemory.cpp
+++ b/test/hotspot/gtest/runtime/test_committed_virtualmemory.cpp
@@ -196,6 +196,42 @@ class CommittedVirtualMemoryTest {
os::release_memory(base, size);
}
+
+ static void test_committed_in_range(size_t num_pages, size_t pages_to_touch) {
+ bool result;
+ size_t committed_size;
+ address committed_start;
+ size_t index;
+
+ const size_t page_sz = os::vm_page_size();
+ const size_t size = num_pages * page_sz;
+
+ char* base = os::reserve_memory(size, !ExecMem, mtTest);
+ ASSERT_NE(base, (char*)nullptr);
+
+ result = os::commit_memory(base, size, !ExecMem);
+ ASSERT_TRUE(result);
+
+ result = os::committed_in_range((address)base, size, committed_start, committed_size);
+ ASSERT_FALSE(result);
+
+ // Touch pages
+ for (index = 0; index < pages_to_touch; index ++) {
+ base[index * page_sz] = 'a';
+ }
+
+ result = os::committed_in_range((address)base, size, committed_start, committed_size);
+ ASSERT_TRUE(result);
+ ASSERT_EQ(pages_to_touch * page_sz, committed_size);
+ ASSERT_EQ(committed_start, (address)base);
+
+ os::uncommit_memory(base, size, false);
+
+ result = os::committed_in_range((address)base, size, committed_start, committed_size);
+ ASSERT_FALSE(result);
+
+ os::release_memory(base, size);
+ }
};
TEST_VM(CommittedVirtualMemoryTracker, test_committed_virtualmemory_region) {
@@ -214,3 +250,10 @@ TEST_VM(CommittedVirtualMemoryTracker, test_committed_virtualmemory_region) {
}
}
+
+#if !defined(_WINDOWS) && !defined(_AIX)
+TEST_VM(CommittedVirtualMemory, test_committed_in_range){
+ CommittedVirtualMemoryTest::test_committed_in_range(1024, 1024);
+ CommittedVirtualMemoryTest::test_committed_in_range(2, 1);
+}
+#endif
diff --git a/test/hotspot/jtreg/runtime/Thread/TestAlwaysPreTouchStacks.java b/test/hotspot/jtreg/runtime/Thread/TestAlwaysPreTouchStacks.java
index b12eff0cf8454..f16e0ff9da4fd 100644
--- a/test/hotspot/jtreg/runtime/Thread/TestAlwaysPreTouchStacks.java
+++ b/test/hotspot/jtreg/runtime/Thread/TestAlwaysPreTouchStacks.java
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2022 SAP SE. All rights reserved.
- * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 2024, Oracle and/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
@@ -32,14 +32,27 @@
import java.util.regex.Pattern;
import java.util.concurrent.CyclicBarrier;
+import static jdk.test.lib.Platform.isLinux;
+import static jdk.test.lib.Platform.isWindows;
+
/*
- * @test
+ * @test id=preTouch
* @summary Test AlwaysPreTouchThreadStacks
* @requires os.family != "aix"
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.management
- * @run driver TestAlwaysPreTouchStacks
+ * @run driver TestAlwaysPreTouchStacks preTouch
+ */
+
+/*
+ * @test id=noPreTouch
+ * @summary Test that only touched committed memory is reported as thread stack usage.
+ * @requires os.family != "aix"
+ * @library /test/lib
+ * @modules java.base/jdk.internal.misc
+ * java.management
+ * @run driver TestAlwaysPreTouchStacks noPreTouch
*/
public class TestAlwaysPreTouchStacks {
@@ -90,12 +103,22 @@ public static void main(String[] args) throws Exception {
// should show up with fully - or almost fully - committed thread stacks.
} else {
+ boolean preTouch;
+ if (args.length == 1 && args[0].equals("noPreTouch")){
+ preTouch = false;
+ } else if (args.length == 1 && args[0].equals("preTouch")){
+ preTouch = true;
+ } else {
+ throw new RuntimeException("Invalid test input. Must be 'preTouch' or 'noPreTouch'.");
+ }
ArrayList vmArgs = new ArrayList<>();
Collections.addAll(vmArgs,
"-XX:+UnlockDiagnosticVMOptions",
"-Xmx100M",
- "-XX:+AlwaysPreTouchStacks",
"-XX:NativeMemoryTracking=summary", "-XX:+PrintNMTStatistics");
+ if (preTouch){
+ vmArgs.add("-XX:+AlwaysPreTouchStacks");
+ }
if (System.getProperty("os.name").contains("Linux")) {
vmArgs.add("-XX:-UseMadvPopulateWrite");
}
@@ -110,8 +133,8 @@ public static void main(String[] args) throws Exception {
output.shouldContain("Alive: " + i);
}
- // We want to see, in the final NMT printout, a committed thread stack size very close to reserved
- // stack size. Like this:
+ // If using -XX:+AlwaysPreTouchStacks, we want to see, in the final NMT printout,
+ // a committed thread stack size very close to reserved stack size. Like this:
// - Thread (reserved=10332400KB, committed=10284360KB)
// (thread #10021)
// (stack: reserved=10301560KB, committed=10253520KB) <<<<
@@ -135,8 +158,10 @@ public static void main(String[] args) throws Exception {
// as thread stack. But without pre-touching, the thread stacks would be committed to about 1/5th
// of their reserved size. Requiring them to be committed for over 3/4th shows that pretouch is
// really working.
- if ((double)committed < ((double)reserved * 0.75)) {
+ if (preTouch && (double)committed < ((double)reserved * 0.75)) {
throw new RuntimeException("Expected a higher ratio between stack committed and reserved.");
+ } else if (!preTouch && (double)committed > ((double)reserved * 0.50)){
+ throw new RuntimeException("Expected a lower ratio between stack committed and reserved.");
}
// Added sanity tests: we expect our test threads to be still alive when NMT prints its final
// report, so their stacks should dominate the NMT-reported total stack size.
From b2930c5aeedf911ec893734181c1af0573e222f4 Mon Sep 17 00:00:00 2001
From: Adam Sotona
Date: Mon, 24 Jun 2024 13:34:29 +0000
Subject: [PATCH 025/288] 8334040: jdk/classfile/CorpusTest.java timed out
Reviewed-by: alanb
---
test/jdk/jdk/classfile/CorpusTest.java | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/test/jdk/jdk/classfile/CorpusTest.java b/test/jdk/jdk/classfile/CorpusTest.java
index 21e275a837d84..64db67e6d8eb0 100644
--- a/test/jdk/jdk/classfile/CorpusTest.java
+++ b/test/jdk/jdk/classfile/CorpusTest.java
@@ -117,7 +117,7 @@ public void writeBody(BufWriter b) {
static Path[] corpus() throws IOException, URISyntaxException {
splitTableAttributes("testdata/Pattern2.class", "testdata/Pattern2-split.class");
return Stream.of(
- Files.walk(JRT.getPath("modules/java.base/java")),
+ Files.walk(JRT.getPath("modules/java.base/java/util")),
Files.walk(JRT.getPath("modules"), 2).filter(p -> p.endsWith("module-info.class")),
Files.walk(Paths.get(URI.create(CorpusTest.class.getResource("CorpusTest.class").toString())).getParent()))
.flatMap(p -> p)
@@ -140,6 +140,7 @@ void testNullAdaptations(Path path) throws Exception {
for (Transforms.NoOpTransform m : Transforms.NoOpTransform.values()) {
if (m == Transforms.NoOpTransform.ARRAYCOPY
|| m == Transforms.NoOpTransform.SHARED_3_NO_STACKMAP
+ || m == Transforms.NoOpTransform.CLASS_REMAPPER
|| m.name().startsWith("ASM"))
continue;
@@ -190,12 +191,8 @@ void testNullAdaptations(Path path) throws Exception {
.collect(joining("\n"));
fail(String.format("Errors in testNullAdapt: %s", msg));
}
- }
- @ParameterizedTest
- @MethodSource("corpus")
- void testReadAndTransform(Path path) throws IOException {
- byte[] bytes = Files.readAllBytes(path);
+ // test read and transform
var cc = ClassFile.of();
var classModel = cc.parse(bytes);
assertEqualsDeep(ClassRecord.ofClassModel(classModel), ClassRecord.ofStreamingElements(classModel),
From 55c796946158aab1d019a57b77a33441d7b13065 Mon Sep 17 00:00:00 2001
From: Erik Gahlin
Date: Mon, 24 Jun 2024 14:36:50 +0000
Subject: [PATCH 026/288] 8334765: JFR: Log chunk waste
Reviewed-by: mgronlun
---
.../internal/consumer/filter/ChunkWriter.java | 29 ++++++++++++++++++-
test/jdk/jdk/jfr/jvm/TestWaste.java | 4 +--
2 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/filter/ChunkWriter.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/filter/ChunkWriter.java
index 8c22432512a1a..d38a5872adedb 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/filter/ChunkWriter.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/filter/ChunkWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 2024, Oracle and/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
@@ -30,6 +30,8 @@
import java.nio.file.Path;
import java.util.ArrayDeque;
import java.util.Deque;
+import java.util.Map;
+import java.util.HashMap;
import java.util.function.Predicate;
import jdk.jfr.consumer.RecordedEvent;
@@ -56,6 +58,7 @@ public final class ChunkWriter implements Closeable {
private final RecordingInput input;
private final RecordingOutput output;
private final Predicate filter;
+ private final Map waste = new HashMap<>();
private long chunkStartPosition;
private boolean chunkComplete;
@@ -178,6 +181,16 @@ public void endChunk(ChunkHeader header) throws IOException {
pools = new LongMap<>();
chunkComplete = true;
lastCheckpoint = 0;
+ if (Logger.shouldLog(LogTag.JFR_SYSTEM_PARSER, LogLevel.DEBUG)) {
+ // Log largest waste first
+ waste.entrySet().stream()
+ .sorted((a, b) -> b.getValue().compareTo(a.getValue()))
+ .forEach(entry -> {
+ String msg = "Total chunk waste by " + entry.getKey() + ": " + entry.getValue() + " bytes.";
+ Logger.log(LogTag.JFR_SYSTEM_PARSER, LogLevel.DEBUG, msg);
+ });
+ }
+ waste.clear();
}
private void writeMetadataEvent(ChunkHeader header) throws IOException {
@@ -216,6 +229,20 @@ private void write(CheckpointEvent event, long delta) throws IOException {
}
}
}
+ if (Logger.shouldLog(LogTag.JFR_SYSTEM_PARSER, LogLevel.DEBUG)) {
+ for (CheckpointPool pool : event.getPools()) {
+ for (PoolEntry pe : pool.getEntries()) {
+ if (!pe.isTouched()) {
+ String name = pe.getType().getName();
+ long amount = pe.getEndPosition() - pe.getStartPosition();
+ waste.merge(pe.getType().getName(), amount, Long::sum);
+ String msg = "Unreferenced constant ID " + pe.getId() +
+ " of type "+ name + " using " + amount + " bytes.";
+ Logger.log(LogTag.JFR_SYSTEM_PARSER, LogLevel.TRACE, msg);
+ }
+ }
+ }
+ }
long endPosition = output.position();
long size = endPosition - startPosition;
output.position(startPosition);
diff --git a/test/jdk/jdk/jfr/jvm/TestWaste.java b/test/jdk/jdk/jfr/jvm/TestWaste.java
index 0cc1010765eb6..afa2dda4ee12c 100644
--- a/test/jdk/jdk/jfr/jvm/TestWaste.java
+++ b/test/jdk/jdk/jfr/jvm/TestWaste.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2022, 2024, Oracle and/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
@@ -47,7 +47,7 @@
* @requires vm.hasJFR
* @library /test/lib /test/jdk
* @modules jdk.jfr/jdk.jfr.internal.test
- * @run main/othervm -XX:TLABSize=2k jdk.jfr.jvm.TestWaste
+ * @run main/othervm -Xlog:jfr+system+parser=debug -XX:TLABSize=2k jdk.jfr.jvm.TestWaste
*/
public class TestWaste {
static List