898
899 assert(secondary != nullptr && secondary->is_objArray(), "must be");
900 assert(secondary_index < secondary->length(), "no strings should have been added");
901 secondary->obj_at_put(secondary_index, string);
902 }
903
904 index ++;
905 };
906 dumped_interned_strings->iterate_all(copy_into_array);
907
908 writer.dump(&_shared_table, "string");
909
910 return array;
911 }
912
913 void StringTable::set_shared_strings_array_index(int root_index) {
914 _shared_strings_array_root_index = root_index;
915 }
916
917 void StringTable::serialize_shared_table_header(SerializeClosure* soc) {
918 _shared_table.serialize_header(soc);
919
920 if (soc->writing()) {
921 // Sanity. Make sure we don't use the shared table at dump time
922 _shared_table.reset();
923 } else if (!ArchiveHeapLoader::is_in_use()) {
924 _shared_table.reset();
925 }
926
927 soc->do_bool(&_is_two_dimensional_shared_strings_array);
928 soc->do_int(&_shared_strings_array_root_index);
929 }
930 #endif //INCLUDE_CDS_JAVA_HEAP
|
898
899 assert(secondary != nullptr && secondary->is_objArray(), "must be");
900 assert(secondary_index < secondary->length(), "no strings should have been added");
901 secondary->obj_at_put(secondary_index, string);
902 }
903
904 index ++;
905 };
906 dumped_interned_strings->iterate_all(copy_into_array);
907
908 writer.dump(&_shared_table, "string");
909
910 return array;
911 }
912
913 void StringTable::set_shared_strings_array_index(int root_index) {
914 _shared_strings_array_root_index = root_index;
915 }
916
917 void StringTable::serialize_shared_table_header(SerializeClosure* soc) {
918 if (soc->writing() && !HeapShared::can_write()) {
919 _shared_table.reset();
920 _is_two_dimensional_shared_strings_array = false;
921 _shared_strings_array_root_index = -1;
922 }
923
924 _shared_table.serialize_header(soc);
925
926 if (soc->writing()) {
927 // Sanity. Make sure we don't use the shared table at dump time
928 _shared_table.reset();
929 } else if (!ArchiveHeapLoader::is_in_use()) {
930 _shared_table.reset();
931 }
932
933 soc->do_bool(&_is_two_dimensional_shared_strings_array);
934 soc->do_int(&_shared_strings_array_root_index);
935 }
936 #endif //INCLUDE_CDS_JAVA_HEAP
|