Skip to content

Commit b4a67a6

Browse files
Merge in jdk-23+34 (24.1)
PullRequest: labsjdk-ce/100
2 parents 50e91e7 + 2f42f48 commit b4a67a6

File tree

40 files changed

+308
-124
lines changed

40 files changed

+308
-124
lines changed

src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,9 @@ static void set_serialized(const T* ptr) {
310310
assert(ptr != nullptr, "invariant");
311311
if (current_epoch()) {
312312
CLEAR_THIS_EPOCH_CLEARED_BIT(ptr);
313+
assert(!IS_THIS_EPOCH_CLEARED_BIT_SET(ptr), "invariant");
313314
}
315+
assert(IS_PREVIOUS_EPOCH_CLEARED_BIT_SET(ptr), "invariant");
314316
SET_SERIALIZED(ptr);
315317
assert(IS_SERIALIZED(ptr), "invariant");
316318
}
@@ -929,9 +931,11 @@ void set_serialized<Method>(MethodPtr method) {
929931
assert(method != nullptr, "invariant");
930932
if (current_epoch()) {
931933
CLEAR_THIS_EPOCH_METHOD_CLEARED_BIT(method);
934+
assert(!IS_THIS_EPOCH_METHOD_CLEARED_BIT_SET(method), "invariant");
932935
}
933936
assert(unloading() ? true : METHOD_IS_NOT_SERIALIZED(method), "invariant");
934937
SET_METHOD_SERIALIZED(method);
938+
assert(IS_PREVIOUS_EPOCH_METHOD_CLEARED_BIT_SET(method), "invariant");
935939
assert(METHOD_IS_SERIALIZED(method), "invariant");
936940
}
937941

src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ class ClearArtifact {
9696
assert(IS_NOT_TRANSIENT(value), "invariant");
9797
SET_PREVIOUS_EPOCH_CLEARED_BIT(value);
9898
CLEAR_PREVIOUS_EPOCH_METHOD_AND_CLASS(value);
99+
assert(IS_THIS_EPOCH_CLEARED_BIT_SET(value), "invariant");
100+
assert(IS_PREVIOUS_EPOCH_CLEARED_BIT_SET(value), "invariant");
99101
return true;
100102
}
101103
};
@@ -111,6 +113,8 @@ class ClearArtifact<const Method*> {
111113
assert(METHOD_IS_NOT_TRANSIENT(method), "invariant");
112114
SET_PREVIOUS_EPOCH_METHOD_CLEARED_BIT(method);
113115
CLEAR_PREVIOUS_EPOCH_METHOD_FLAG(method);
116+
assert(IS_THIS_EPOCH_METHOD_CLEARED_BIT_SET(method), "invariant");
117+
assert(IS_PREVIOUS_EPOCH_METHOD_CLEARED_BIT_SET(method), "invariant");
114118
return true;
115119
}
116120
};

src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2024, 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
@@ -50,22 +50,22 @@ static traceid atomic_inc(traceid volatile* const dest, traceid stride = 1) {
5050

5151
static traceid next_class_id() {
5252
static volatile traceid class_id_counter = LAST_TYPE_ID + 1; // + 1 is for the void.class primitive
53-
return atomic_inc(&class_id_counter) << TRACE_ID_SHIFT;
53+
return (atomic_inc(&class_id_counter) << TRACE_ID_SHIFT) | EPOCH_CLEARED_BITS;
5454
}
5555

5656
static traceid next_module_id() {
5757
static volatile traceid module_id_counter = 0;
58-
return atomic_inc(&module_id_counter) << TRACE_ID_SHIFT;
58+
return (atomic_inc(&module_id_counter) << TRACE_ID_SHIFT) | EPOCH_CLEARED_BITS;
5959
}
6060

6161
static traceid next_package_id() {
6262
static volatile traceid package_id_counter = 0;
63-
return atomic_inc(&package_id_counter) << TRACE_ID_SHIFT;
63+
return (atomic_inc(&package_id_counter) << TRACE_ID_SHIFT) | EPOCH_CLEARED_BITS;
6464
}
6565

6666
static traceid next_class_loader_data_id() {
6767
static volatile traceid cld_id_counter = 0;
68-
return atomic_inc(&cld_id_counter) << TRACE_ID_SHIFT;
68+
return (atomic_inc(&cld_id_counter) << TRACE_ID_SHIFT) | EPOCH_CLEARED_BITS;
6969
}
7070

7171
static bool found_jdk_internal_event_klass = false;
@@ -201,18 +201,18 @@ traceid JfrTraceId::load_raw(jclass jc) {
201201
// used by CDS / APPCDS as part of "remove_unshareable_info"
202202
void JfrTraceId::remove(const Klass* k) {
203203
assert(k != nullptr, "invariant");
204-
// Mask off and store the event flags.
204+
// Mask off and store the event flags and epoch clear bits.
205205
// This mechanism will retain the event specific flags
206206
// in the archive, allowing for event flag restoration
207207
// when renewing the traceid on klass revival.
208-
k->set_trace_id(EVENT_KLASS_MASK(k));
208+
k->set_trace_id(EPOCH_CLEARED_BITS | EVENT_KLASS_MASK(k));
209209
}
210210

211211
// used by CDS / APPCDS as part of "remove_unshareable_info"
212212
void JfrTraceId::remove(const Method* method) {
213213
assert(method != nullptr, "invariant");
214-
// Clear all bits.
215-
method->set_trace_flags(0);
214+
// Clear tag bits and set epoch cleared bits.
215+
method->set_trace_flags(static_cast<uint16_t>(EPOCH_CLEARED_BITS));
216216
}
217217

218218
// used by CDS / APPCDS as part of "restore_unshareable_info"

src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdLoadBarrier.inline.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ inline traceid JfrTraceIdLoadBarrier::load_leakp(const Klass* klass) {
157157

158158
inline traceid JfrTraceIdLoadBarrier::load_leakp(const Klass* klass, const Method* method) {
159159
assert(klass != nullptr, "invariant");
160-
assert(METHOD_AND_CLASS_USED_THIS_EPOCH(klass), "invariant");
161160
assert(method != nullptr, "invariant");
162161
assert(klass == method->method_holder(), "invariant");
162+
assert(METHOD_AND_CLASS_USED_THIS_EPOCH(klass), "invariant");
163163
if (should_tag(method)) {
164164
// the method is already logically tagged, just like the klass,
165165
// but because of redefinition, the latest Method*
@@ -174,9 +174,9 @@ inline traceid JfrTraceIdLoadBarrier::load_leakp(const Klass* klass, const Metho
174174

175175
inline traceid JfrTraceIdLoadBarrier::load_leakp_previuos_epoch(const Klass* klass, const Method* method) {
176176
assert(klass != nullptr, "invariant");
177-
assert(METHOD_AND_CLASS_USED_PREVIOUS_EPOCH(klass), "invariant");
178177
assert(method != nullptr, "invariant");
179178
assert(klass == method->method_holder(), "invariant");
179+
assert(METHOD_AND_CLASS_USED_PREVIOUS_EPOCH(klass), "invariant");
180180
if (METHOD_FLAG_NOT_USED_PREVIOUS_EPOCH(method)) {
181181
// the method is already logically tagged, just like the klass,
182182
// but because of redefinition, the latest Method*

src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2024, 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
@@ -48,6 +48,7 @@
4848
#define EPOCH_0_CLEARED_BIT (EPOCH_0_CLEARED_META_BIT << META_SHIFT)
4949
#define EPOCH_1_CLEARED_META_BIT (BIT << 1)
5050
#define EPOCH_1_CLEARED_BIT (EPOCH_1_CLEARED_META_BIT << META_SHIFT)
51+
#define EPOCH_CLEARED_BITS (EPOCH_1_CLEARED_BIT | EPOCH_0_CLEARED_BIT)
5152
#define LEAKP_META_BIT (BIT << 2)
5253
#define LEAKP_BIT (LEAKP_META_BIT << META_SHIFT)
5354
#define TRANSIENT_META_BIT (BIT << 3)
@@ -136,6 +137,8 @@
136137
#define IS_TRANSIENT(ptr) (TRACE_ID_PREDICATE(ptr, TRANSIENT_BIT))
137138
#define IS_NOT_TRANSIENT(ptr) (!(IS_TRANSIENT(ptr)))
138139
#define SET_SERIALIZED(ptr) (TRACE_ID_META_TAG(ptr, SERIALIZED_META_BIT))
140+
#define IS_THIS_EPOCH_CLEARED_BIT_SET(ptr) (TRACE_ID_PREDICATE(ptr, (THIS_EPOCH_BIT << META_SHIFT)))
141+
#define IS_PREVIOUS_EPOCH_CLEARED_BIT_SET(ptr) (TRACE_ID_PREDICATE(ptr, (PREVIOUS_EPOCH_BIT << META_SHIFT)))
139142
#define IS_SERIALIZED(ptr) (TRACE_ID_PREDICATE(ptr, SERIALIZED_BIT))
140143
#define IS_NOT_SERIALIZED(ptr) (!(IS_SERIALIZED(ptr)))
141144
#define SHOULD_TAG(ptr) (NOT_USED_THIS_EPOCH(ptr))
@@ -161,5 +164,7 @@
161164
#define CLEAR_THIS_EPOCH_METHOD_CLEARED_BIT(ptr) (METHOD_META_MASK_CLEAR(ptr,(~(THIS_EPOCH_BIT))))
162165
#define IS_THIS_EPOCH_METHOD_CLEARED(ptr) (METHOD_FLAG_PREDICATE(method, THIS_EPOCH_BIT))
163166
#define IS_PREVIOUS_EPOCH_METHOD_CLEARED(ptr) (METHOD_FLAG_PREDICATE(method, PREVIOUS_EPOCH_BIT))
167+
#define IS_THIS_EPOCH_METHOD_CLEARED_BIT_SET(ptr) (METHOD_FLAG_PREDICATE(ptr, (THIS_EPOCH_BIT << META_SHIFT)))
168+
#define IS_PREVIOUS_EPOCH_METHOD_CLEARED_BIT_SET(ptr) (METHOD_FLAG_PREDICATE(ptr, (PREVIOUS_EPOCH_BIT << META_SHIFT)))
164169

165170
#endif // SHARE_JFR_RECORDER_CHECKPOINT_TYPES_TRACEID_JFRTRACEIDMACROS_HPP

src/hotspot/share/jfr/support/jfrTraceIdExtension.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@
4444
#define REMOVE_METHOD_ID(method) JfrTraceId::remove(method);
4545
#define RESTORE_ID(k) JfrTraceId::restore(k);
4646

47+
static constexpr const uint16_t cleared_epoch_bits = 512 | 256;
48+
4749
class JfrTraceFlag {
4850
private:
4951
mutable uint16_t _flags;
5052
public:
51-
JfrTraceFlag() : _flags(0) {}
53+
JfrTraceFlag() : _flags(cleared_epoch_bits) {}
5254
bool is_set(uint16_t flag) const {
5355
return (_flags & flag) != 0;
5456
}
@@ -96,9 +98,8 @@ class JfrTraceFlag {
9698
uint8_t* trace_meta_addr() const { \
9799
return _trace_flags.meta_addr(); \
98100
} \
99-
void copy_trace_flags(uint8_t src_flags) const { \
100-
uint8_t flags = *_trace_flags.flags_addr(); \
101-
_trace_flags.set_flags(flags | src_flags); \
101+
void copy_trace_flags(uint16_t rhs_flags) const { \
102+
_trace_flags.set_flags(_trace_flags.flags() | rhs_flags); \
102103
}
103104

104105
#endif // SHARE_JFR_SUPPORT_JFRTRACEIDEXTENSION_HPP

src/hotspot/share/prims/jvmtiRedefineClasses.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ jvmtiError VM_RedefineClasses::compare_and_normalize_class_versions(
11741174
}
11751175
}
11761176
}
1177-
JFR_ONLY(k_new_method->copy_trace_flags(*k_old_method->trace_flags_addr());)
1177+
JFR_ONLY(k_new_method->copy_trace_flags(k_old_method->trace_flags());)
11781178
log_trace(redefine, class, normalize)
11791179
("Method matched: new: %s [%d] == old: %s [%d]",
11801180
k_new_method->name_and_sig_as_C_string(), ni, k_old_method->name_and_sig_as_C_string(), oi);

src/java.base/share/man/java.1

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
. ftr VB CB
3737
. ftr VBI CBI
3838
.\}
39-
.TH "JAVA" "1" "2024" "JDK 23-ea" "JDK Commands"
39+
.TH "JAVA" "1" "2024" "JDK 23" "JDK Commands"
4040
.hy
4141
.SH NAME
4242
.PP
@@ -1195,7 +1195,7 @@ or directories.
11951195
\f[V]--source\f[R] \f[I]version\f[R]
11961196
Sets the version of the source in source-file mode.
11971197
.TP
1198-
\f[V]--sun-misc-unsafe-memory-acces=\f[R] \f[I]value\f[R]
1198+
\f[V]--sun-misc-unsafe-memory-access=\f[R] \f[I]value\f[R]
11991199
Allow or deny usage of unsupported API \f[V]sun.misc.Unsafe\f[R].
12001200
\f[I]value\f[R] is one of:
12011201
.RS
@@ -3491,16 +3491,6 @@ By default, this option is disabled.
34913491
Enables printing of information about adaptive-generation sizing.
34923492
By default, this option is disabled.
34933493
.TP
3494-
\f[V]-XX:+ScavengeBeforeFullGC\f[R]
3495-
Enables GC of the young generation before each full GC.
3496-
This option is enabled by default.
3497-
It is recommended that you \f[I]don\[aq]t\f[R] disable it, because
3498-
scavenging the young generation before a full GC can reduce the number
3499-
of objects reachable from the old generation space into the young
3500-
generation space.
3501-
To disable GC of the young generation before each full GC, specify the
3502-
option \f[V]-XX:-ScavengeBeforeFullGC\f[R].
3503-
.TP
35043494
\f[V]-XX:SoftRefLRUPolicyMSPerMB=\f[R]\f[I]time\f[R]
35053495
Sets the amount of time (in milliseconds) a softly reachable object is
35063496
kept active on the heap after the last time it was referenced.
@@ -3755,45 +3745,6 @@ Enables the use of Java Flight Recorder (JFR) during the runtime of the
37553745
application.
37563746
Since JDK 8u40 this option has not been required to use JFR.
37573747
.TP
3758-
\f[V]-XX:InitialRAMFraction=\f[R]\f[I]ratio\f[R]
3759-
Sets the initial amount of memory that the JVM may use for the Java heap
3760-
before applying ergonomics heuristics as a ratio of the maximum amount
3761-
determined as described in the \f[V]-XX:MaxRAM\f[R] option.
3762-
The default value is 64.
3763-
.RS
3764-
.PP
3765-
Use the option \f[V]-XX:InitialRAMPercentage\f[R] instead.
3766-
.RE
3767-
.TP
3768-
\f[V]-XX:MaxRAMFraction=\f[R]\f[I]ratio\f[R]
3769-
Sets the maximum amount of memory that the JVM may use for the Java heap
3770-
before applying ergonomics heuristics as a fraction of the maximum
3771-
amount determined as described in the \f[V]-XX:MaxRAM\f[R] option.
3772-
The default value is 4.
3773-
.RS
3774-
.PP
3775-
Specifying this option disables automatic use of compressed oops if the
3776-
combined result of this and other options influencing the maximum amount
3777-
of memory is larger than the range of memory addressable by compressed
3778-
oops.
3779-
See \f[V]-XX:UseCompressedOops\f[R] for further information about
3780-
compressed oops.
3781-
.PP
3782-
Use the option \f[V]-XX:MaxRAMPercentage\f[R] instead.
3783-
.RE
3784-
.TP
3785-
\f[V]-XX:MinRAMFraction=\f[R]\f[I]ratio\f[R]
3786-
Sets the maximum amount of memory that the JVM may use for the Java heap
3787-
before applying ergonomics heuristics as a fraction of the maximum
3788-
amount determined as described in the \f[V]-XX:MaxRAM\f[R] option for
3789-
small heaps.
3790-
A small heap is a heap of approximately 125 MB.
3791-
The default value is 2.
3792-
.RS
3793-
.PP
3794-
Use the option \f[V]-XX:MinRAMPercentage\f[R] instead.
3795-
.RE
3796-
.TP
37973748
\f[V]-XX:RTMAbortRatio=\f[R]\f[I]abort_ratio\f[R]
37983749
Specifies the RTM abort ratio is specified as a percentage (%) of all
37993750
executed RTM transactions.
@@ -3882,6 +3833,55 @@ Controlled \f[I]relaxed strong encapsulation\f[R], as defined in
38823833
This option was deprecated in JDK 16 by \f[B]JEP 396\f[R]
38833834
[https://openjdk.org/jeps/396] and made obsolete in JDK 17 by \f[B]JEP
38843835
403\f[R] [https://openjdk.org/jeps/403].
3836+
.TP
3837+
\f[V]-XX:+ScavengeBeforeFullGC\f[R]
3838+
Enables GC of the young generation before each full GC.
3839+
This option is enabled by default.
3840+
It is recommended that you \f[I]don\[aq]t\f[R] disable it, because
3841+
scavenging the young generation before a full GC can reduce the number
3842+
of objects reachable from the old generation space into the young
3843+
generation space.
3844+
To disable GC of the young generation before each full GC, specify the
3845+
option \f[V]-XX:-ScavengeBeforeFullGC\f[R].
3846+
.TP
3847+
\f[V]-XX:InitialRAMFraction=\f[R]\f[I]ratio\f[R]
3848+
Sets the initial amount of memory that the JVM may use for the Java heap
3849+
before applying ergonomics heuristics as a ratio of the maximum amount
3850+
determined as described in the \f[V]-XX:MaxRAM\f[R] option.
3851+
The default value is 64.
3852+
.RS
3853+
.PP
3854+
Use the option \f[V]-XX:InitialRAMPercentage\f[R] instead.
3855+
.RE
3856+
.TP
3857+
\f[V]-XX:MaxRAMFraction=\f[R]\f[I]ratio\f[R]
3858+
Sets the maximum amount of memory that the JVM may use for the Java heap
3859+
before applying ergonomics heuristics as a fraction of the maximum
3860+
amount determined as described in the \f[V]-XX:MaxRAM\f[R] option.
3861+
The default value is 4.
3862+
.RS
3863+
.PP
3864+
Specifying this option disables automatic use of compressed oops if the
3865+
combined result of this and other options influencing the maximum amount
3866+
of memory is larger than the range of memory addressable by compressed
3867+
oops.
3868+
See \f[V]-XX:UseCompressedOops\f[R] for further information about
3869+
compressed oops.
3870+
.PP
3871+
Use the option \f[V]-XX:MaxRAMPercentage\f[R] instead.
3872+
.RE
3873+
.TP
3874+
\f[V]-XX:MinRAMFraction=\f[R]\f[I]ratio\f[R]
3875+
Sets the maximum amount of memory that the JVM may use for the Java heap
3876+
before applying ergonomics heuristics as a fraction of the maximum
3877+
amount determined as described in the \f[V]-XX:MaxRAM\f[R] option for
3878+
small heaps.
3879+
A small heap is a heap of approximately 125 MB.
3880+
The default value is 2.
3881+
.RS
3882+
.PP
3883+
Use the option \f[V]-XX:MinRAMPercentage\f[R] instead.
3884+
.RE
38853885
.SH REMOVED JAVA OPTIONS
38863886
.PP
38873887
These \f[V]java\f[R] options have been removed in JDK 23 and using them

src/java.base/share/man/keytool.1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.\" Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
1+
.\" Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
22
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
.\"
44
.\" This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,7 @@
3636
. ftr VB CB
3737
. ftr VBI CBI
3838
.\}
39-
.TH "KEYTOOL" "1" "2024" "JDK 23-ea" "JDK Commands"
39+
.TH "KEYTOOL" "1" "2024" "JDK 23" "JDK Commands"
4040
.hy
4141
.SH NAME
4242
.PP
@@ -1747,7 +1747,7 @@ risk.
17471747
The \f[V]keytool\f[R] command supports these named extensions.
17481748
The names aren\[aq]t case-sensitive.
17491749
.TP
1750-
\f[V]BC\f[R] or \f[V]BasicContraints\f[R]
1750+
\f[V]BC\f[R] or \f[V]BasicConstraints\f[R]
17511751
Values:
17521752
.RS
17531753
.PP

src/java.rmi/share/man/rmiregistry.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
. ftr VB CB
3636
. ftr VBI CBI
3737
.\}
38-
.TH "RMIREGISTRY" "1" "2024" "JDK 23-ea" "JDK Commands"
38+
.TH "RMIREGISTRY" "1" "2024" "JDK 23" "JDK Commands"
3939
.hy
4040
.SH NAME
4141
.PP

0 commit comments

Comments
 (0)