< prev index next >

src/hotspot/share/runtime/arguments.cpp

Print this page
*** 2001,10 ***
--- 2001,26 ---
      FLAG_SET_CMDLINE(StackReservedPages, 0);
      warning("Reserved Stack Area not supported on this platform");
    }
  #endif
  
+ #if !defined(X86) && !defined(AARCH64)
+   if (LockingMode == LM_LIGHTWEIGHT) {
+     FLAG_SET_CMDLINE(LockingMode, LM_LEGACY);
+     warning("New lightweight locking not supported on this platform");
+   }
+ #endif
+ 
+   if (UseHeavyMonitors) {
+     if (FLAG_IS_CMDLINE(LockingMode) && LockingMode != LM_MONITOR) {
+       jio_fprintf(defaultStream::error_stream(),
+                   "Conflicting -XX:+UseHeavyMonitors and -XX:LockingMode=%d flags", LockingMode);
+       return false;
+     }
+     FLAG_SET_CMDLINE(LockingMode, LM_MONITOR);
+   }
+ 
    return status;
  }
  
  bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
    const char* option_type) {

*** 3151,10 ***
--- 3167,34 ---
  
  #ifndef CAN_SHOW_REGISTERS_ON_ASSERT
    UNSUPPORTED_OPTION(ShowRegistersOnAssert);
  #endif // CAN_SHOW_REGISTERS_ON_ASSERT
  
+ #ifdef _LP64
+   if (UseCompactObjectHeaders && UseZGC) {
+     if (FLAG_IS_CMDLINE(UseCompactObjectHeaders)) {
+       warning("ZGC does not work with compact object headers, disabling UseCompactObjectHeaders");
+     }
+     FLAG_SET_DEFAULT(UseCompactObjectHeaders, false);
+   }
+ 
+   if (UseCompactObjectHeaders && FLAG_IS_CMDLINE(UseCompressedClassPointers) && !UseCompressedClassPointers) {
+     // If user specifies -UseCompressedClassPointers, disable compact headers with a warning.
+     warning("Compact object headers require compressed class pointers. Disabling compact object headers.");
+     FLAG_SET_DEFAULT(UseCompactObjectHeaders, false);
+   }
+   if (UseCompactObjectHeaders && LockingMode == LM_LEGACY) {
+     FLAG_SET_DEFAULT(LockingMode, LM_LIGHTWEIGHT);
+   }
+   if (UseCompactObjectHeaders && UseBiasedLocking) {
+     FLAG_SET_DEFAULT(UseBiasedLocking, false);
+   }
+   if (UseCompactObjectHeaders && !UseAltGCForwarding) {
+     FLAG_SET_DEFAULT(UseAltGCForwarding, true);
+   }
+ #endif
+ 
    return JNI_OK;
  }
  
  // Helper class for controlling the lifetime of JavaVMInitArgs
  // objects.  The contents of the JavaVMInitArgs are guaranteed to be

*** 4027,13 ***
    // biased locking
    if (UseHeavyMonitors
  #ifdef COMPILER1
        || !UseFastLocking
  #endif // COMPILER1
- #if INCLUDE_JVMCI
-       || !JVMCIUseFastLocking
- #endif
      ) {
      if (!FLAG_IS_DEFAULT(UseBiasedLocking) && UseBiasedLocking) {
        // flag set to true on command line; warn the user that they
        // can't enable biased locking here
        warning("Biased Locking is not supported with locking debug flags"
--- 4067,10 ---
< prev index next >