8248362: JVMTI frame operations should use Thread-Local Handshake

Reviewed-by: sspitsyn, dholmes, dcubed
This commit is contained in:
Yasumasa Suenaga 2020-07-27 15:49:53 +09:00
parent 3dba35d248
commit f84b5d2f80
5 changed files with 48 additions and 48 deletions

View file

@ -900,10 +900,10 @@ JvmtiEnvBase::get_frame_location(JavaThread *java_thread, jint depth,
#ifdef ASSERT
uint32_t debug_bits = 0;
#endif
assert((SafepointSynchronize::is_at_safepoint() ||
java_thread->is_thread_fully_suspended(false, &debug_bits)),
"at safepoint or target thread is suspended");
Thread* current_thread = Thread::current();
assert(current_thread == java_thread ||
current_thread == java_thread->active_handshaker(),
"call by myself or at direct handshake");
ResourceMark rm(current_thread);
vframe *vf = vframeFor(java_thread, depth);
@ -1558,22 +1558,20 @@ GetStackTraceClosure::do_thread(Thread *target) {
}
void
VM_GetFrameCount::doit() {
_result = JVMTI_ERROR_THREAD_NOT_ALIVE;
GetFrameCountClosure::do_thread(Thread *target) {
JavaThread* jt = _state->get_thread();
ThreadsListHandle tlh;
if (jt != NULL && tlh.includes(jt) && !jt->is_exiting() && jt->threadObj() != NULL) {
assert(target == jt, "just checking");
if (!jt->is_exiting() && jt->threadObj() != NULL) {
_result = ((JvmtiEnvBase*)_env)->get_frame_count(_state, _count_ptr);
}
}
void
VM_GetFrameLocation::doit() {
_result = JVMTI_ERROR_THREAD_NOT_ALIVE;
ThreadsListHandle tlh;
if (_java_thread != NULL && tlh.includes(_java_thread)
&& !_java_thread->is_exiting() && _java_thread->threadObj() != NULL) {
_result = ((JvmtiEnvBase*)_env)->get_frame_location(_java_thread, _depth,
GetFrameLocationClosure::do_thread(Thread *target) {
assert(target->is_Java_thread(), "just checking");
JavaThread *jt = (JavaThread *)target;
if (!jt->is_exiting() && jt->threadObj() != NULL) {
_result = ((JvmtiEnvBase*)_env)->get_frame_location(jt, _depth,
_method_ptr, _location_ptr);
}
}