@@ -552,7 +552,7 @@ class VM_PopulateDumpSharedSpace : public VM_Operation {
552
552
FileMapInfo* _map_info;
553
553
StaticArchiveBuilder& _builder;
554
554
555
- void dump_java_heap_objects (GrowableArray<Klass*>* klasses) NOT_CDS_JAVA_HEAP_RETURN ;
555
+ void dump_java_heap_objects () ;
556
556
void dump_shared_symbol_table (GrowableArray<Symbol*>* symbols) {
557
557
log_info (cds)(" Dumping symbol table ..." );
558
558
SymbolTable::write_to_archive (symbols);
@@ -653,7 +653,7 @@ void VM_PopulateDumpSharedSpace::doit() {
653
653
MutexLocker ml (DumpTimeTable_lock, Mutex::_no_safepoint_check_flag);
654
654
655
655
#if INCLUDE_CDS_JAVA_HEAP
656
- if (HeapShared::can_write () && _extra_interned_strings != nullptr ) {
656
+ if (CDSConfig::is_dumping_heap () && _extra_interned_strings != nullptr ) {
657
657
for (int i = 0 ; i < _extra_interned_strings->length (); i ++) {
658
658
OopHandle string = _extra_interned_strings->at (i);
659
659
HeapShared::add_to_dumped_interned_strings (string.resolve ());
@@ -675,7 +675,7 @@ void VM_PopulateDumpSharedSpace::doit() {
675
675
_builder.make_klasses_shareable ();
676
676
MetaspaceShared::make_method_handle_intrinsics_shareable ();
677
677
678
- dump_java_heap_objects (_builder. klasses () );
678
+ dump_java_heap_objects ();
679
679
dump_shared_symbol_table (_builder.symbols ());
680
680
681
681
char * early_serialized_data = dump_early_read_only_tables ();
@@ -1043,19 +1043,13 @@ bool MetaspaceShared::try_link_class(JavaThread* current, InstanceKlass* ik) {
1043
1043
}
1044
1044
}
1045
1045
1046
- #if INCLUDE_CDS_JAVA_HEAP
1047
- void VM_PopulateDumpSharedSpace::dump_java_heap_objects (GrowableArray<Klass*>* klasses) {
1048
- if (!HeapShared::can_write ()) {
1049
- log_info (cds)(
1050
- " Archived java heap is not supported as UseG1GC "
1051
- " and UseCompressedClassPointers are required."
1052
- " Current settings: UseG1GC=%s, UseCompressedClassPointers=%s." ,
1053
- BOOL_TO_STR (UseG1GC), BOOL_TO_STR (UseCompressedClassPointers));
1054
- return ;
1046
+ void VM_PopulateDumpSharedSpace::dump_java_heap_objects () {
1047
+ if (CDSConfig::is_dumping_heap ()) {
1048
+ HeapShared::write_heap (&_heap_info);
1049
+ } else {
1050
+ CDSConfig::log_reasons_for_not_dumping_heap ();
1055
1051
}
1056
- HeapShared::write_heap (&_heap_info);
1057
1052
}
1058
- #endif // INCLUDE_CDS_JAVA_HEAP
1059
1053
1060
1054
void MetaspaceShared::set_shared_metaspace_range (void * base, void *static_top, void * top) {
1061
1055
assert (base <= static_top && static_top <= top, " must be" );
0 commit comments