< prev index next >

src/hotspot/share/runtime/arguments.cpp

Print this page
*** 3093,10 ***
--- 3093,32 ---
  
  #ifndef CAN_SHOW_REGISTERS_ON_ASSERT
    UNSUPPORTED_OPTION(ShowRegistersOnAssert);
  #endif // CAN_SHOW_REGISTERS_ON_ASSERT
  
+ #ifdef _LP64
+   if (UseCompactObjectHeaders && UseZGC && !ZGenerational) {
+     if (FLAG_IS_CMDLINE(UseCompactObjectHeaders)) {
+       warning("Single-generational ZGC does not work with compact object headers, disabling UseCompactObjectHeaders");
+     }
+     FLAG_SET_DEFAULT(UseCompactObjectHeaders, false);
+   }
+   if (UseCompactObjectHeaders && FLAG_IS_CMDLINE(UseCompressedClassPointers) && !UseCompressedClassPointers) {
+     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 && !UseAltGCForwarding) {
+     FLAG_SET_DEFAULT(UseAltGCForwarding, true);
+   }
+   if (UseCompactObjectHeaders && !UseCompressedClassPointers) {
+     FLAG_SET_DEFAULT(UseCompressedClassPointers, true);
+   }
+ #endif
+ 
    return JNI_OK;
  }
  
  // Helper class for controlling the lifetime of JavaVMInitArgs
  // objects.  The contents of the JavaVMInitArgs are guaranteed to be
< prev index next >