< prev index next >

src/hotspot/share/cds/filemap.cpp

Print this page
*** 202,10 ***
--- 202,11 ---
      copy_base_archive_name(CDSConfig::static_archive_path());
    }
    _core_region_alignment = core_region_alignment;
    _obj_alignment = ObjectAlignmentInBytes;
    _compact_strings = CompactStrings;
+   _compact_headers = UseCompactObjectHeaders;
    if (CDSConfig::is_dumping_heap()) {
      _narrow_oop_mode = CompressedOops::mode();
      _narrow_oop_base = CompressedOops::base();
      _narrow_oop_shift = CompressedOops::shift();
    }

*** 268,10 ***
--- 269,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("- compressed_oops:                %d", _compressed_oops);
    st->print_cr("- compressed_class_ptrs:          %d", _compressed_class_ptrs);
    st->print_cr("- cloned_vtables_offset:          " SIZE_FORMAT_X, _cloned_vtables_offset);

*** 1997,15 ***
      // because we won't install an archived object subgraph if the klass of any of the
      // referenced objects are replaced. See HeapShared::initialize_from_archived_subgraph().
    }
  
    // We pre-compute narrow Klass IDs with the runtime mapping start intended to be the base, and a shift of
!   // ArchiveHeapWriter::precomputed_narrow_klass_shift. We enforce this encoding at runtime (see
    // CompressedKlassPointers::initialize_for_given_encoding()). Therefore, the following assertions must
    // hold:
    address archive_narrow_klass_base = (address)header()->mapped_base_address();
!   const int archive_narrow_klass_shift = ArchiveHeapWriter::precomputed_narrow_klass_shift;
  
    log_info(cds)("CDS archive was created with max heap size = " SIZE_FORMAT "M, and the following configuration:",
                  max_heap_size()/M);
    log_info(cds)("    narrow_klass_base at mapping start address, narrow_klass_shift = %d",
                  archive_narrow_klass_shift);
--- 1999,15 ---
      // because we won't install an archived object subgraph if the klass of any of the
      // referenced objects are replaced. See HeapShared::initialize_from_archived_subgraph().
    }
  
    // We pre-compute narrow Klass IDs with the runtime mapping start intended to be the base, and a shift of
!   // ArchiveBuilder::precomputed_narrow_klass_shift. We enforce this encoding at runtime (see
    // CompressedKlassPointers::initialize_for_given_encoding()). Therefore, the following assertions must
    // hold:
    address archive_narrow_klass_base = (address)header()->mapped_base_address();
!   const int archive_narrow_klass_shift = ArchiveBuilder::precomputed_narrow_klass_shift;
  
    log_info(cds)("CDS archive was created with max heap size = " SIZE_FORMAT "M, and the following configuration:",
                  max_heap_size()/M);
    log_info(cds)("    narrow_klass_base at mapping start address, narrow_klass_shift = %d",
                  archive_narrow_klass_shift);

*** 2390,10 ***
--- 2392,18 ---
      log_info(cds)("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 >