Skip to content

Commit 78201b4

Browse files
authored
Merge pull request #2147 from SAP/pr-jdk-26+29
Merge to tag jdk-26+29
2 parents 69df4ff + 509ca63 commit 78201b4

File tree

74 files changed

+1353
-470
lines changed

Some content is hidden

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

74 files changed

+1353
-470
lines changed

src/hotspot/share/cds/aotMetaspace.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
#include "runtime/vmOperations.hpp"
9797
#include "runtime/vmThread.hpp"
9898
#include "sanitizers/leak.hpp"
99+
#include "services/management.hpp"
99100
#include "utilities/align.hpp"
100101
#include "utilities/bitMap.inline.hpp"
101102
#include "utilities/defaultStream.hpp"

src/hotspot/share/classfile/resolutionErrors.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,8 @@ ResolutionErrorEntry::~ResolutionErrorEntry() {
127127
}
128128

129129
void ResolutionErrorEntry::set_nest_host_error(const char* message) {
130-
// If a message is already set, free it.
131-
if (nest_host_error() != nullptr) {
132-
FREE_C_HEAP_ARRAY(char, _nest_host_error);
133-
}
130+
assert(_nest_host_error == nullptr, "caller should have checked");
131+
assert_lock_strong(SystemDictionary_lock);
134132
_nest_host_error = message;
135133
}
136134

src/hotspot/share/classfile/systemDictionary.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,7 +1859,7 @@ Symbol* SystemDictionary::find_resolution_error(const constantPoolHandle& pool,
18591859

18601860
void SystemDictionary::add_nest_host_error(const constantPoolHandle& pool,
18611861
int which,
1862-
const char* message) {
1862+
const stringStream& message) {
18631863
{
18641864
MutexLocker ml(Thread::current(), SystemDictionary_lock);
18651865
ResolutionErrorEntry* entry = ResolutionErrorTable::find_entry(pool, which);
@@ -1868,14 +1868,19 @@ void SystemDictionary::add_nest_host_error(const constantPoolHandle& pool,
18681868
// constant pool index. In this case resolution succeeded but there's an error in this nest host
18691869
// that we use the table to record.
18701870
assert(pool->resolved_klass_at(which) != nullptr, "klass should be resolved if there is no entry");
1871-
ResolutionErrorTable::add_entry(pool, which, message);
1871+
ResolutionErrorTable::add_entry(pool, which, message.as_string(true /* on C-heap */));
18721872
} else {
18731873
// An existing entry means we had a true resolution failure (LinkageError) with our nest host, but we
18741874
// still want to add the error message for the higher-level access checks to report. We should
18751875
// only reach here under the same error condition, so we can ignore the potential race with setting
1876-
// the message, and set it again.
1877-
assert(entry->nest_host_error() == nullptr || strcmp(entry->nest_host_error(), message) == 0, "should be the same message");
1878-
entry->set_nest_host_error(message);
1876+
// the message.
1877+
const char* nhe = entry->nest_host_error();
1878+
if (nhe == nullptr) {
1879+
entry->set_nest_host_error(message.as_string(true /* on C-heap */));
1880+
} else {
1881+
DEBUG_ONLY(const char* msg = message.base();)
1882+
assert(strcmp(nhe, msg) == 0, "New message %s, differs from original %s", msg, nhe);
1883+
}
18791884
}
18801885
}
18811886
}

src/hotspot/share/classfile/systemDictionary.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ class SystemDictionary : AllStatic {
280280

281281
// Record a nest host resolution/validation error
282282
static void add_nest_host_error(const constantPoolHandle& pool, int which,
283-
const char* message);
283+
const stringStream& message);
284284
static const char* find_nest_host_error(const constantPoolHandle& pool, int which);
285285

286286
static void add_to_initiating_loader(JavaThread* current, InstanceKlass* k,

src/hotspot/share/include/jvm.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ JVM_InternString(JNIEnv *env, jstring str);
8787
/*
8888
* java.lang.System
8989
*/
90+
JNIEXPORT jboolean JNICALL
91+
JVM_AOTEndRecording(JNIEnv *env);
92+
9093
JNIEXPORT jlong JNICALL
9194
JVM_CurrentTimeMillis(JNIEnv *env, jclass ignored);
9295

src/hotspot/share/oops/instanceKlass.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,11 @@ InstanceKlass* InstanceKlass::nest_host(TRAPS) {
312312
ss.print("Nest host resolution of %s with host %s failed: ",
313313
this->external_name(), target_host_class);
314314
java_lang_Throwable::print(PENDING_EXCEPTION, &ss);
315-
const char* msg = ss.as_string(true /* on C-heap */);
316315
constantPoolHandle cph(THREAD, constants());
317-
SystemDictionary::add_nest_host_error(cph, _nest_host_index, msg);
316+
SystemDictionary::add_nest_host_error(cph, _nest_host_index, ss);
318317
CLEAR_PENDING_EXCEPTION;
319318

320-
log_trace(class, nestmates)("%s", msg);
319+
log_trace(class, nestmates)("%s", ss.base());
321320
} else {
322321
// A valid nest-host is an instance class in the current package that lists this
323322
// class as a nest member. If any of these conditions are not met the class is
@@ -356,10 +355,9 @@ InstanceKlass* InstanceKlass::nest_host(TRAPS) {
356355
k->external_name(),
357356
k->class_loader_data()->loader_name_and_id(),
358357
error);
359-
const char* msg = ss.as_string(true /* on C-heap */);
360358
constantPoolHandle cph(THREAD, constants());
361-
SystemDictionary::add_nest_host_error(cph, _nest_host_index, msg);
362-
log_trace(class, nestmates)("%s", msg);
359+
SystemDictionary::add_nest_host_error(cph, _nest_host_index, ss);
360+
log_trace(class, nestmates)("%s", ss.base());
363361
}
364362
}
365363
} else {

src/hotspot/share/prims/jvm.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,19 @@ extern void trace_class_resolution(Klass* to_class) {
229229

230230
// java.lang.System //////////////////////////////////////////////////////////////////////
231231

232+
JVM_ENTRY(jboolean, JVM_AOTEndRecording(JNIEnv *env))
233+
#if INCLUDE_CDS
234+
if (CDSConfig::is_dumping_preimage_static_archive()) {
235+
if (!AOTMetaspace::preimage_static_archive_dumped()) {
236+
AOTMetaspace::dump_static_archive(THREAD);
237+
return JNI_TRUE;
238+
}
239+
}
240+
return JNI_FALSE;
241+
#else
242+
return JNI_FALSE;
243+
#endif // INCLUDE_CDS
244+
JVM_END
232245

233246
JVM_LEAF(jlong, JVM_CurrentTimeMillis(JNIEnv *env, jclass ignored))
234247
return os::javaTimeMillis();

src/hotspot/share/runtime/mountUnmountDisabler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ MountUnmountDisabler::enable_transition_for_all() {
367367
OrderAccess::release();
368368

369369
MonitorLocker ml(VThreadTransition_lock);
370-
if (exclusive_operation_ongoing()) {
370+
if (_is_exclusive) {
371371
set_exclusive_operation_ongoing(false);
372372
}
373373
dec_active_disablers();

src/java.base/share/classes/java/util/UUID.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,11 @@
3232
import jdk.internal.util.ByteArrayLittleEndian;
3333

3434
/**
35-
* A class that represents an immutable universally unique identifier (UUID).
35+
* A class that represents an immutable Universally Unique IDentifier (UUID).
3636
* A UUID represents a 128-bit value.
3737
*
38-
* <p> There exist different variants of these global identifiers. The methods
39-
* of this class are for manipulating the Leach-Salz variant, although the
40-
* constructors allow the creation of any variant of UUID (described below).
38+
* <p> This class is primarily designed for manipulating Leach-Salz variant UUIDs,
39+
* but it also supports the creation of UUIDs of other variants.
4140
*
4241
* <p> The layout of a variant 2 (Leach-Salz) UUID is as follows:
4342
*

src/java.base/share/classes/sun/launcher/resources/launcher_de.properties

Lines changed: 3 additions & 2 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)