< prev index next >

src/hotspot/share/memory/metaspaceShared.cpp

Print this page

@@ -37,11 +37,11 @@
 #include "interpreter/bytecodeStream.hpp"
 #include "interpreter/bytecodes.hpp"
 #include "logging/log.hpp"
 #include "logging/logMessage.hpp"
 #include "memory/filemap.hpp"
-#include "memory/heapShared.hpp"
+#include "memory/heapShared.inline.hpp"
 #include "memory/metaspace.hpp"
 #include "memory/metaspaceClosure.hpp"
 #include "memory/metaspaceShared.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/compressedOops.inline.hpp"

@@ -307,14 +307,14 @@
   Universe::set_narrow_klass_shift(LogKlassAlignmentInBytes);
   // Set the range of klass addresses to 4GB.
   Universe::set_narrow_klass_range(cds_total);
 
   Metaspace::initialize_class_space(tmp_class_space);
-  tty->print_cr("narrow_klass_base = " PTR_FORMAT ", narrow_klass_shift = %d",
+  log_info(cds)("narrow_klass_base = " PTR_FORMAT ", narrow_klass_shift = %d",
                 p2i(Universe::narrow_klass_base()), Universe::narrow_klass_shift());
 
-  tty->print_cr("Allocated temporary class space: " SIZE_FORMAT " bytes at " PTR_FORMAT,
+  log_info(cds)("Allocated temporary class space: " SIZE_FORMAT " bytes at " PTR_FORMAT,
                 CompressedClassSpaceSize, p2i(tmp_class_space.base()));
 #endif
 
   // Start with 0 committed bytes. The memory will be committed as needed by
   // MetaspaceShared::commit_shared_space_to().

@@ -460,10 +460,11 @@
   java_lang_StackTraceElement::serialize(soc);
   java_lang_StackFrameInfo::serialize(soc);
   java_lang_LiveStackFrameInfo::serialize(soc);
   java_util_concurrent_locks_AbstractOwnableSynchronizer::serialize(soc);
   jdk_internal_module_ArchivedModuleGraph::serialize(soc);
+  InstanceMirrorKlass::serialize(soc);
 }
 
 address MetaspaceShared::cds_i2i_entry_code_buffers(size_t total_size) {
   if (DumpSharedSpaces) {
     if (_cds_i2i_entry_code_buffers == NULL) {

@@ -1922,12 +1923,13 @@
   log_debug(cds, heap)("Archived heap object " PTR_FORMAT " ==> " PTR_FORMAT,
                        p2i(obj), p2i(archived_oop));
   return archived_oop;
 }
 
-oop MetaspaceShared::materialize_archived_object(oop obj) {
-  if (obj != NULL) {
+oop MetaspaceShared::materialize_archived_object(narrowOop v) {
+  if (!CompressedOops::is_null(v)) {
+    oop obj = HeapShared::decode_not_null(v);
     return G1CollectedHeap::heap()->materialize_archived_object(obj);
   }
   return NULL;
 }
 

@@ -1999,11 +2001,11 @@
     } else {
       assert(MetaspaceShared::is_heap_object_archiving_allowed(),
              "Archived heap object is not allowed");
       assert(MetaspaceShared::open_archive_heap_region_mapped(),
              "Open archive heap region is not mapped");
-      *p = CompressedOops::decode_not_null(o);
+      *p = HeapShared::decode_not_null(o);
     }
   }
 
   void do_region(u_char* start, size_t size) {
     assert((intptr_t)start % sizeof(intptr_t) == 0, "bad alignment");

@@ -2146,10 +2148,12 @@
   serialize(&rc);
 
   // Initialize the run-time symbol table.
   SymbolTable::create_table();
 
+  mapinfo->relocate_archived_heap_embedded_pointers();
+
   // Close the mapinfo file
   mapinfo->close();
 
   if (PrintSharedArchiveAndExit) {
     if (PrintSharedDictionary) {
< prev index next >