--- old/src/hotspot/share/runtime/jniHandles.cpp 2017-11-02 08:30:10.000000000 +0100 +++ new/src/hotspot/share/runtime/jniHandles.cpp 2017-11-02 08:30:10.000000000 +0100 @@ -126,6 +126,11 @@ template oop JNIHandles::resolve_jweak(jweak); template oop JNIHandles::resolve_jweak(jweak); +bool JNIHandles::is_global_weak_cleared(jweak handle) { + assert(is_jweak(handle), "not a weak handle"); + return guard_value(jweak_ref(handle)) == NULL; +} + void JNIHandles::destroy_global(jobject handle) { if (handle != NULL) { assert(is_global_handle(handle), "Invalid delete of global JNI handle");