Skip to content

Commit 27ea326

Browse files
[GR-63602] Merge in jdk-24.0.2+4 (24.2)
PullRequest: labsjdk-ce/170
2 parents 34ce338 + bcdf655 commit 27ea326

File tree

36 files changed

+414
-295
lines changed

36 files changed

+414
-295
lines changed
Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#!/bin/sh
2-
31
#
4-
# Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
53
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
64
#
75
# This code is free software; you can redistribute it and/or modify it
86
# under the terms of the GNU General Public License version 2 only, as
9-
# published by the Free Software Foundation.
7+
# published by the Free Software Foundation. Oracle designates this
8+
# particular file as subject to the "Classpath" exception as provided
9+
# by Oracle in the LICENSE file that accompanied this code.
1010
#
1111
# This code is distributed in the hope that it will be useful, but WITHOUT
1212
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@@ -23,44 +23,10 @@
2323
# questions.
2424
#
2525

26+
################################################################################
2627

27-
# @test
28-
# @bug 4944382
29-
# @summary make sure we do not deadlock loading signed JAR with getInstance()
30-
# @author Andreas Sterbenz
31-
# @build Deadlock
32-
# @run shell/timeout=30 Deadlock.sh
33-
34-
# set platform-dependent variables
35-
OS=`uname -s`
36-
case "$OS" in
37-
Linux )
38-
PATHSEP=":"
39-
FILESEP="/"
40-
;;
41-
Darwin )
42-
PATHSEP=":"
43-
FILESEP="/"
44-
;;
45-
AIX )
46-
PATHSEP=":"
47-
FILESEP="/"
48-
;;
49-
CYGWIN* )
50-
PATHSEP=";"
51-
FILESEP="/"
52-
;;
53-
Windows* )
54-
PATHSEP=";"
55-
FILESEP="\\"
56-
;;
57-
* )
58-
echo "Unrecognized system!"
59-
exit 1;
60-
;;
61-
esac
62-
63-
JAVA="${TESTJAVA}${FILESEP}bin${FILESEP}java"
64-
65-
${JAVA} ${TESTVMOPTS} ${TESTJAVAOPTS} -cp "${TESTCLASSES}${PATHSEP}${TESTSRC}${FILESEP}Deadlock.jar" Deadlock
28+
# Instruct SetupJavaCompilation for the jdk.jlink module to include
29+
# upgrade_files_<module-name>.conf files
30+
COPY += .conf
6631

32+
################################################################################

src/hotspot/share/runtime/os.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2532,7 +2532,7 @@ char* os::build_agent_function_name(const char *sym_name, const char *lib_name,
25322532
if ((start = strrchr(lib_name, *os::file_separator())) != nullptr) {
25332533
lib_name = ++start;
25342534
}
2535-
#ifdef WINDOWS
2535+
#ifdef _WINDOWS
25362536
else { // Need to check for drive prefix e.g. C:L.dll
25372537
if ((start = strchr(lib_name, ':')) != nullptr) {
25382538
lib_name = ++start;

src/hotspot/share/runtime/safepoint.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,8 @@ void SafepointSynchronize::disarm_safepoint() {
472472
// operation has been carried out
473473
void SafepointSynchronize::end() {
474474
assert(Threads_lock->owned_by_self(), "must hold Threads_lock");
475+
SafepointTracing::leave();
476+
475477
EventSafepointEnd event;
476478
assert(Thread::current()->is_VM_thread(), "Only VM thread can execute a safepoint");
477479

@@ -866,6 +868,7 @@ void ThreadSafepointState::handle_polling_page_exception() {
866868

867869
jlong SafepointTracing::_last_safepoint_begin_time_ns = 0;
868870
jlong SafepointTracing::_last_safepoint_sync_time_ns = 0;
871+
jlong SafepointTracing::_last_safepoint_leave_time_ns = 0;
869872
jlong SafepointTracing::_last_safepoint_end_time_ns = 0;
870873
jlong SafepointTracing::_last_app_time_ns = 0;
871874
int SafepointTracing::_nof_threads = 0;
@@ -967,6 +970,10 @@ void SafepointTracing::synchronized(int nof_threads, int nof_running, int traps)
967970
RuntimeService::record_safepoint_synchronized(_last_safepoint_sync_time_ns - _last_safepoint_begin_time_ns);
968971
}
969972

973+
void SafepointTracing::leave() {
974+
_last_safepoint_leave_time_ns = os::javaTimeNanos();
975+
}
976+
970977
void SafepointTracing::end() {
971978
_last_safepoint_end_time_ns = os::javaTimeNanos();
972979

@@ -985,12 +992,14 @@ void SafepointTracing::end() {
985992
"Time since last: " JLONG_FORMAT " ns, "
986993
"Reaching safepoint: " JLONG_FORMAT " ns, "
987994
"At safepoint: " JLONG_FORMAT " ns, "
995+
"Leaving safepoint: " JLONG_FORMAT " ns, "
988996
"Total: " JLONG_FORMAT " ns",
989997
VM_Operation::name(_current_type),
990998
_last_app_time_ns,
991-
_last_safepoint_sync_time_ns - _last_safepoint_begin_time_ns,
992-
_last_safepoint_end_time_ns - _last_safepoint_sync_time_ns,
993-
_last_safepoint_end_time_ns - _last_safepoint_begin_time_ns
999+
_last_safepoint_sync_time_ns - _last_safepoint_begin_time_ns,
1000+
_last_safepoint_leave_time_ns - _last_safepoint_sync_time_ns,
1001+
_last_safepoint_end_time_ns - _last_safepoint_leave_time_ns,
1002+
_last_safepoint_end_time_ns - _last_safepoint_begin_time_ns
9941003
);
9951004

9961005
RuntimeService::record_safepoint_end(_last_safepoint_end_time_ns - _last_safepoint_sync_time_ns);

src/hotspot/share/runtime/safepoint.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ class SafepointTracing : public AllStatic {
230230
// Absolute
231231
static jlong _last_safepoint_begin_time_ns;
232232
static jlong _last_safepoint_sync_time_ns;
233+
static jlong _last_safepoint_leave_time_ns;
233234
static jlong _last_safepoint_end_time_ns;
234235

235236
// Relative
@@ -251,6 +252,7 @@ class SafepointTracing : public AllStatic {
251252

252253
static void begin(VM_Operation::VMOp_Type type);
253254
static void synchronized(int nof_threads, int nof_running, int traps);
255+
static void leave();
254256
static void end();
255257

256258
static void statistics_exit_log();

src/hotspot/share/utilities/growableArray.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ void* GrowableArrayArenaAllocator::allocate(int max, int element_size, Arena* ar
4444

4545
void* GrowableArrayCHeapAllocator::allocate(int max, int element_size, MemTag mem_tag) {
4646
assert(max >= 0, "integer overflow");
47+
48+
if (max == 0) {
49+
return nullptr;
50+
}
51+
4752
size_t byte_size = element_size * (size_t) max;
4853

4954
// memory tag has to be specified for C heap allocation

src/hotspot/share/utilities/growableArray.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -811,10 +811,6 @@ class GrowableArrayCHeap : public GrowableArrayWithAllocator<E, GrowableArrayCHe
811811
STATIC_ASSERT(MT != mtNone);
812812

813813
static E* allocate(int max, MemTag mem_tag) {
814-
if (max == 0) {
815-
return nullptr;
816-
}
817-
818814
return (E*)GrowableArrayCHeapAllocator::allocate(max, sizeof(E), mem_tag);
819815
}
820816

src/java.base/share/classes/java/util/jar/Attributes.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -727,6 +727,7 @@ private static void addName(Map<String, Name> names, Name name) {
727727
addName(names, new Name("Created-By"));
728728
addName(names, new Name("SHA1-Digest"));
729729
addName(names, new Name("SHA-256-Digest"));
730+
addName(names, new Name("SHA-384-Digest"));
730731
KNOWN_NAMES = Map.copyOf(names);
731732
} else {
732733
// Even if KNOWN_NAMES was read from archive, we still need

src/java.base/share/classes/sun/net/ftp/impl/FtpClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2238,3 +2238,4 @@ public sun.net.ftp.FtpClient siteCmd(String cmd) throws sun.net.ftp.FtpProtocolE
22382238
return this;
22392239
}
22402240
}
2241+

src/java.base/share/classes/sun/net/www/http/HttpClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,3 +1142,4 @@ public final void unlock() {
11421142
clientLock.unlock();
11431143
}
11441144
}
1145+

src/java.base/share/classes/sun/net/www/protocol/ftp/FtpURLConnection.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,3 +659,4 @@ public int getReadTimeout() {
659659
return readTimeout < 0 ? 0 : readTimeout;
660660
}
661661
}
662+

0 commit comments

Comments
 (0)