From 905137d4065eb40bef6946bdc6bb688d6018a89d Mon Sep 17 00:00:00 2001 From: Serguei Spitsyn Date: Tue, 5 Dec 2023 23:41:49 +0000 Subject: [PATCH] 8321219: runtime/jni/FastGetField: assert(is_interpreted_frame()) failed: interpreted frame expected Reviewed-by: dcubed --- src/hotspot/share/prims/jvmtiThreadState.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/prims/jvmtiThreadState.cpp b/src/hotspot/share/prims/jvmtiThreadState.cpp index 6882c02f95a..c5ba2c030d0 100644 --- a/src/hotspot/share/prims/jvmtiThreadState.cpp +++ b/src/hotspot/share/prims/jvmtiThreadState.cpp @@ -557,7 +557,11 @@ JvmtiVTMSTransitionDisabler::VTMS_vthread_start(jobject vthread) { // If interp_only_mode has been enabled then we must eagerly create JvmtiThreadState // objects for globally enabled virtual thread filtered events. Otherwise, // it is an important optimization to create JvmtiThreadState objects lazily. - if (JvmtiThreadState::seen_interp_only_mode()) { + // This optimization is disabled when watchpoint capabilities are present. It is to + // work around a bug with virtual thread frames which can be not deoptimized in time. + if (JvmtiThreadState::seen_interp_only_mode() || + JvmtiExport::should_post_field_access() || + JvmtiExport::should_post_field_modification()){ JvmtiEventController::thread_started(thread); } if (JvmtiExport::should_post_vthread_start()) {