< prev index next >

src/hotspot/share/classfile/stringTable.cpp

Print this page

1107     oop string = val->peek();
1108     if (string != nullptr && !HeapShared::is_string_too_large_to_archive(string)) {
1109       unsigned int hash = java_lang_String::hash_code(string);
1110       writer.add(hash, index);
1111       index ++;
1112     }
1113     return true;
1114   };
1115   _local_table->do_safepoint_scan(copy_into_shared_table);
1116   writer.dump(&_shared_table, "string");
1117 
1118   DEBUG_ONLY(AtomicAccess::release_store(&_disable_interning_during_cds_dump, false));
1119 }
1120 
1121 void StringTable::set_shared_strings_array_index(int root_index) {
1122   assert(HeapShared::is_writing_mapping_mode(), "should not reach here");
1123   _shared_strings_array_root_index = root_index;
1124 }
1125 
1126 void StringTable::serialize_shared_table_header(SerializeClosure* soc) {






1127   _shared_table.serialize_header(soc);
1128 
1129   if (soc->writing()) {
1130     // Sanity. Make sure we don't use the shared table at dump time
1131     _shared_table.reset();
1132   } else if (!AOTMappedHeapLoader::is_in_use()) {
1133     _shared_table.reset();
1134   }
1135 
1136   soc->do_bool(&_is_two_dimensional_shared_strings_array);
1137   soc->do_int(&_shared_strings_array_root_index);
1138 }
1139 #endif //INCLUDE_CDS_JAVA_HEAP

1107     oop string = val->peek();
1108     if (string != nullptr && !HeapShared::is_string_too_large_to_archive(string)) {
1109       unsigned int hash = java_lang_String::hash_code(string);
1110       writer.add(hash, index);
1111       index ++;
1112     }
1113     return true;
1114   };
1115   _local_table->do_safepoint_scan(copy_into_shared_table);
1116   writer.dump(&_shared_table, "string");
1117 
1118   DEBUG_ONLY(AtomicAccess::release_store(&_disable_interning_during_cds_dump, false));
1119 }
1120 
1121 void StringTable::set_shared_strings_array_index(int root_index) {
1122   assert(HeapShared::is_writing_mapping_mode(), "should not reach here");
1123   _shared_strings_array_root_index = root_index;
1124 }
1125 
1126 void StringTable::serialize_shared_table_header(SerializeClosure* soc) {
1127   if (soc->writing() && !CDSConfig::is_dumping_heap()) {
1128     _shared_table.reset();
1129     _is_two_dimensional_shared_strings_array = false;
1130     _shared_strings_array_root_index = -1;
1131   }
1132 
1133   _shared_table.serialize_header(soc);
1134 
1135   if (soc->writing()) {
1136     // Sanity. Make sure we don't use the shared table at dump time
1137     _shared_table.reset();
1138   } else if (!AOTMappedHeapLoader::is_in_use()) {
1139     _shared_table.reset();
1140   }
1141 
1142   soc->do_bool(&_is_two_dimensional_shared_strings_array);
1143   soc->do_int(&_shared_strings_array_root_index);
1144 }
1145 #endif //INCLUDE_CDS_JAVA_HEAP
< prev index next >