< prev index next >

src/hotspot/share/memory/metaspaceShared.cpp

Print this page


 402   soc->do_tag(--tag);
 403 
 404   // Verify the sizes of various metadata in the system.
 405   soc->do_tag(sizeof(Method));
 406   soc->do_tag(sizeof(ConstMethod));
 407   soc->do_tag(arrayOopDesc::base_offset_in_bytes(T_BYTE));
 408   soc->do_tag(sizeof(ConstantPool));
 409   soc->do_tag(sizeof(ConstantPoolCache));
 410   soc->do_tag(objArrayOopDesc::base_offset_in_bytes());
 411   soc->do_tag(typeArrayOopDesc::base_offset_in_bytes(T_BYTE));
 412   soc->do_tag(sizeof(Symbol));
 413 
 414   // Dump/restore miscellaneous metadata.
 415   Universe::serialize(soc);
 416   soc->do_tag(--tag);
 417 
 418   // Dump/restore references to commonly used names and signatures.
 419   vmSymbols::serialize(soc);
 420   soc->do_tag(--tag);
 421 
 422   // Dump/restore the symbol and string tables
 423   SymbolTable::serialize(soc);
 424   StringTable::serialize(soc);
 425 
 426   // Dump/restore the tables related to shared heap objects
 427   HeapShared::serialize_hashtables(soc);
 428   soc->do_tag(--tag);
 429 
 430   JavaClasses::serialize_offsets(soc);
 431   InstanceMirrorKlass::serialize_offsets(soc);
 432   soc->do_tag(--tag);
 433 
 434   soc->do_tag(666);
 435 }
 436 
 437 address MetaspaceShared::cds_i2i_entry_code_buffers(size_t total_size) {
 438   if (DumpSharedSpaces) {
 439     if (_cds_i2i_entry_code_buffers == NULL) {
 440       _cds_i2i_entry_code_buffers = (address)misc_code_space_alloc(total_size);
 441       _cds_i2i_entry_code_buffers_size = total_size;
 442     }
 443   } else if (UseSharedSpaces) {
 444     assert(_cds_i2i_entry_code_buffers != NULL, "must already been initialized");
 445   } else {
 446     return NULL;
 447   }
 448 


1818     // Cache for recording where the archived objects are copied to
1819     MetaspaceShared::create_archive_object_cache();
1820 
1821     tty->print_cr("Dumping objects to closed archive heap region ...");
1822     NOT_PRODUCT(StringTable::verify());
1823     // The closed space has maximum two regions. See FileMapInfo::write_archive_heap_regions() for details.
1824     _closed_archive_heap_regions = new GrowableArray<MemRegion>(2);
1825     MetaspaceShared::dump_closed_archive_heap_objects(_closed_archive_heap_regions);
1826 
1827     tty->print_cr("Dumping objects to open archive heap region ...");
1828     _open_archive_heap_regions = new GrowableArray<MemRegion>(2);
1829     MetaspaceShared::dump_open_archive_heap_objects(_open_archive_heap_regions);
1830 
1831     MetaspaceShared::destroy_archive_object_cache();
1832   }
1833 
1834   G1HeapVerifier::verify_archive_regions();
1835 
1836   {
1837     ArchiveCompactor::OtherROAllocMark mark;
1838     HeapShared::create_hashtables();
1839   }
1840 }
1841 
1842 void VM_PopulateDumpSharedSpace::dump_archive_heap_oopmaps() {
1843   if (MetaspaceShared::is_heap_object_archiving_allowed()) {
1844     _closed_archive_heap_oopmaps = new GrowableArray<ArchiveHeapOopmapInfo>(2);
1845     dump_archive_heap_oopmaps(_closed_archive_heap_regions, _closed_archive_heap_oopmaps);
1846 
1847     _open_archive_heap_oopmaps = new GrowableArray<ArchiveHeapOopmapInfo>(2);
1848     dump_archive_heap_oopmaps(_open_archive_heap_regions, _open_archive_heap_oopmaps);
1849   }
1850 }
1851 
1852 void VM_PopulateDumpSharedSpace::dump_archive_heap_oopmaps(GrowableArray<MemRegion>* regions,
1853                                                            GrowableArray<ArchiveHeapOopmapInfo>* oopmaps) {
1854   for (int i=0; i<regions->length(); i++) {
1855     ResourceBitMap oopmap = HeapShared::calculate_oopmap(regions->at(i));
1856     size_t size_in_bits = oopmap.size();
1857     size_t size_in_bytes = oopmap.size_in_bytes();
1858     uintptr_t* buffer = (uintptr_t*)_ro_region.allocate(size_in_bytes, sizeof(intptr_t));




 402   soc->do_tag(--tag);
 403 
 404   // Verify the sizes of various metadata in the system.
 405   soc->do_tag(sizeof(Method));
 406   soc->do_tag(sizeof(ConstMethod));
 407   soc->do_tag(arrayOopDesc::base_offset_in_bytes(T_BYTE));
 408   soc->do_tag(sizeof(ConstantPool));
 409   soc->do_tag(sizeof(ConstantPoolCache));
 410   soc->do_tag(objArrayOopDesc::base_offset_in_bytes());
 411   soc->do_tag(typeArrayOopDesc::base_offset_in_bytes(T_BYTE));
 412   soc->do_tag(sizeof(Symbol));
 413 
 414   // Dump/restore miscellaneous metadata.
 415   Universe::serialize(soc);
 416   soc->do_tag(--tag);
 417 
 418   // Dump/restore references to commonly used names and signatures.
 419   vmSymbols::serialize(soc);
 420   soc->do_tag(--tag);
 421 
 422   // Dump/restore the symbol/string/subgraph_info tables
 423   SymbolTable::serialize_shared_table_header(soc);
 424   StringTable::serialize_shared_table_header(soc);
 425   HeapShared::serialize_subgraph_info_table_header(soc);



 426 
 427   JavaClasses::serialize_offsets(soc);
 428   InstanceMirrorKlass::serialize_offsets(soc);
 429   soc->do_tag(--tag);
 430 
 431   soc->do_tag(666);
 432 }
 433 
 434 address MetaspaceShared::cds_i2i_entry_code_buffers(size_t total_size) {
 435   if (DumpSharedSpaces) {
 436     if (_cds_i2i_entry_code_buffers == NULL) {
 437       _cds_i2i_entry_code_buffers = (address)misc_code_space_alloc(total_size);
 438       _cds_i2i_entry_code_buffers_size = total_size;
 439     }
 440   } else if (UseSharedSpaces) {
 441     assert(_cds_i2i_entry_code_buffers != NULL, "must already been initialized");
 442   } else {
 443     return NULL;
 444   }
 445 


1815     // Cache for recording where the archived objects are copied to
1816     MetaspaceShared::create_archive_object_cache();
1817 
1818     tty->print_cr("Dumping objects to closed archive heap region ...");
1819     NOT_PRODUCT(StringTable::verify());
1820     // The closed space has maximum two regions. See FileMapInfo::write_archive_heap_regions() for details.
1821     _closed_archive_heap_regions = new GrowableArray<MemRegion>(2);
1822     MetaspaceShared::dump_closed_archive_heap_objects(_closed_archive_heap_regions);
1823 
1824     tty->print_cr("Dumping objects to open archive heap region ...");
1825     _open_archive_heap_regions = new GrowableArray<MemRegion>(2);
1826     MetaspaceShared::dump_open_archive_heap_objects(_open_archive_heap_regions);
1827 
1828     MetaspaceShared::destroy_archive_object_cache();
1829   }
1830 
1831   G1HeapVerifier::verify_archive_regions();
1832 
1833   {
1834     ArchiveCompactor::OtherROAllocMark mark;
1835     HeapShared::write_subgraph_info_table();
1836   }
1837 }
1838 
1839 void VM_PopulateDumpSharedSpace::dump_archive_heap_oopmaps() {
1840   if (MetaspaceShared::is_heap_object_archiving_allowed()) {
1841     _closed_archive_heap_oopmaps = new GrowableArray<ArchiveHeapOopmapInfo>(2);
1842     dump_archive_heap_oopmaps(_closed_archive_heap_regions, _closed_archive_heap_oopmaps);
1843 
1844     _open_archive_heap_oopmaps = new GrowableArray<ArchiveHeapOopmapInfo>(2);
1845     dump_archive_heap_oopmaps(_open_archive_heap_regions, _open_archive_heap_oopmaps);
1846   }
1847 }
1848 
1849 void VM_PopulateDumpSharedSpace::dump_archive_heap_oopmaps(GrowableArray<MemRegion>* regions,
1850                                                            GrowableArray<ArchiveHeapOopmapInfo>* oopmaps) {
1851   for (int i=0; i<regions->length(); i++) {
1852     ResourceBitMap oopmap = HeapShared::calculate_oopmap(regions->at(i));
1853     size_t size_in_bits = oopmap.size();
1854     size_t size_in_bytes = oopmap.size_in_bytes();
1855     uintptr_t* buffer = (uintptr_t*)_ro_region.allocate(size_in_bytes, sizeof(intptr_t));


< prev index next >