changeset 52851:f0c62b8f73c0

8214784: Adjust Dictionary and JNIHandle verification Reviewed-by: coleenp, eosterlund
author pliden
date Wed, 05 Dec 2018 17:11:19 +0100
parents f527b24990d7
children eb95a38b2964
files src/hotspot/share/classfile/dictionary.hpp src/hotspot/share/runtime/jniHandles.cpp
diffstat 2 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/classfile/dictionary.hpp	Wed Dec 05 16:40:12 2018 +0100
+++ b/src/hotspot/share/classfile/dictionary.hpp	Wed Dec 05 17:11:19 2018 +0100
@@ -173,7 +173,7 @@
     for (ProtectionDomainEntry* current = pd_set(); // accessed at a safepoint
                                 current != NULL;
                                 current = current->_next) {
-      oopDesc::verify(current->_pd_cache->object_no_keepalive());
+      guarantee(oopDesc::is_oop(current->_pd_cache->object_no_keepalive()), "Invalid oop");
     }
   }
 
--- a/src/hotspot/share/runtime/jniHandles.cpp	Wed Dec 05 16:40:12 2018 +0100
+++ b/src/hotspot/share/runtime/jniHandles.cpp	Wed Dec 05 17:11:19 2018 +0100
@@ -318,7 +318,7 @@
 class VerifyJNIHandles: public OopClosure {
 public:
   virtual void do_oop(oop* root) {
-    oopDesc::verify(*root);
+    guarantee(oopDesc::is_oop(RawAccess<>::oop_load(root)), "Invalid oop");
   }
   virtual void do_oop(narrowOop* root) { ShouldNotReachHere(); }
 };
@@ -327,11 +327,7 @@
   VerifyJNIHandles verify_handle;
 
   oops_do(&verify_handle);
-
-  // JNI weaks are handled concurrently in ZGC, so they can't be verified here
-  if (!UseZGC) {
-    weak_oops_do(&verify_handle);
-  }
+  weak_oops_do(&verify_handle);
 }
 
 // This method is implemented here to avoid circular includes between