RFR: 8280422: thread_from_jni_environment can never return NULL

Jie Fu jiefu at openjdk.java.net
Sun Jan 23 23:36:06 UTC 2022


On Sun, 23 Jan 2022 23:20:38 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Analysing the code and its use (see JBS issue for gory details) we can see that `thread_from_jni_environment` can never actually return NULL, so we change it to not appear to do so and thus keep static analysis tools happy.  We also always validate the incoming JNIEnv for debug builds and scrap the unused `VerifyJNIEnvThread` flag.
> 
> Testing: tiers 1-5
> 
> Thanks,
> David

src/hotspot/share/runtime/thread.hpp line 1315:

> 1313:   JNIEnv* jni_environment()                      { return &_jni_environment; }
> 1314: 
> 1315:   // Returns the current thread as indicated by the given JNIEnv.

Copyright year: 2021 --> 2022 ?

-------------

PR: https://git.openjdk.java.net/jdk/pull/7193


More information about the hotspot-runtime-dev mailing list