diff a/src/hotspot/share/runtime/jniHandles.inline.hpp b/src/hotspot/share/runtime/jniHandles.inline.hpp
--- a/src/hotspot/share/runtime/jniHandles.inline.hpp
+++ b/src/hotspot/share/runtime/jniHandles.inline.hpp
@@ -102,16 +102,10 @@
result = resolve_impl(handle);
}
return result;
}
-inline bool JNIHandles::is_same_object(jobject handle1, jobject handle2) {
- oop obj1 = resolve_no_keepalive(handle1);
- oop obj2 = resolve_no_keepalive(handle2);
- return obj1 == obj2;
-}
-
inline oop JNIHandles::resolve_non_null(jobject handle) {
assert(handle != nullptr, "JNI handle should not be null");
oop result = resolve_impl(handle);
assert(result != nullptr, "null read from jni handle");
return result;