Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
[GR-42125] Merge in jdk-11.0.18+10.
Browse files Browse the repository at this point in the history
PullRequest: labsjdk-ce-11/325
  • Loading branch information
marwan-hallaoui committed Jan 18, 2023
2 parents b6446a1 + f8bde79 commit 8c0050a
Show file tree
Hide file tree
Showing 43 changed files with 344 additions and 245 deletions.
10 changes: 9 additions & 1 deletion make/autoconf/bootcycle-spec.gmk.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,19 @@
# First include the real base spec.gmk file
include @SPEC@

# Override specific values to do a boot cycle build
# Check that the user did not try to specify a different java to use for compiling.
# On windows we need to account for fixpath being first word.
ifeq ($(firstword $(JAVA)),$(FIXPATH))
JAVA_EXEC_POS=2
else
JAVA_EXEC_POS=1
endif
ifneq ($(word $(JAVA_EXEC_POS),$(SJAVAC_SERVER_JAVA)),$(word $(JAVA_EXEC_POS),$(JAVA)))
$(error Bootcycle builds are not possible if --with-sjavac-server-java is specified)
endif

# Override specific values to do a boot cycle build

# Use a different Boot JDK
BOOT_JDK := $(JDK_IMAGE_DIR)

Expand Down
2 changes: 1 addition & 1 deletion make/autoconf/version-numbers
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ DEFAULT_VERSION_DATE=2023-01-17
DEFAULT_VERSION_CLASSFILE_MAJOR=55 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_CLASSFILE_MINOR=0
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="10 11"
DEFAULT_PROMOTED_VERSION_PRE=ea
DEFAULT_PROMOTED_VERSION_PRE=

LAUNCHER_NAME=openjdk
PRODUCT_NAME=OpenJDK
Expand Down
4 changes: 2 additions & 2 deletions make/data/currency/CurrencyData.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ formatVersion=3
# Version of the currency code information in this class.
# It is a serial number that accompanies with each amendment.

dataVersion=173
dataVersion=174

# List of all valid ISO 4217 currency codes.
# To ensure compatibility, do not remove codes.
Expand Down Expand Up @@ -189,7 +189,7 @@ CR=CRC
# COTE D'IVOIRE
CI=XOF
# CROATIA
HR=HRK
HR=HRK;2022-12-31-23-00-00;EUR
# CUBA
CU=CUP
# Cura\u00e7ao
Expand Down
18 changes: 10 additions & 8 deletions src/hotspot/os/posix/vmError_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,21 @@ static void crash_handler(int sig, siginfo_t* info, void* ucVoid) {
}

// Needed to make it possible to call SafeFetch.. APIs in error handling.
if (uc && pc && StubRoutines::is_safefetch_fault(pc)) {
os::Posix::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
return;
}
if (sig == SIGSEGV || sig == SIGBUS) {
if (uc && pc && StubRoutines::is_safefetch_fault(pc)) {
os::Posix::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
return;
}

// Needed because asserts may happen in error handling too.
#ifdef CAN_SHOW_REGISTERS_ON_ASSERT
if ((sig == SIGSEGV || sig == SIGBUS) && info != NULL && info->si_addr == g_assert_poison) {
if (handle_assert_poison_fault(ucVoid, info->si_addr)) {
return;
if (info != NULL && info->si_addr == g_assert_poison) {
if (handle_assert_poison_fault(ucVoid, info->si_addr)) {
return;
}
}
}
#endif // CAN_SHOW_REGISTERS_ON_ASSERT
}

VMError::report_and_die(NULL, sig, pc, info, ucVoid);
}
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrec
// SafeFetch 32 handling:
// - make it work if _thread is null
// - make it use the standard os::...::ucontext_get/set_pc APIs
if (uc) {
if ((sig == SIGSEGV || sig == SIGBUS) && uc) {
address const pc = os::Aix::ucontext_get_pc(uc);
if (pc && StubRoutines::is_safefetch_fault(pc)) {
os::Aix::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ JVM_handle_bsd_signal(int sig,
}

// Handle SafeFetch faults:
if (uc != NULL) {
if ((sig == SIGSEGV || sig == SIGBUS) && uc != NULL) {
address const pc = (address) os::Bsd::ucontext_get_pc(uc);
if (pc && StubRoutines::is_safefetch_fault(pc)) {
os::Bsd::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ JVM_handle_bsd_signal(int sig,
}

// Handle SafeFetch faults:
if (uc != NULL) {
if ((sig == SIGSEGV || sig == SIGBUS) && uc != NULL) {
address const pc = (address) os::Bsd::ucontext_get_pc(uc);
if (pc && StubRoutines::is_safefetch_fault(pc)) {
os::Bsd::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ JVM_handle_linux_signal(int sig,
}

// Handle SafeFetch faults:
if (uc != NULL) {
if ((sig == SIGSEGV || sig == SIGBUS) && uc != NULL) {
address const pc = (address) os::Linux::ucontext_get_pc(uc);
if (pc && StubRoutines::is_safefetch_fault(pc)) {
os::Linux::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ extern "C" int JVM_handle_linux_signal(int sig, siginfo_t* info,
}

// Handle SafeFetch faults:
if (uc != NULL) {
if ((sig == SIGSEGV || sig == SIGBUS) && uc != NULL) {
address const pc = (address) os::Linux::ucontext_get_pc(uc);
if (pc && StubRoutines::is_safefetch_fault(pc)) {
os::Linux::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ JVM_handle_linux_signal(int sig,

// Moved SafeFetch32 handling outside thread!=NULL conditional block to make
// it work if no associated JavaThread object exists.
if (uc) {
if ((sig == SIGSEGV || sig == SIGBUS) && uc) {
address const pc = os::Linux::ucontext_get_pc(uc);
if (pc && StubRoutines::is_safefetch_fault(pc)) {
os::Linux::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ JVM_handle_linux_signal(int sig,

// Moved SafeFetch32 handling outside thread!=NULL conditional block to make
// it work if no associated JavaThread object exists.
if (uc) {
if ((sig == SIGSEGV || sig == SIGBUS) && uc) {
address const pc = os::Linux::ucontext_get_pc(uc);
if (pc && StubRoutines::is_safefetch_fault(pc)) {
os::Linux::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/os_cpu/linux_sparc/os_linux_sparc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ JVM_handle_linux_signal(int sig,
return 1;
}

if (checkPrefetch(uc, pc)) {
if ((sig == SIGSEGV || sig == SIGBUS) && checkPrefetch(uc, pc)) {
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ JVM_handle_linux_signal(int sig,
}

// Handle SafeFetch faults:
if (uc != NULL) {
if ((sig == SIGSEGV || sig == SIGBUS) && uc != NULL) {
address const pc = (address) os::Linux::ucontext_get_pc(uc);
if (pc && StubRoutines::is_safefetch_fault(pc)) {
os::Linux::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/os_cpu/solaris_sparc/os_solaris_sparc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
}

// Handle SafeFetch faults:
if (uc != NULL) {
if ((sig == SIGSEGV || sig == SIGBUS) && uc != NULL) {
address const pc = (address) uc->uc_mcontext.gregs[REG_PC];
if (pc && StubRoutines::is_safefetch_fault(pc)) {
os::Solaris::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/os_cpu/solaris_x86/os_solaris_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
}

// Handle SafeFetch faults:
if (uc != NULL) {
if ((sig == SIGSEGV || sig == SIGBUS) && uc != NULL) {
address const pc = (address) uc->uc_mcontext.gregs[REG_PC];
if (pc && StubRoutines::is_safefetch_fault(pc)) {
os::Solaris::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ bool JfrCheckpointManager::is_locked() const {
}

static void assert_free_lease(const BufferPtr buffer) {
assert(buffer != NULL, "invariant");
if (buffer == NULL) {
return;
}
assert(buffer->acquired_by_self(), "invariant");
assert(buffer->lease(), "invariant");
}
Expand Down
8 changes: 5 additions & 3 deletions src/hotspot/share/jfr/recorder/storage/jfrBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ JfrBuffer::JfrBuffer() : _next(NULL),
_top(NULL),
_flags(0),
_header_size(0),
_size(0) {}
_size(0)
LP64_ONLY(COMMA _pad(0)) {}

bool JfrBuffer::initialize(size_t header_size, size_t size, const void* id /* NULL */) {
_header_size = (u2)header_size;
_size = (u4)(size / BytesPerWord);
assert(header_size <= max_jushort, "invariant");
_header_size = static_cast<u2>(header_size);
_size = size;
assert(_identity == NULL, "invariant");
_identity = id;
set_pos(start());
Expand Down
7 changes: 4 additions & 3 deletions src/hotspot/share/jfr/recorder/storage/jfrBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ class JfrBuffer {
const void* volatile _identity;
u1* _pos;
mutable const u1* volatile _top;
u2 _flags;
size_t _size;
u2 _header_size;
u4 _size;
u2 _flags;
LP64_ONLY(const u4 _pad;)

const u1* stable_top() const;

Expand Down Expand Up @@ -124,7 +125,7 @@ class JfrBuffer {
}

size_t size() const {
return _size * BytesPerWord;
return _size;
}

size_t total_size() const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,25 @@ bool JfrMemorySpace<T, RetrievalType, Callback>::initialize() {
// allocations are even multiples of the mspace min size
static inline size_t align_allocation_size(size_t requested_size, size_t min_elem_size) {
assert((int)min_elem_size % os::vm_page_size() == 0, "invariant");
if (requested_size > static_cast<size_t>(min_intx)) {
assert(false, "requested size: " SIZE_FORMAT " is too large", requested_size);
return 0;
}
u8 alloc_size_bytes = min_elem_size;
while (requested_size > alloc_size_bytes) {
alloc_size_bytes <<= 1;
}
assert((int)alloc_size_bytes % os::vm_page_size() == 0, "invariant");
return (size_t)alloc_size_bytes;
assert(alloc_size_bytes <= static_cast<size_t>(min_intx), "invariant");
return static_cast<size_t>(alloc_size_bytes);
}

template <typename T, template <typename> class RetrievalType, typename Callback>
inline T* JfrMemorySpace<T, RetrievalType, Callback>::allocate(size_t size) {
const size_t aligned_size_bytes = align_allocation_size(size, _min_elem_size);
if (size != 0 && aligned_size_bytes == 0) {
return NULL;
}
void* const allocation = JfrCHeapObj::new_array<u1>(aligned_size_bytes + sizeof(T));
if (allocation == NULL) {
return NULL;
Expand Down
6 changes: 4 additions & 2 deletions src/hotspot/share/jfr/writers/jfrWriterHost.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ template <typename T>
inline void WriterHost<BE, IE, WriterPolicyImpl>::write(const T* value, size_t len) {
assert(value != NULL, "invariant");
assert(len > 0, "invariant");
assert(len <= max_jint, "invariant");
// Might need T + 1 size
u1* const pos = ensure_size(sizeof(T) * len + len);
if (pos) {
Expand Down Expand Up @@ -126,8 +127,9 @@ template <typename T>
inline void WriterHost<BE, IE, WriterPolicyImpl>::be_write(const T* value, size_t len) {
assert(value != NULL, "invariant");
assert(len > 0, "invariant");
// Might need T + 1 size
u1* const pos = ensure_size(sizeof(T) * len + len);
assert(len <= max_jint, "invariant");
// Big endian writes map one-to-one for length, so no extra space is needed.
u1* const pos = ensure_size(sizeof(T) * len);
if (pos) {
this->set_current_pos(BE::be_write(value, len, pos));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

import sun.security.provider.ParameterCache;
import static sun.security.util.SecurityProviderConstants.DEF_DH_KEY_SIZE;
import static sun.security.util.SecurityProviderConstants.getDefDHPrivateExpSize;

/**
* This class represents the key pair generator for Diffie-Hellman key pairs.
Expand All @@ -60,9 +61,6 @@ public final class DHKeyPairGenerator extends KeyPairGeneratorSpi {
// The size in bits of the prime modulus
private int pSize;

// The size in bits of the random exponent (private value)
private int lSize;

// The source of randomness
private SecureRandom random;

Expand All @@ -71,7 +69,8 @@ public DHKeyPairGenerator() {
initialize(DEF_DH_KEY_SIZE, null);
}

private static void checkKeySize(int keysize)
// pkg private; used by DHParameterGenerator class as well
static void checkKeySize(int keysize, int expSize)
throws InvalidParameterException {

if ((keysize < 512) || (keysize > 8192) || ((keysize & 0x3F) != 0)) {
Expand All @@ -80,6 +79,13 @@ private static void checkKeySize(int keysize)
"from 512 to 8192 (inclusive). " +
"The specific key size " + keysize + " is not supported");
}

// optional, could be 0 if not specified
if ((expSize < 0) || (expSize > keysize)) {
throw new InvalidParameterException
("Exponent size must be positive and no larger than" +
" modulus size");
}
}

/**
Expand All @@ -91,21 +97,17 @@ private static void checkKeySize(int keysize)
* @param random the source of randomness
*/
public void initialize(int keysize, SecureRandom random) {
checkKeySize(keysize);
checkKeySize(keysize, 0);

// Use the built-in parameters (ranging from 512 to 8192)
// when available.
this.params = ParameterCache.getCachedDHParameterSpec(keysize);

// Due to performance issue, only support DH parameters generation
// up to 1024 bits.
if ((this.params == null) && (keysize > 1024)) {
throw new InvalidParameterException(
"Unsupported " + keysize + "-bit DH parameter generation");
try {
// Use the built-in parameters (ranging from 512 to 8192)
// when available.
this.params = ParameterCache.getDHParameterSpec(keysize, random);
} catch (GeneralSecurityException e) {
throw new InvalidParameterException(e.getMessage());
}

this.pSize = keysize;
this.lSize = 0;
this.random = random;
}

Expand All @@ -130,22 +132,13 @@ public void initialize(AlgorithmParameterSpec algParams,
("Inappropriate parameter type");
}

params = (DHParameterSpec)algParams;
params = (DHParameterSpec) algParams;
pSize = params.getP().bitLength();
try {
checkKeySize(pSize);
checkKeySize(pSize, params.getL());
} catch (InvalidParameterException ipe) {
throw new InvalidAlgorithmParameterException(ipe.getMessage());
}

// exponent size is optional, could be 0
lSize = params.getL();

// Require exponentSize < primeSize
if ((lSize != 0) && (lSize > pSize)) {
throw new InvalidAlgorithmParameterException
("Exponent size must not be larger than modulus size");
}
this.random = random;
}

Expand All @@ -159,24 +152,12 @@ public KeyPair generateKeyPair() {
random = SunJCE.getRandom();
}

if (params == null) {
try {
params = ParameterCache.getDHParameterSpec(pSize, random);
} catch (GeneralSecurityException e) {
// should never happen
throw new ProviderException(e);
}
}

BigInteger p = params.getP();
BigInteger g = params.getG();

if (lSize <= 0) {
lSize = pSize >> 1;
// use an exponent size of (pSize / 2) but at least 384 bits
if (lSize < 384) {
lSize = 384;
}
int lSize = params.getL();
if (lSize == 0) { // not specified; use our own default
lSize = getDefDHPrivateExpSize(params);
}

BigInteger x;
Expand Down
Loading

0 comments on commit 8c0050a

Please sign in to comment.