8369609: calls from Continuations to invalidate_jvmti_stack must be more accurate

Reviewed-by: pchilanomate, dholmes
This commit is contained in:
Serguei Spitsyn 2025-10-30 14:24:00 +00:00
parent b166b0d082
commit a33aa65fbc

View File

@ -1626,13 +1626,15 @@ static void invalidate_jvmti_stack(JavaThread* thread) {
}
static void jvmti_yield_cleanup(JavaThread* thread, ContinuationWrapper& cont) {
if (!cont.entry()->is_virtual_thread() && JvmtiExport::has_frame_pops(thread)) {
int num_frames = num_java_frames(cont);
if (!cont.entry()->is_virtual_thread()) {
if (JvmtiExport::has_frame_pops(thread)) {
int num_frames = num_java_frames(cont);
ContinuationWrapper::SafepointOp so(Thread::current(), cont);
JvmtiExport::continuation_yield_cleanup(JavaThread::current(), num_frames);
ContinuationWrapper::SafepointOp so(Thread::current(), cont);
JvmtiExport::continuation_yield_cleanup(thread, num_frames);
}
invalidate_jvmti_stack(thread);
}
invalidate_jvmti_stack(thread);
}
static void jvmti_mount_end(JavaThread* current, ContinuationWrapper& cont, frame top) {
@ -2310,7 +2312,7 @@ NOINLINE intptr_t* Thaw<ConfigT>::thaw_slow(stackChunkOop chunk, Continuation::t
assert(_cont.chunk_invariant(), "");
JVMTI_ONLY(invalidate_jvmti_stack(_thread));
JVMTI_ONLY(if (!_cont.entry()->is_virtual_thread()) invalidate_jvmti_stack(_thread));
_thread->set_cont_fastpath(_fastpath);