RFR: 8264711: More runtime TRAPS cleanups

Patricio Chilano Mateo pchilanomate at openjdk.java.net
Mon Apr 5 19:14:26 UTC 2021


On Mon, 5 Apr 2021 17:57:13 GMT, Harold Seigel <hseigel at openjdk.org> wrote:

> Please review this additional cleanup of use of TRAPS in hotspot runtime code.  The changes were tested with Mach5 tiers 1-2 on Linux, Mac OS, and Windows and Mach5 tiers 3-5 on Linux x64.
> 
> Thanks, Harold

Hi Harold,

I looked at the changes to synchronization code and looks good except for one issue below.

Thanks,
Patricio

src/hotspot/share/prims/jni.cpp line 2738:

> 2736: 
> 2737:   Handle obj(THREAD, JNIHandles::resolve_non_null(jobj));
> 2738:   ObjectSynchronizer::jni_exit(THREAD->as_Java_thread(), obj());

Here we would return JNI_ERR if we throw IMSE from jni_exit().

src/hotspot/share/runtime/synchronizer.cpp line 609:

> 607:   // intentionally do not use CHECK on check_owner because we must exit the
> 608:   // monitor even if an exception was already pending.
> 609:   if (monitor->check_owner(current)) {

We can actually throw IMSE from check_owner() if this thread is not the real owner.

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

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


More information about the serviceability-dev mailing list