Skip to content

Commit bc22820

Browse files
Merge tag 'jdk-24+30' into ola/24.2_jdk-24+30
Added tag jdk-24+30 for changeset 4254e99
2 parents 1ad8aea + 4254e99 commit bc22820

File tree

76 files changed

+3507
-300
lines changed

Some content is hidden

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

76 files changed

+3507
-300
lines changed

src/hotspot/cpu/riscv/vm_version_riscv.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,6 @@ void VM_Version::common_initialize() {
154154
unaligned_access.value() != MISALIGNED_FAST);
155155
}
156156

157-
if (FLAG_IS_DEFAULT(AlignVector)) {
158-
FLAG_SET_DEFAULT(AlignVector, AvoidUnalignedAccesses);
159-
}
160-
161157
// See JDK-8026049
162158
// This machine has fast unaligned memory accesses
163159
if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) {
@@ -440,6 +436,10 @@ void VM_Version::c2_initialize() {
440436
warning("AES/CTR intrinsics are not available on this CPU");
441437
FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false);
442438
}
439+
440+
if (FLAG_IS_DEFAULT(AlignVector)) {
441+
FLAG_SET_DEFAULT(AlignVector, AvoidUnalignedAccesses);
442+
}
443443
}
444444

445445
#endif // COMPILER2

src/hotspot/cpu/s390/vm_version_s390.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,12 @@ void VM_Version::initialize() {
308308
if (FLAG_IS_DEFAULT(UseMontgomerySquareIntrinsic)) {
309309
FLAG_SET_DEFAULT(UseMontgomerySquareIntrinsic, true);
310310
}
311+
312+
// The OptoScheduling information is not maintained in s390.ad.
313+
if (OptoScheduling) {
314+
warning("OptoScheduling is not supported on this CPU.");
315+
FLAG_SET_DEFAULT(OptoScheduling, false);
316+
}
311317
#endif
312318
if (FLAG_IS_DEFAULT(UsePopCountInstruction)) {
313319
FLAG_SET_DEFAULT(UsePopCountInstruction, true);
@@ -323,12 +329,6 @@ void VM_Version::initialize() {
323329
if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) {
324330
FLAG_SET_DEFAULT(UseUnalignedAccesses, true);
325331
}
326-
327-
// The OptoScheduling information is not maintained in s390.ad.
328-
if (OptoScheduling) {
329-
warning("OptoScheduling is not supported on this CPU.");
330-
FLAG_SET_DEFAULT(OptoScheduling, false);
331-
}
332332
}
333333

334334

src/hotspot/share/runtime/continuation.cpp

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -60,41 +60,41 @@ JVM_END
6060
#if INCLUDE_JVMTI
6161
class JvmtiUnmountBeginMark : public StackObj {
6262
Handle _vthread;
63-
JavaThread* _target;
63+
JavaThread* _current;
6464
freeze_result _result;
6565
bool _failed;
6666

6767
public:
6868
JvmtiUnmountBeginMark(JavaThread* t) :
69-
_vthread(t, t->vthread()), _target(t), _result(freeze_pinned_native), _failed(false) {
70-
assert(!_target->is_in_VTMS_transition(), "must be");
69+
_vthread(t, t->vthread()), _current(t), _result(freeze_pinned_native), _failed(false) {
70+
assert(!_current->is_in_VTMS_transition(), "must be");
7171

7272
if (JvmtiVTMSTransitionDisabler::VTMS_notify_jvmti_events()) {
7373
JvmtiVTMSTransitionDisabler::VTMS_vthread_unmount((jthread)_vthread.raw_value(), true);
7474

7575
// Don't preempt if there is a pending popframe or earlyret operation. This can
7676
// be installed in start_VTMS_transition() so we need to check it here.
7777
if (JvmtiExport::can_pop_frame() || JvmtiExport::can_force_early_return()) {
78-
JvmtiThreadState* state = _target->jvmti_thread_state();
79-
if (_target->has_pending_popframe() || (state != nullptr && state->is_earlyret_pending())) {
78+
JvmtiThreadState* state = _current->jvmti_thread_state();
79+
if (_current->has_pending_popframe() || (state != nullptr && state->is_earlyret_pending())) {
8080
_failed = true;
8181
}
8282
}
8383

8484
// Don't preempt in case there is an async exception installed since
8585
// we would incorrectly throw it during the unmount logic in the carrier.
86-
if (_target->has_async_exception_condition()) {
86+
if (_current->has_async_exception_condition()) {
8787
_failed = true;
8888
}
8989
} else {
90-
_target->set_is_in_VTMS_transition(true);
90+
_current->set_is_in_VTMS_transition(true);
9191
java_lang_Thread::set_is_in_VTMS_transition(_vthread(), true);
9292
}
9393
}
9494
~JvmtiUnmountBeginMark() {
95-
assert(!_target->is_suspended(), "must be");
95+
assert(!_current->is_suspended(), "must be");
9696

97-
assert(_target->is_in_VTMS_transition(), "must be");
97+
assert(_current->is_in_VTMS_transition(), "must be");
9898
assert(java_lang_Thread::is_in_VTMS_transition(_vthread()), "must be");
9999

100100
// Read it again since for late binding agents the flag could have
@@ -106,7 +106,7 @@ class JvmtiUnmountBeginMark : public StackObj {
106106
if (jvmti_present) {
107107
JvmtiVTMSTransitionDisabler::VTMS_vthread_mount((jthread)_vthread.raw_value(), false);
108108
} else {
109-
_target->set_is_in_VTMS_transition(false);
109+
_current->set_is_in_VTMS_transition(false);
110110
java_lang_Thread::set_is_in_VTMS_transition(_vthread(), false);
111111
}
112112
}
@@ -115,51 +115,59 @@ class JvmtiUnmountBeginMark : public StackObj {
115115
bool failed() { return _failed; }
116116
};
117117

118-
static bool is_vthread_safe_to_preempt_for_jvmti(JavaThread* target) {
119-
if (target->is_in_VTMS_transition()) {
120-
// We caught target at the end of a mount transition.
118+
static bool is_vthread_safe_to_preempt_for_jvmti(JavaThread* current) {
119+
if (current->is_in_VTMS_transition()) {
120+
// We are at the end of a mount transition.
121121
return false;
122122
}
123123
return true;
124124
}
125125
#endif // INCLUDE_JVMTI
126126

127-
static bool is_vthread_safe_to_preempt(JavaThread* target, oop vthread) {
127+
static bool is_vthread_safe_to_preempt(JavaThread* current, oop vthread) {
128128
assert(java_lang_VirtualThread::is_instance(vthread), "");
129129
if (java_lang_VirtualThread::state(vthread) != java_lang_VirtualThread::RUNNING) { // inside transition
130130
return false;
131131
}
132-
return JVMTI_ONLY(is_vthread_safe_to_preempt_for_jvmti(target)) NOT_JVMTI(true);
132+
return JVMTI_ONLY(is_vthread_safe_to_preempt_for_jvmti(current)) NOT_JVMTI(true);
133133
}
134134

135135
typedef freeze_result (*FreezeContFnT)(JavaThread*, intptr_t*);
136136

137-
static void verify_preempt_preconditions(JavaThread* target, oop continuation) {
138-
assert(target == JavaThread::current(), "no support for external preemption");
139-
assert(target->has_last_Java_frame(), "");
140-
assert(!target->preempting(), "");
141-
assert(target->last_continuation() != nullptr, "");
142-
assert(target->last_continuation()->cont_oop(target) == continuation, "");
137+
static void verify_preempt_preconditions(JavaThread* current, oop continuation) {
138+
assert(current == JavaThread::current(), "no support for external preemption");
139+
assert(current->has_last_Java_frame(), "");
140+
assert(!current->preempting(), "");
141+
assert(current->last_continuation() != nullptr, "");
142+
assert(current->last_continuation()->cont_oop(current) == continuation, "");
143143
assert(Continuation::continuation_scope(continuation) == java_lang_VirtualThread::vthread_scope(), "");
144-
assert(!target->has_pending_exception(), "");
144+
assert(!current->has_pending_exception(), "");
145145
}
146146

147-
freeze_result Continuation::try_preempt(JavaThread* target, oop continuation) {
148-
verify_preempt_preconditions(target, continuation);
147+
freeze_result Continuation::try_preempt(JavaThread* current, oop continuation) {
148+
verify_preempt_preconditions(current, continuation);
149149

150150
if (LockingMode == LM_LEGACY) {
151151
return freeze_unsupported;
152152
}
153153

154-
if (!is_vthread_safe_to_preempt(target, target->vthread())) {
154+
if (!is_vthread_safe_to_preempt(current, current->vthread())) {
155155
return freeze_pinned_native;
156156
}
157157

158-
JVMTI_ONLY(JvmtiUnmountBeginMark jubm(target);)
158+
JVMTI_ONLY(JvmtiUnmountBeginMark jubm(current);)
159159
JVMTI_ONLY(if (jubm.failed()) return freeze_pinned_native;)
160-
freeze_result res = CAST_TO_FN_PTR(FreezeContFnT, freeze_preempt_entry())(target, target->last_Java_sp());
160+
freeze_result res = CAST_TO_FN_PTR(FreezeContFnT, freeze_preempt_entry())(current, current->last_Java_sp());
161161
log_trace(continuations, preempt)("try_preempt: %d", res);
162162
JVMTI_ONLY(jubm.set_result(res);)
163+
164+
if (current->has_pending_exception()) {
165+
assert(res == freeze_exception, "expecting an exception result from freeze");
166+
// We don't want to throw exceptions, especially when returning
167+
// from monitorenter since the compiler does not expect one. We
168+
// just ignore the exception and pin the vthread to the carrier.
169+
current->clear_pending_exception();
170+
}
163171
return res;
164172
}
165173

src/java.base/share/classes/java/lang/classfile/instruction/LabelTarget.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
* {@snippet lang=java :
5656
* cob.with(lt); // @link substring="with" target="CodeBuilder#with"
5757
* // @link substring="labelBinding" target="CodeBuilder#labelBinding" :
58-
* cob.labelBinding(lt.label()); // @link substring="label" target="#label"
58+
* cob.labelBinding(lt.label()); // @link regex="label(?=\()" target="#label"
5959
* }
6060
*
6161
* @see Label

0 commit comments

Comments
 (0)