Skip to content

Commit 121561d

Browse files
committedJul 31, 2024·
Merge
2 parents 575e902 + 47f46ad commit 121561d

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed
 

‎src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,10 @@ void StubAssembler::prologue(const char* name, bool must_gc_arguments) {
190190
}
191191

192192
void StubAssembler::epilogue(bool use_pop) {
193-
// use_pop when this frame may have been frozen on one carrier
194-
// thread then thawed on another carrier thread, rendering the fp
195-
// register invalid. We must restore the previous FP because it is
196-
// used as a call-saved scratch register by compiled code.
193+
// Avoid using a leave instruction when this frame may
194+
// have been frozen, since the current value of rfp
195+
// restored from the stub would be invalid. We still
196+
// must restore the rfp value saved on enter though.
197197
if (use_pop) {
198198
ldp(rfp, lr, Address(post(sp, 2 * wordSize)));
199199
} else {

‎src/hotspot/cpu/x86/c1_Runtime1_x86.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ void StubAssembler::prologue(const char* name, bool must_gc_arguments) {
221221
}
222222

223223
void StubAssembler::epilogue(bool use_pop) {
224+
// Avoid using a leave instruction when this frame may
225+
// have been frozen, since the current value of rbp
226+
// restored from the stub would be invalid. We still
227+
// must restore the rbp value saved on enter though.
224228
use_pop ? pop(rbp) : leave();
225229
ret(0);
226230
}

‎src/hotspot/share/runtime/continuation.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ int Continuation::try_preempt(JavaThread* target, oop continuation, int preempt_
139139
assert(!is_continuation_preempted(continuation), "");
140140
assert(Continuation::continuation_scope(continuation) == java_lang_VirtualThread::vthread_scope(), "");
141141
assert(!target->has_pending_exception(), "");
142-
assert(!target->is_suspended() || target->is_disable_suspend(), "");
142+
assert(!target->is_suspended() || target->is_disable_suspend() || target->obj_locker_count() > 0, "");
143143

144144
if (LockingMode == LM_LEGACY) {
145145
return freeze_unsupported;

0 commit comments

Comments
 (0)
Please sign in to comment.