< prev index next >

src/hotspot/share/memory/metaspaceShared.cpp

Print this page

*** 417,430 **** // Dump/restore references to commonly used names and signatures. vmSymbols::serialize(soc); soc->do_tag(--tag); ! // Dump/restore the symbol and string tables ! SymbolTable::serialize(soc); ! StringTable::serialize(soc); ! soc->do_tag(--tag); JavaClasses::serialize_offsets(soc); InstanceMirrorKlass::serialize_offsets(soc); soc->do_tag(--tag); --- 417,430 ---- // Dump/restore references to commonly used names and signatures. vmSymbols::serialize(soc); soc->do_tag(--tag); ! // Dump/restore the symbol/string/subgraph_info tables ! SymbolTable::serialize_shared_table_header(soc); ! StringTable::serialize_shared_table_header(soc); ! HeapShared::serialize_subgraph_info_table_header(soc); JavaClasses::serialize_offsets(soc); InstanceMirrorKlass::serialize_offsets(soc); soc->do_tag(--tag);
*** 1095,1104 **** --- 1095,1119 ---- } static DumpAllocStats* alloc_stats() { return _alloc_stats; } + // Use this when you allocate space with MetaspaceShare::read_only_space_alloc() + // outside of ArchiveCompactor::allocate(). These are usually for misc tables + // that are allocated in the RO space. + class OtherROAllocMark { + char* _oldtop; + public: + OtherROAllocMark() { + _oldtop = _ro_region.top(); + } + ~OtherROAllocMark() { + char* newtop = _ro_region.top(); + ArchiveCompactor::alloc_stats()->record_other_type(int(newtop - _oldtop), true); + } + }; + static void allocate(MetaspaceClosure::Ref* ref, bool read_only) { address obj = ref->obj(); int bytes = ref->size() * BytesPerWord; char* p; size_t alignment = BytesPerWord;
*** 1305,1315 **** NOT_PRODUCT(SymbolTable::verify()); SymbolTable::write_to_archive(); } char* VM_PopulateDumpSharedSpace::dump_read_only_tables() { ! char* oldtop = _ro_region.top(); // Reorder the system dictionary. Moving the symbols affects // how the hash table indices are calculated. SystemDictionary::reorder_dictionary_for_sharing(); tty->print("Removing java_mirror ... "); --- 1320,1330 ---- NOT_PRODUCT(SymbolTable::verify()); SymbolTable::write_to_archive(); } char* VM_PopulateDumpSharedSpace::dump_read_only_tables() { ! ArchiveCompactor::OtherROAllocMark mark; // Reorder the system dictionary. Moving the symbols affects // how the hash table indices are calculated. SystemDictionary::reorder_dictionary_for_sharing(); tty->print("Removing java_mirror ... ");
*** 1326,1349 **** size_t table_bytes = SystemDictionary::count_bytes_for_table(); char* table_top = _ro_region.allocate(table_bytes, sizeof(intptr_t)); SystemDictionary::copy_table(table_top, _ro_region.top()); - // Write the archived object sub-graph infos. For each klass with sub-graphs, - // the info includes the static fields (sub-graph entry points) and Klasses - // of objects included in the sub-graph. - HeapShared::write_archived_subgraph_infos(); - // Write the other data to the output array. WriteClosure wc(&_ro_region); MetaspaceShared::serialize(&wc); // Write the bitmaps for patching the archive heap regions dump_archive_heap_oopmaps(); - char* newtop = _ro_region.top(); - ArchiveCompactor::alloc_stats()->record_other_type(int(newtop - oldtop), true); return buckets_top; } void VM_PopulateDumpSharedSpace::doit() { Thread* THREAD = VMThread::vm_thread(); --- 1341,1357 ----
*** 1819,1828 **** --- 1827,1841 ---- MetaspaceShared::destroy_archive_object_cache(); } G1HeapVerifier::verify_archive_regions(); + + { + ArchiveCompactor::OtherROAllocMark mark; + HeapShared::write_subgraph_info_table(); + } } void VM_PopulateDumpSharedSpace::dump_archive_heap_oopmaps() { if (MetaspaceShared::is_heap_object_archiving_allowed()) { _closed_archive_heap_oopmaps = new GrowableArray<ArchiveHeapOopmapInfo>(2);
*** 1886,1896 **** os::vm_allocation_granularity()); } unsigned MetaspaceShared::obj_hash(oop const& p) { assert(!p->mark()->has_bias_pattern(), ! "this object should never have been locked"); // so identity_hash won't safepoin unsigned hash = (unsigned)p->identity_hash(); return hash; } MetaspaceShared::ArchivedObjectCache* MetaspaceShared::_archive_object_cache = NULL; --- 1899,1909 ---- os::vm_allocation_granularity()); } unsigned MetaspaceShared::obj_hash(oop const& p) { assert(!p->mark()->has_bias_pattern(), ! "this object should never have been locked"); // so identity_hash won't safepoint unsigned hash = (unsigned)p->identity_hash(); return hash; } MetaspaceShared::ArchivedObjectCache* MetaspaceShared::_archive_object_cache = NULL;
*** 2142,2154 **** int len = *(intptr_t*)buffer; // skip over shared dictionary entries buffer += sizeof(intptr_t); buffer += len; - // The table of archived java heap object sub-graph infos - buffer = HeapShared::read_archived_subgraph_infos(buffer); - // Verify various attributes of the archive, plus initialize the // shared string/symbol tables intptr_t* array = (intptr_t*)buffer; ReadClosure rc(&array); serialize(&rc); --- 2155,2164 ----
< prev index next >