RFR: 8259374: Make ThreadInVMfromNative have ResetNoHandleMark [v2]
Coleen Phillimore
coleenp at openjdk.java.net
Tue Jan 12 13:09:59 UTC 2021
On Mon, 11 Jan 2021 12:47:10 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> Thanks Dan and Patricio!
>
>> What JNI_LEAF function does as you describe?
> 1.
> JNI_LEAF(void, JVM_RegisterNativeEntryPointMethods(JNIEnv *env, jclass NEP_class))
> int status = env->RegisterNatives(NEP_class, NEP_methods, sizeof(NEP_methods)/sizeof(JNINativeMethod));
> guarantee(status == JNI_OK && !env->ExceptionOccurred(),
> "register jdk.internal.invoke.NativeEntryPoint natives");
> JNI_END
> Also: JVM_RegisterProgrammableInvokerMethods, JVM_RegisterProgrammableUpcallHandlerMethods
> 2. The real reason that I wrote this is patch is so that each of these ThreadInVMfromNative calls (from the compiler and JFR) don't need to also have ResetNoHandleMark. The intention is to hide this detail so one doesn't need to try to figure out what this is when reading through the code. It is debug code, so after the transition, there is no need to have a NoHandleMark. My original intention is to hide this as much as possible since it's a weird artifact of our implementation of Handles. It's noise, that I've always ignored until now.
> Thanks.
> I think this use of JNI_LEAF needs to be re-examined, but I won't insist
> on that here or object to the proposed changes.
Ok, thanks. We could file another RFE to reexamine why these are LEAF methods. There might be a bigger change to call the vm code directly instead of env->RegisterNatives that I don't want to get into in this change.
Thanks for the code reviews.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1983
More information about the hotspot-dev
mailing list