8228340: JVMCI deleteGlobalHandle doesn't delete the handle

Add missing call to OopStorage::release() when deleting global handles in JVMCI to prevent handles leak.

Reviewed-by: kvn, dlong
This commit is contained in:
Kim Barrett 2019-07-18 09:15:26 -07:00
parent 0fa1047733
commit 4d471e7845
3 changed files with 10 additions and 2 deletions

View file

@ -2181,8 +2181,7 @@ C2V_VMENTRY_NULL(jobject, getObject, (JNIEnv* env, jobject, jobject x, long disp
C2V_VMENTRY(void, deleteGlobalHandle, (JNIEnv* env, jobject, jlong h))
jobject handle = (jobject)(address)h;
if (handle != NULL) {
assert(JVMCI::is_global_handle(handle), "Invalid delete of global JNI handle");
*((oop*)handle) = NULL; // Mark the handle as deleted, allocate will reuse it
JVMCI::destroy_global(handle);
}
}