8214784: Adjust Dictionary and JNIHandle verification
Reviewed-by: coleenp, eosterlund
--- 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