7979#include " utilities/hashTable.hpp"
8080#include " utilities/stringUtils.hpp"
8181
82- SystemDictionaryShared::ArchiveInfo SystemDictionaryShared::_static_archive;
83- SystemDictionaryShared::ArchiveInfo SystemDictionaryShared::_dynamic_archive;
82+ SystemDictionaryShared::ArchiveInfo SystemDictionaryShared::_info_for_static_archive;
83+ SystemDictionaryShared::ArchiveInfo SystemDictionaryShared::_info_for_dynamic_archive;
84+ SystemDictionaryShared::ArchiveInfo SystemDictionaryShared::_info_for_dumping;
8485
8586DumpTimeSharedClassTable* SystemDictionaryShared::_dumptime_table = nullptr ;
8687
@@ -132,8 +133,8 @@ InstanceKlass* SystemDictionaryShared::lookup_from_stream(Symbol* class_name,
132133 return nullptr ;
133134 }
134135
135- const RunTimeClassInfo* record = find_record (&_static_archive ._unregistered_dictionary ,
136- &_dynamic_archive ._unregistered_dictionary ,
136+ const RunTimeClassInfo* record = find_record (&_info_for_static_archive ._unregistered_dictionary ,
137+ &_info_for_dynamic_archive ._unregistered_dictionary ,
137138 class_name);
138139 if (record == nullptr ) {
139140 return nullptr ;
@@ -701,7 +702,7 @@ void SystemDictionaryShared::copy_unregistered_class_size_and_crc32(InstanceKlas
701702 precond (klass->in_aot_cache ());
702703
703704 // A shared class must have a RunTimeClassInfo record
704- const RunTimeClassInfo* record = find_record (&_static_archive ._unregistered_dictionary ,
705+ const RunTimeClassInfo* record = find_record (&_info_for_static_archive ._unregistered_dictionary ,
705706 nullptr , klass->name ());
706707 precond (record != nullptr );
707708 precond (record->klass () == klass);
@@ -1335,7 +1336,7 @@ void SystemDictionaryShared::write_dictionary(RunTimeSharedDictionary* dictionar
13351336}
13361337
13371338void SystemDictionaryShared::write_to_archive (bool is_static_archive) {
1338- ArchiveInfo* archive = get_archive (is_static_archive);
1339+ ArchiveInfo* archive = get_archive (is_static_archive, /* is_dumping= */ true );
13391340
13401341 write_dictionary (&archive->_builtin_dictionary , true );
13411342 write_dictionary (&archive->_unregistered_dictionary , false );
@@ -1348,7 +1349,7 @@ void SystemDictionaryShared::write_to_archive(bool is_static_archive) {
13481349
13491350void SystemDictionaryShared::serialize_dictionary_headers (SerializeClosure* soc,
13501351 bool is_static_archive) {
1351- ArchiveInfo* archive = get_archive (is_static_archive);
1352+ ArchiveInfo* archive = get_archive (is_static_archive, soc-> writing () );
13521353
13531354 archive->_builtin_dictionary .serialize_header (soc);
13541355 archive->_unregistered_dictionary .serialize_header (soc);
@@ -1395,8 +1396,8 @@ SystemDictionaryShared::find_record(RunTimeSharedDictionary* static_dict, RunTim
13951396}
13961397
13971398InstanceKlass* SystemDictionaryShared::find_builtin_class (Symbol* name) {
1398- const RunTimeClassInfo* record = find_record (&_static_archive ._builtin_dictionary ,
1399- &_dynamic_archive ._builtin_dictionary ,
1399+ const RunTimeClassInfo* record = find_record (&_info_for_static_archive ._builtin_dictionary ,
1400+ &_info_for_dynamic_archive ._builtin_dictionary ,
14001401 name);
14011402 if (record != nullptr ) {
14021403 assert (!record->klass ()->is_hidden (), " hidden class cannot be looked up by name" );
@@ -1437,11 +1438,12 @@ const char* SystemDictionaryShared::loader_type_for_shared_class(Klass* k) {
14371438}
14381439
14391440void SystemDictionaryShared::get_all_archived_classes (bool is_static_archive, GrowableArray<Klass*>* classes) {
1440- get_archive (is_static_archive)->_builtin_dictionary .iterate_all ([&] (const RunTimeClassInfo* record) {
1441+ ArchiveInfo* archive = get_archive (is_static_archive, /* is_dumping=*/ false );
1442+ archive->_builtin_dictionary .iterate_all ([&] (const RunTimeClassInfo* record) {
14411443 classes->append (record->klass ());
14421444 });
14431445
1444- get_archive (is_static_archive) ->_unregistered_dictionary .iterate_all ([&] (const RunTimeClassInfo* record) {
1446+ archive ->_unregistered_dictionary .iterate_all ([&] (const RunTimeClassInfo* record) {
14451447 classes->append (record->klass ());
14461448 });
14471449}
@@ -1488,10 +1490,10 @@ void SystemDictionaryShared::ArchiveInfo::print_table_statistics(const char* pre
14881490void SystemDictionaryShared::print_shared_archive (outputStream* st, bool is_static) {
14891491 if (CDSConfig::is_using_archive ()) {
14901492 if (is_static) {
1491- _static_archive .print_on (" " , st, true );
1493+ _info_for_static_archive .print_on (" " , st, true );
14921494 } else {
14931495 if (DynamicArchive::is_mapped ()) {
1494- _dynamic_archive .print_on (" Dynamic " , st, false );
1496+ _info_for_dynamic_archive .print_on (" Dynamic " , st, false );
14951497 }
14961498 }
14971499 }
@@ -1504,9 +1506,9 @@ void SystemDictionaryShared::print_on(outputStream* st) {
15041506
15051507void SystemDictionaryShared::print_table_statistics (outputStream* st) {
15061508 if (CDSConfig::is_using_archive ()) {
1507- _static_archive .print_table_statistics (" Static " , st, true );
1509+ _info_for_static_archive .print_table_statistics (" Static " , st, true );
15081510 if (DynamicArchive::is_mapped ()) {
1509- _dynamic_archive .print_table_statistics (" Dynamic " , st, false );
1511+ _info_for_dynamic_archive .print_table_statistics (" Dynamic " , st, false );
15101512 }
15111513 }
15121514}
0 commit comments