< prev index next >

src/hotspot/share/runtime/jniHandles.inline.hpp

Print this page

 65   }
 66   return result;
 67 }
 68 
 69 inline oop JNIHandles::resolve(jobject handle) {
 70   oop result = NULL;
 71   if (handle != NULL) {
 72     result = resolve_impl<DECORATORS_NONE, false /* external_guard */>(handle);
 73   }
 74   return result;
 75 }
 76 
 77 inline oop JNIHandles::resolve_no_keepalive(jobject handle) {
 78   oop result = NULL;
 79   if (handle != NULL) {
 80     result = resolve_impl<AS_NO_KEEPALIVE, false /* external_guard */>(handle);
 81   }
 82   return result;
 83 }
 84 
 85 inline bool JNIHandles::is_same_object(jobject handle1, jobject handle2) {
 86   oop obj1 = resolve_no_keepalive(handle1);
 87   oop obj2 = resolve_no_keepalive(handle2);
 88   return obj1 == obj2;
 89 }
 90 
 91 inline oop JNIHandles::resolve_non_null(jobject handle) {
 92   assert(handle != NULL, "JNI handle should not be null");
 93   oop result = resolve_impl<DECORATORS_NONE, false /* external_guard */>(handle);
 94   assert(result != NULL, "NULL read from jni handle");
 95   return result;
 96 }
 97 
 98 inline void JNIHandles::destroy_local(jobject handle) {
 99   if (handle != NULL) {
100     assert(!is_jweak(handle), "Invalid JNI local handle");
101     NativeAccess<>::oop_store(jobject_ptr(handle), (oop)NULL);
102   }
103 }
104 
105 #endif // SHARE_RUNTIME_JNIHANDLES_INLINE_HPP

 65   }
 66   return result;
 67 }
 68 
 69 inline oop JNIHandles::resolve(jobject handle) {
 70   oop result = NULL;
 71   if (handle != NULL) {
 72     result = resolve_impl<DECORATORS_NONE, false /* external_guard */>(handle);
 73   }
 74   return result;
 75 }
 76 
 77 inline oop JNIHandles::resolve_no_keepalive(jobject handle) {
 78   oop result = NULL;
 79   if (handle != NULL) {
 80     result = resolve_impl<AS_NO_KEEPALIVE, false /* external_guard */>(handle);
 81   }
 82   return result;
 83 }
 84 






 85 inline oop JNIHandles::resolve_non_null(jobject handle) {
 86   assert(handle != NULL, "JNI handle should not be null");
 87   oop result = resolve_impl<DECORATORS_NONE, false /* external_guard */>(handle);
 88   assert(result != NULL, "NULL read from jni handle");
 89   return result;
 90 }
 91 
 92 inline void JNIHandles::destroy_local(jobject handle) {
 93   if (handle != NULL) {
 94     assert(!is_jweak(handle), "Invalid JNI local handle");
 95     NativeAccess<>::oop_store(jobject_ptr(handle), (oop)NULL);
 96   }
 97 }
 98 
 99 #endif // SHARE_RUNTIME_JNIHANDLES_INLINE_HPP
< prev index next >