src/hotspot/share/memory/heapShared.cpp
changeset 52514 f4e3900c8d08
parent 52465 3e0ebf913679
child 52626 991fe09c698c
equal deleted inserted replaced
52513:d4f3e37d1fda 52514:f4e3900c8d08
   389       ArchivedKlassSubGraphInfoRecord* record =
   389       ArchivedKlassSubGraphInfoRecord* record =
   390         (ArchivedKlassSubGraphInfoRecord*)MetaspaceShared::read_only_space_alloc(sizeof(ArchivedKlassSubGraphInfoRecord));
   390         (ArchivedKlassSubGraphInfoRecord*)MetaspaceShared::read_only_space_alloc(sizeof(ArchivedKlassSubGraphInfoRecord));
   391       record->init(&info);
   391       record->init(&info);
   392 
   392 
   393       unsigned int hash = primitive_hash<Klass*>(klass);
   393       unsigned int hash = primitive_hash<Klass*>(klass);
   394       uintx deltax = MetaspaceShared::object_delta(record);
   394       u4 delta = MetaspaceShared::object_delta_u4(record);
   395       guarantee(deltax <= MAX_SHARED_DELTA, "must not be");
       
   396       u4 delta = u4(deltax);
       
   397       _writer->add(hash, delta);
   395       _writer->add(hash, delta);
   398     }
   396     }
   399     return true; // keep on iterating
   397     return true; // keep on iterating
   400   }
   398   }
   401 };
   399 };
   415   _run_time_subgraph_info_table.reset();
   413   _run_time_subgraph_info_table.reset();
   416 
   414 
   417   int num_buckets = CompactHashtableWriter::default_num_buckets(d_table->_count);
   415   int num_buckets = CompactHashtableWriter::default_num_buckets(d_table->_count);
   418   CompactHashtableWriter writer(num_buckets, &stats);
   416   CompactHashtableWriter writer(num_buckets, &stats);
   419   CopyKlassSubGraphInfoToArchive copy(&writer);
   417   CopyKlassSubGraphInfoToArchive copy(&writer);
   420   _dump_time_subgraph_info_table->iterate(&copy);
   418   d_table->iterate(&copy);
   421 
   419 
   422   writer.dump(&_run_time_subgraph_info_table, "subgraphs");
   420   writer.dump(&_run_time_subgraph_info_table, "subgraphs");
   423 }
   421 }
   424 
   422 
   425 void HeapShared::serialize_subgraph_info_table_header(SerializeClosure* soc) {
   423 void HeapShared::serialize_subgraph_info_table_header(SerializeClosure* soc) {
   431     return; // nothing to do
   429     return; // nothing to do
   432   }
   430   }
   433   assert(!DumpSharedSpaces, "Should not be called with DumpSharedSpaces");
   431   assert(!DumpSharedSpaces, "Should not be called with DumpSharedSpaces");
   434 
   432 
   435   unsigned int hash = primitive_hash<Klass*>(k);
   433   unsigned int hash = primitive_hash<Klass*>(k);
   436   ArchivedKlassSubGraphInfoRecord* record = _run_time_subgraph_info_table.lookup(k, hash, 0);
   434   const ArchivedKlassSubGraphInfoRecord* record = _run_time_subgraph_info_table.lookup(k, hash, 0);
   437 
   435 
   438   // Initialize from archived data. Currently this is done only
   436   // Initialize from archived data. Currently this is done only
   439   // during VM initialization time. No lock is needed.
   437   // during VM initialization time. No lock is needed.
   440   if (record != NULL) {
   438   if (record != NULL) {
   441     Thread* THREAD = Thread::current();
   439     Thread* THREAD = Thread::current();