--- old/src/hotspot/share/prims/jni.cpp 2020-07-19 19:49:06.703064285 -0400 +++ new/src/hotspot/share/prims/jni.cpp 2020-07-19 19:49:05.548050444 -0400 @@ -344,8 +344,7 @@ trace_class_resolution(k); } - cls = (jclass)JNIHandles::make_local( - env, k->java_mirror()); + cls = (jclass)JNIHandles::make_local(THREAD, k->java_mirror()); return cls; JNI_END @@ -501,7 +500,7 @@ } else { reflection_method = Reflection::new_method(m, false, CHECK_NULL); } - ret = JNIHandles::make_local(env, reflection_method); + ret = JNIHandles::make_local(THREAD, reflection_method); return ret; JNI_END @@ -623,7 +622,7 @@ jni_check_async_exceptions(thread); oop exception = thread->pending_exception(); - jthrowable ret = (jthrowable) JNIHandles::make_local(env, exception); + jthrowable ret = (jthrowable) JNIHandles::make_local(THREAD, exception); HOTSPOT_JNI_EXCEPTIONOCCURRED_RETURN(ret); return ret; @@ -741,7 +740,7 @@ thread->set_active_handles(new_handles); old_handles->set_pop_frame_link(NULL); // clear link we won't release new_handles below JNIHandleBlock::release_block(old_handles, thread); // may block - result = JNIHandles::make_local(thread, result_handle()); + result = JNIHandles::make_local(THREAD, result_handle()); } HOTSPOT_JNI_POPLOCALFRAME_RETURN(result); return result; @@ -798,7 +797,7 @@ HOTSPOT_JNI_NEWLOCALREF_ENTRY(env, ref); - jobject ret = JNIHandles::make_local(env, JNIHandles::resolve(ref)); + jobject ret = JNIHandles::make_local(THREAD, JNIHandles::resolve(ref)); HOTSPOT_JNI_NEWLOCALREF_RETURN(ret); return ret; @@ -976,7 +975,7 @@ // Convert result if (is_reference_type(result->get_type())) { - result->set_jobject(JNIHandles::make_local(env, (oop) result->get_jobject())); + result->set_jobject(JNIHandles::make_local(THREAD, (oop) result->get_jobject())); } } @@ -1038,7 +1037,7 @@ // Convert result if (is_reference_type(result->get_type())) { - result->set_jobject(JNIHandles::make_local(env, (oop) result->get_jobject())); + result->set_jobject(JNIHandles::make_local(THREAD, (oop) result->get_jobject())); } } @@ -1054,7 +1053,7 @@ DT_RETURN_MARK(AllocObject, jobject, (const jobject&)ret); instanceOop i = InstanceKlass::allocate_instance(JNIHandles::resolve_non_null(clazz), CHECK_NULL); - ret = JNIHandles::make_local(env, i); + ret = JNIHandles::make_local(THREAD, i); return ret; JNI_END @@ -1070,7 +1069,7 @@ DT_RETURN_MARK(NewObjectA, jobject, (const jobject)obj); instanceOop i = InstanceKlass::allocate_instance(JNIHandles::resolve_non_null(clazz), CHECK_NULL); - obj = JNIHandles::make_local(env, i); + obj = JNIHandles::make_local(THREAD, i); JavaValue jvalue(T_VOID); JNI_ArgumentPusherArray ap(methodID, args); jni_invoke_nonstatic(env, &jvalue, obj, JNI_NONVIRTUAL, methodID, &ap, CHECK_NULL); @@ -1090,7 +1089,7 @@ DT_RETURN_MARK(NewObjectV, jobject, (const jobject&)obj); instanceOop i = InstanceKlass::allocate_instance(JNIHandles::resolve_non_null(clazz), CHECK_NULL); - obj = JNIHandles::make_local(env, i); + obj = JNIHandles::make_local(THREAD, i); JavaValue jvalue(T_VOID); JNI_ArgumentPusherVaArg ap(methodID, args); jni_invoke_nonstatic(env, &jvalue, obj, JNI_NONVIRTUAL, methodID, &ap, CHECK_NULL); @@ -1110,7 +1109,7 @@ DT_RETURN_MARK(NewObject, jobject, (const jobject&)obj); instanceOop i = InstanceKlass::allocate_instance(JNIHandles::resolve_non_null(clazz), CHECK_NULL); - obj = JNIHandles::make_local(env, i); + obj = JNIHandles::make_local(THREAD, i); va_list args; va_start(args, methodID); JavaValue jvalue(T_VOID); @@ -1128,7 +1127,7 @@ Klass* k = JNIHandles::resolve_non_null(obj)->klass(); jclass ret = - (jclass) JNIHandles::make_local(env, k->java_mirror()); + (jclass) JNIHandles::make_local(THREAD, k->java_mirror()); HOTSPOT_JNI_GETOBJECTCLASS_RETURN(ret); return ret; @@ -1910,7 +1909,7 @@ o = JvmtiExport::jni_GetField_probe(thread, obj, o, k, fieldID, false); } oop loaded_obj = HeapAccess::oop_load_at(o, offset); - jobject ret = JNIHandles::make_local(env, loaded_obj); + jobject ret = JNIHandles::make_local(THREAD, loaded_obj); HOTSPOT_JNI_GETOBJECTFIELD_RETURN(ret); return ret; JNI_END @@ -2090,7 +2089,7 @@ } assert(found, "bad fieldID passed into jni_ToReflectedField"); oop reflected = Reflection::new_field(&fd, CHECK_NULL); - ret = JNIHandles::make_local(env, reflected); + ret = JNIHandles::make_local(THREAD, reflected); return ret; JNI_END @@ -2277,7 +2276,7 @@ jstring ret = NULL; DT_RETURN_MARK(NewString, jstring, (const jstring&)ret); oop string=java_lang_String::create_oop_from_unicode((jchar*) unicodeChars, len, CHECK_NULL); - ret = (jstring) JNIHandles::make_local(env, string); + ret = (jstring) JNIHandles::make_local(THREAD, string); return ret; JNI_END @@ -2353,7 +2352,7 @@ DT_RETURN_MARK(NewStringUTF, jstring, (const jstring&)ret); oop result = java_lang_String::create_oop_from_str((char*) bytes, CHECK_NULL); - ret = (jstring) JNIHandles::make_local(env, result); + ret = (jstring) JNIHandles::make_local(THREAD, result); return ret; JNI_END @@ -2433,7 +2432,7 @@ result->obj_at_put(index, initial_value); } } - ret = (jobjectArray) JNIHandles::make_local(env, result); + ret = (jobjectArray) JNIHandles::make_local(THREAD, result); return ret; JNI_END @@ -2447,7 +2446,7 @@ DT_RETURN_MARK(GetObjectArrayElement, jobject, (const jobject&)ret); objArrayOop a = objArrayOop(JNIHandles::resolve_non_null(array)); if (a->is_within_bounds(index)) { - ret = JNIHandles::make_local(env, a->obj_at(index)); + ret = JNIHandles::make_local(THREAD, a->obj_at(index)); return ret; } else { ResourceMark rm(THREAD); @@ -2507,7 +2506,7 @@ DT_RETURN_MARK(New##Result##Array, Return, (const Return&)ret);\ \ oop obj= oopFactory::Allocator(len, CHECK_NULL); \ - ret = (Return) JNIHandles::make_local(env, obj); \ + ret = (Return) JNIHandles::make_local(THREAD, obj); \ return ret;\ JNI_END