< prev index next >

src/hotspot/share/runtime/jniHandles.cpp

Print this page




 124 }
 125 
 126 template oop JNIHandles::resolve_jweak<true>(jweak);
 127 template oop JNIHandles::resolve_jweak<false>(jweak);
 128 
 129 void JNIHandles::destroy_global(jobject handle) {
 130   if (handle != NULL) {
 131     assert(is_global_handle(handle), "Invalid delete of global JNI handle");
 132     jobject_ref(handle) = deleted_handle();
 133   }
 134 }
 135 
 136 
 137 void JNIHandles::destroy_weak_global(jobject handle) {
 138   if (handle != NULL) {
 139     jweak_ref(handle) = deleted_handle();
 140   }
 141 }
 142 
 143 





 144 void JNIHandles::oops_do(OopClosure* f) {
 145   f->do_oop(&_deleted_handle);
 146   _global_handles->oops_do(f);
 147 }
 148 
 149 
 150 void JNIHandles::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f) {
 151   _weak_global_handles->weak_oops_do(is_alive, f);
 152 }
 153 
 154 
 155 void JNIHandles::weak_oops_do(OopClosure* f) {
 156   AlwaysTrueClosure always_true;
 157   weak_oops_do(&always_true, f);
 158 }
 159 
 160 
 161 void JNIHandles::initialize() {
 162   _global_handles      = JNIHandleBlock::allocate_block();
 163   _weak_global_handles = JNIHandleBlock::allocate_block();




 124 }
 125 
 126 template oop JNIHandles::resolve_jweak<true>(jweak);
 127 template oop JNIHandles::resolve_jweak<false>(jweak);
 128 
 129 void JNIHandles::destroy_global(jobject handle) {
 130   if (handle != NULL) {
 131     assert(is_global_handle(handle), "Invalid delete of global JNI handle");
 132     jobject_ref(handle) = deleted_handle();
 133   }
 134 }
 135 
 136 
 137 void JNIHandles::destroy_weak_global(jobject handle) {
 138   if (handle != NULL) {
 139     jweak_ref(handle) = deleted_handle();
 140   }
 141 }
 142 
 143 
 144 bool JNIHandles::is_global_weak_cleared(jweak handle) {
 145   assert(is_jweak(handle), "not a weak handle");
 146   return guard_value<false>(jweak_ref(handle)) == NULL;
 147 }
 148 
 149 void JNIHandles::oops_do(OopClosure* f) {
 150   f->do_oop(&_deleted_handle);
 151   _global_handles->oops_do(f);
 152 }
 153 
 154 
 155 void JNIHandles::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f) {
 156   _weak_global_handles->weak_oops_do(is_alive, f);
 157 }
 158 
 159 
 160 void JNIHandles::weak_oops_do(OopClosure* f) {
 161   AlwaysTrueClosure always_true;
 162   weak_oops_do(&always_true, f);
 163 }
 164 
 165 
 166 void JNIHandles::initialize() {
 167   _global_handles      = JNIHandleBlock::allocate_block();
 168   _weak_global_handles = JNIHandleBlock::allocate_block();


< prev index next >