< prev index next >

src/hotspot/share/cds/filemap.cpp

Print this page
@@ -215,10 +215,11 @@
    }
    _version = CURRENT_CDS_ARCHIVE_VERSION;
    _core_region_alignment = core_region_alignment;
    _obj_alignment = ObjectAlignmentInBytes;
    _compact_strings = CompactStrings;
+   _compact_headers = UseCompactObjectHeaders;
    if (HeapShared::is_heap_object_archiving_allowed()) {
      _narrow_oop_mode = CompressedOops::mode();
      _narrow_oop_base = CompressedOops::base();
      _narrow_oop_shift = CompressedOops::shift();
      _heap_begin = CompressedOops::begin();

@@ -277,10 +278,11 @@
    st->print_cr("- obj_alignment:                  %d", _obj_alignment);
    st->print_cr("- narrow_oop_base:                " INTPTR_FORMAT, p2i(_narrow_oop_base));
    st->print_cr("- narrow_oop_base:                " INTPTR_FORMAT, p2i(_narrow_oop_base));
    st->print_cr("- narrow_oop_shift                %d", _narrow_oop_shift);
    st->print_cr("- compact_strings:                %d", _compact_strings);
+   st->print_cr("- compact_headers:                %d", _compact_headers);
    st->print_cr("- max_heap_size:                  " UINTX_FORMAT, _max_heap_size);
    st->print_cr("- narrow_oop_mode:                %d", _narrow_oop_mode);
    st->print_cr("- narrow_klass_shift:             %d", _narrow_klass_shift);
    st->print_cr("- compressed_oops:                %d", _compressed_oops);
    st->print_cr("- compressed_class_ptrs:          %d", _compressed_class_ptrs);

@@ -2256,10 +2258,18 @@
      FileMapInfo::fail_continue("Unable to use shared archive.\nThe saved state of UseCompressedOops and UseCompressedClassPointers is "
                                 "different from runtime, CDS will be disabled.");
      return false;
    }
  
+   if (compact_headers() != UseCompactObjectHeaders) {
+     log_info(cds)("The shared archive file's UseCompactObjectHeaders setting (%s)"
+                   " does not equal the current UseCompactObjectHeaders setting (%s).",
+                   _compact_headers          ? "enabled" : "disabled",
+                   UseCompactObjectHeaders   ? "enabled" : "disabled");
+     return false;
+   }
+ 
    if (!_use_optimized_module_handling) {
      MetaspaceShared::disable_optimized_module_handling();
      log_info(cds)("optimized module handling: disabled because archive was created without optimized module handling");
    }
  
< prev index next >