RFR: 8259374: Make ThreadInVMfromNative have ResetNoHandleMark [v2]
Coleen Phillimore
coleenp at openjdk.java.net
Mon Jan 11 12:49:56 UTC 2021
On Thu, 7 Jan 2021 22:29:10 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> Looks good to me!
>
> 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.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1983
More information about the hotspot-dev
mailing list