< prev index next >

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

Print this page

 87   }
 88   return result;
 89 }
 90 
 91 inline oop JNIHandles::resolve(jobject handle) {
 92   oop result = nullptr;
 93   if (handle != nullptr) {
 94     result = resolve_impl<DECORATORS_NONE, false /* external_guard */>(handle);
 95   }
 96   return result;
 97 }
 98 
 99 inline oop JNIHandles::resolve_no_keepalive(jobject handle) {
100   oop result = nullptr;
101   if (handle != nullptr) {
102     result = resolve_impl<AS_NO_KEEPALIVE, false /* external_guard */>(handle);
103   }
104   return result;
105 }
106 
107 inline bool JNIHandles::is_same_object(jobject handle1, jobject handle2) {
108   oop obj1 = resolve_no_keepalive(handle1);
109   oop obj2 = resolve_no_keepalive(handle2);
110   return obj1 == obj2;
111 }
112 
113 inline oop JNIHandles::resolve_non_null(jobject handle) {
114   assert(handle != nullptr, "JNI handle should not be null");
115   oop result = resolve_impl<DECORATORS_NONE, false /* external_guard */>(handle);
116   assert(result != nullptr, "null read from jni handle");
117   return result;
118 }
119 
120 inline void JNIHandles::destroy_local(jobject handle) {
121   if (handle != nullptr) {
122     *local_ptr(handle) = nullptr;
123   }
124 }
125 
126 #endif // SHARE_RUNTIME_JNIHANDLES_INLINE_HPP

 87   }
 88   return result;
 89 }
 90 
 91 inline oop JNIHandles::resolve(jobject handle) {
 92   oop result = nullptr;
 93   if (handle != nullptr) {
 94     result = resolve_impl<DECORATORS_NONE, false /* external_guard */>(handle);
 95   }
 96   return result;
 97 }
 98 
 99 inline oop JNIHandles::resolve_no_keepalive(jobject handle) {
100   oop result = nullptr;
101   if (handle != nullptr) {
102     result = resolve_impl<AS_NO_KEEPALIVE, false /* external_guard */>(handle);
103   }
104   return result;
105 }
106 






107 inline oop JNIHandles::resolve_non_null(jobject handle) {
108   assert(handle != nullptr, "JNI handle should not be null");
109   oop result = resolve_impl<DECORATORS_NONE, false /* external_guard */>(handle);
110   assert(result != nullptr, "null read from jni handle");
111   return result;
112 }
113 
114 inline void JNIHandles::destroy_local(jobject handle) {
115   if (handle != nullptr) {
116     *local_ptr(handle) = nullptr;
117   }
118 }
119 
120 #endif // SHARE_RUNTIME_JNIHANDLES_INLINE_HPP
< prev index next >