changeset 60757:a18124b4f041

8252652: Buggy looking null check in ServiceThread::oops_do() Summary: Remove the null check. Reviewed-by: stefank
author coleenp
date Tue, 01 Sep 2020 10:20:35 -0400
parents 88c5b65ff982
children 1e20fdeca15a
files src/hotspot/share/runtime/serviceThread.cpp
diffstat 1 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/runtime/serviceThread.cpp	Tue Sep 01 15:55:56 2020 +0200
+++ b/src/hotspot/share/runtime/serviceThread.cpp	Tue Sep 01 10:20:35 2020 -0400
@@ -261,14 +261,12 @@
   JavaThread::oops_do(f, cf);
   // The ServiceThread "owns" the JVMTI Deferred events, scan them here
   // to keep them alive until they are processed.
-  if (cf != NULL) {
-    if (_jvmti_event != NULL) {
-      _jvmti_event->oops_do(f, cf);
-    }
-    // Requires a lock, because threads can be adding to this queue.
-    MutexLocker ml(Service_lock, Mutex::_no_safepoint_check_flag);
-    _jvmti_service_queue.oops_do(f, cf);
+  if (_jvmti_event != NULL) {
+    _jvmti_event->oops_do(f, cf);
   }
+  // Requires a lock, because threads can be adding to this queue.
+  MutexLocker ml(Service_lock, Mutex::_no_safepoint_check_flag);
+  _jvmti_service_queue.oops_do(f, cf);
 }
 
 void ServiceThread::nmethods_do(CodeBlobClosure* cf) {