< prev index next >

src/hotspot/share/runtime/arguments.cpp

Print this page
@@ -1425,17 +1425,10 @@
      }
    }
  #endif // _LP64
  }
  
- void Arguments::set_use_compressed_klass_ptrs() {
- #ifdef _LP64
-   assert(!UseCompressedClassPointers || CompressedClassSpaceSize <= KlassEncodingMetaspaceMax,
-          "CompressedClassSpaceSize is too large for UseCompressedClassPointers");
- #endif // _LP64
- }
- 
  void Arguments::set_conservative_max_heap_alignment() {
    // The conservative maximum required alignment for the heap is the maximum of
    // the alignments imposed by several sources: any requirements from the heap
    // itself and the maximum page size we may run the VM with.
    size_t heap_alignment = GCConfig::arguments()->conservative_max_heap_alignment();

@@ -1450,11 +1443,10 @@
  
    set_conservative_max_heap_alignment();
  
  #ifdef _LP64
    set_use_compressed_oops();
-   set_use_compressed_klass_ptrs();
  
    // Also checks that certain machines are slower with compressed oops
    // in vm_version initialization code.
  #endif // _LP64
  

@@ -1830,11 +1822,11 @@
      FLAG_SET_CMDLINE(StackReservedPages, 0);
      warning("Reserved Stack Area not supported on this platform");
    }
  #endif
  
- #if !defined(X86) && !defined(AARCH64) && !defined(RISCV64) && !defined(ARM) && !defined(PPC64) && !defined(S390)
+ #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

@@ -2957,10 +2949,23 @@
  
  #ifndef CAN_SHOW_REGISTERS_ON_ASSERT
    UNSUPPORTED_OPTION(ShowRegistersOnAssert);
  #endif // CAN_SHOW_REGISTERS_ON_ASSERT
  
+ #ifdef _LP64
+   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_LIGHTWEIGHT) {
+     FLAG_SET_DEFAULT(LockingMode, LM_LIGHTWEIGHT);
+   }
+   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

@@ -3661,10 +3666,14 @@
    // Set heap size based on available physical memory
    set_heap_size();
  
    GCConfig::arguments()->initialize();
  
+   if (UseCompressedClassPointers) {
+     CompressedKlassPointers::pre_initialize();
+   }
+ 
    CDSConfig::initialize();
  
    // Initialize Metaspace flags and alignments
    Metaspace::ergo_initialize();
  
< prev index next >