--- old/src/hotspot/share/prims/jvmtiEnv.cpp 2020-08-24 11:22:02.038921356 +0900 +++ new/src/hotspot/share/prims/jvmtiEnv.cpp 2020-08-24 11:22:01.948918752 +0900 @@ -1714,13 +1714,13 @@ // shall be posted for this PopFrame. // It is only safe to perform the direct operation on the current - // thread. All other usage needs to use a vm-safepoint-op for safety. + // thread. All other usage needs to use a handshake for safety. if (java_thread == JavaThread::current()) { state->update_for_pop_top_frame(); } else { - VM_UpdateForPopTopFrame op(state); - VMThread::execute(&op); - jvmtiError err = op.result(); + UpdateForPopTopFrameClosure op(state); + bool executed = Handshake::execute_direct(&op, java_thread); + jvmtiError err = executed ? op.result() : JVMTI_ERROR_THREAD_NOT_ALIVE; if (err != JVMTI_ERROR_NONE) { return err; } @@ -1800,9 +1800,9 @@ int frame_number = state->count_frames() - depth; state->env_thread_state(this)->set_frame_pop(frame_number); } else { - VM_SetFramePop op(this, state, depth); - VMThread::execute(&op); - err = op.result(); + SetFramePopClosure op(this, state, depth); + bool executed = Handshake::execute_direct(&op, java_thread); + err = executed ? op.result() : JVMTI_ERROR_THREAD_NOT_ALIVE; } return err; } /* end NotifyFramePop */