equal
deleted
inserted
replaced
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 |