inline oop JNIHandles::resolve(jobject handle) { oop result = (handle == NULL ? (oop)NULL : *(oop*)handle); assert(result != NULL || (handle == NULL || !CheckJNICalls || is_weak_global_handle(handle)), "Invalid value read from jni handle"); assert(result != badJNIHandle, "Pointing to zapped jni handle area"); return result; };
void JNIHandles::destroy_weak_global(jobject handle) { if (handle != NULL) { assert(!CheckJNICalls || is_weak_global_handle(handle), "Invalid delete of weak global JNI handle"); *((oop*)handle) = deleted_handle(); // Mark the handle as deleted, allocate will reuse it } }