8210513: Obsolete SyncFlags
authormikael
Tue, 11 Sep 2018 20:37:47 -0700
changeset 51704 2368e8e9cec6
parent 51703 4ffb0a33f265
child 51705 8123901bc3d1
8210513: Obsolete SyncFlags Reviewed-by: coleenp, dcubed, dholmes
src/hotspot/share/runtime/arguments.cpp
src/hotspot/share/runtime/globals.hpp
src/hotspot/share/runtime/objectMonitor.cpp
--- a/src/hotspot/share/runtime/arguments.cpp	Tue Sep 11 14:51:45 2018 -0700
+++ b/src/hotspot/share/runtime/arguments.cpp	Tue Sep 11 20:37:47 2018 -0700
@@ -576,6 +576,7 @@
   { "ErrorReportServer",             JDK_Version::undefined(), JDK_Version::jdk(12), JDK_Version::jdk(13) },
   { "EmitSync",                      JDK_Version::undefined(), JDK_Version::jdk(12), JDK_Version::jdk(13) },
   { "SyncVerbose",                   JDK_Version::undefined(), JDK_Version::jdk(12), JDK_Version::jdk(13) },
+  { "SyncFlags",                     JDK_Version::undefined(), JDK_Version::jdk(12), JDK_Version::jdk(13) },
 
 #ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS
   { "dep > obs",                    JDK_Version::jdk(9), JDK_Version::jdk(8), JDK_Version::undefined() },
--- a/src/hotspot/share/runtime/globals.hpp	Tue Sep 11 14:51:45 2018 -0700
+++ b/src/hotspot/share/runtime/globals.hpp	Tue Sep 11 20:37:47 2018 -0700
@@ -841,9 +841,6 @@
                 "The check is performed on GuaranteedSafepointInterval.")   \
                 range(0, 100)                                               \
                                                                             \
-  experimental(intx, SyncFlags, 0, "(Unsafe, Unstable) "                    \
-               "Experimental Sync flags")                                   \
-                                                                            \
   experimental(intx, hashCode, 5,                                           \
                "(Unstable) select hashCode generation algorithm")           \
                                                                             \
--- a/src/hotspot/share/runtime/objectMonitor.cpp	Tue Sep 11 14:51:45 2018 -0700
+++ b/src/hotspot/share/runtime/objectMonitor.cpp	Tue Sep 11 20:37:47 2018 -0700
@@ -529,7 +529,7 @@
   // timer scalability issues we see on some platforms as we'd only have one thread
   // -- the checker -- parked on a timer.
 
-  if ((SyncFlags & 16) == 0 && nxt == NULL && _EntryList == NULL) {
+  if (nxt == NULL && _EntryList == NULL) {
     // Try to assume the role of responsible thread for the monitor.
     // CONSIDER:  ST vs CAS vs { if (Responsible==null) Responsible=Self }
     Atomic::replace_if_null(Self, &_Responsible);
@@ -554,12 +554,8 @@
     if (TryLock(Self) > 0) break;
     assert(_owner != Self, "invariant");
 
-    if ((SyncFlags & 2) && _Responsible == NULL) {
-      Atomic::replace_if_null(Self, &_Responsible);
-    }
-
     // park self
-    if (_Responsible == Self || (SyncFlags & 1)) {
+    if (_Responsible == Self) {
       Self->_ParkEvent->park((jlong) recheckInterval);
       // Increase the recheckInterval, but clamp the value.
       recheckInterval *= 8;
@@ -672,9 +668,6 @@
   // monitorexit.  Recall too, that in 1-0 mode monitorexit does not necessarily
   // execute a serializing instruction.
 
-  if (SyncFlags & 8) {
-    OrderAccess::fence();
-  }
   return;
 }
 
@@ -714,11 +707,7 @@
       // cleared by handle_special_suspend_equivalent_condition()
       // or java_suspend_self()
       jt->set_suspend_equivalent();
-      if (SyncFlags & 1) {
-        Self->_ParkEvent->park((jlong)MAX_RECHECK_INTERVAL);
-      } else {
-        Self->_ParkEvent->park();
-      }
+      Self->_ParkEvent->park();
 
       // were we externally suspended while we were waiting?
       for (;;) {
@@ -927,9 +916,7 @@
 
   // Invariant: after setting Responsible=null an thread must execute
   // a MEMBAR or other serializing instruction before fetching EntryList|cxq.
-  if ((SyncFlags & 4) == 0) {
-    _Responsible = NULL;
-  }
+  _Responsible = NULL;
 
 #if INCLUDE_JFR
   // get the owner's thread id for the MonitorEnter event
@@ -1445,9 +1432,8 @@
   AddWaiter(&node);
   Thread::SpinRelease(&_WaitSetLock);
 
-  if ((SyncFlags & 4) == 0) {
-    _Responsible = NULL;
-  }
+  _Responsible = NULL;
+
   intptr_t save = _recursions; // record the old recursion count
   _waiters++;                  // increment the number of waiters
   _recursions = 0;             // set the recursion level to be 1
@@ -1593,10 +1579,6 @@
   assert(_succ != Self, "invariant");
   assert(((oop)(object()))->mark() == markOopDesc::encode(this), "invariant");
 
-  if (SyncFlags & 32) {
-    OrderAccess::fence();
-  }
-
   // check if the notification happened
   if (!WasNotified) {
     // no, it could be timeout or Thread.interrupt() or both
@@ -1728,9 +1710,7 @@
 // Note: We can also detect many such problems with a "minimum wait".
 // When the "minimum wait" is set to a small non-zero timeout value
 // and the program does not hang whereas it did absent "minimum wait",
-// that suggests a lost wakeup bug. The '-XX:SyncFlags=1' option uses
-// a "minimum wait" for all park() operations; see the recheckInterval
-// variable and MAX_RECHECK_INTERVAL.
+// that suggests a lost wakeup bug.
 
 void ObjectMonitor::notify(TRAPS) {
   CHECK_OWNER();