8131045: Obsolete JNIDetachReleasesMonitors
authordholmes
Thu, 29 Oct 2015 18:59:22 -0400
changeset 33729 b1e0ae955f02
parent 33624 509a72e7127b
child 33730 30e064828045
8131045: Obsolete JNIDetachReleasesMonitors Reviewed-by: dcubed, dsimms, sspitsyn
hotspot/src/share/vm/runtime/arguments.cpp
hotspot/src/share/vm/runtime/globals.hpp
hotspot/src/share/vm/runtime/thread.cpp
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Thu Oct 29 17:32:08 2015 +0100
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Thu Oct 29 18:59:22 2015 -0400
@@ -364,6 +364,7 @@
   { "LazyBootClassLoader",           JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
   { "StarvationMonitorInterval",     JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
   { "PreInflateSpin",                JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
+  { "JNIDetachReleasesMonitors",     JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) },
 
 #ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS
   { "dep > obs",                    JDK_Version::jdk(9), JDK_Version::jdk(8), JDK_Version::undefined() },
--- a/hotspot/src/share/vm/runtime/globals.hpp	Thu Oct 29 17:32:08 2015 +0100
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Thu Oct 29 18:59:22 2015 -0400
@@ -1333,9 +1333,6 @@
   product(bool, AllowJNIEnvProxy, false,                                    \
           "Allow JNIEnv proxies for jdbx")                                  \
                                                                             \
-  product(bool, JNIDetachReleasesMonitors, true,                            \
-          "JNI DetachCurrentThread releases monitors owned by thread")      \
-                                                                            \
   product(bool, RestoreMXCSROnJNICalls, false,                              \
           "Restore MXCSR when returning from JNI calls")                    \
                                                                             \
--- a/hotspot/src/share/vm/runtime/thread.cpp	Thu Oct 29 17:32:08 2015 +0100
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Thu Oct 29 18:59:22 2015 -0400
@@ -1868,13 +1868,10 @@
   // Optionally release any monitors for regular JavaThread exits. This
   // is provided as a work around for any bugs in monitor enter-exit
   // matching. This can be expensive so it is not enabled by default.
-  // ObjectMonitor::Knob_ExitRelease is a superset of the
-  // JNIDetachReleasesMonitors option.
   //
   // ensure_join() ignores IllegalThreadStateExceptions, and so does
   // ObjectSynchronizer::release_monitors_owned_by_thread().
-  if ((exit_type == jni_detach && JNIDetachReleasesMonitors) ||
-      ObjectMonitor::Knob_ExitRelease) {
+  if (exit_type == jni_detach || ObjectMonitor::Knob_ExitRelease) {
     // Sanity check even though JNI DetachCurrentThread() would have
     // returned JNI_ERR if there was a Java frame. JavaThread exit
     // should be done executing Java code by the time we get here.