src/hotspot/share/runtime/jniHandles.cpp
changeset 50803 45c1fde86050
parent 50728 9375184cec98
child 51268 4ac20e5f96ce
equal deleted inserted replaced
50802:fa380b3b2b7d 50803:45c1fde86050
   107     assert(oopDesc::is_oop(obj()), "not an oop");
   107     assert(oopDesc::is_oop(obj()), "not an oop");
   108     oop* ptr = global_handles()->allocate();
   108     oop* ptr = global_handles()->allocate();
   109     // Return NULL on allocation failure.
   109     // Return NULL on allocation failure.
   110     if (ptr != NULL) {
   110     if (ptr != NULL) {
   111       assert(*ptr == NULL, "invariant");
   111       assert(*ptr == NULL, "invariant");
   112       NativeAccess<IN_CONCURRENT_ROOT>::oop_store(ptr, obj());
   112       NativeAccess<>::oop_store(ptr, obj());
   113       res = reinterpret_cast<jobject>(ptr);
   113       res = reinterpret_cast<jobject>(ptr);
   114     } else {
   114     } else {
   115       report_handle_allocation_failure(alloc_failmode, "global");
   115       report_handle_allocation_failure(alloc_failmode, "global");
   116     }
   116     }
   117   } else {
   117   } else {
   173 
   173 
   174 void JNIHandles::destroy_global(jobject handle) {
   174 void JNIHandles::destroy_global(jobject handle) {
   175   if (handle != NULL) {
   175   if (handle != NULL) {
   176     assert(!is_jweak(handle), "wrong method for detroying jweak");
   176     assert(!is_jweak(handle), "wrong method for detroying jweak");
   177     oop* oop_ptr = jobject_ptr(handle);
   177     oop* oop_ptr = jobject_ptr(handle);
   178     NativeAccess<IN_CONCURRENT_ROOT>::oop_store(oop_ptr, (oop)NULL);
   178     NativeAccess<>::oop_store(oop_ptr, (oop)NULL);
   179     global_handles()->release(oop_ptr);
   179     global_handles()->release(oop_ptr);
   180   }
   180   }
   181 }
   181 }
   182 
   182 
   183 
   183