< prev index next >

src/hotspot/share/classfile/stringTable.cpp

Print this page

1038 
1039       assert(secondary != nullptr && secondary->is_objArray(), "must be");
1040       assert(secondary_index < secondary->length(), "no strings should have been added");
1041       secondary->obj_at_put(secondary_index, string);
1042     }
1043 
1044     index ++;
1045   };
1046   dumped_interned_strings->iterate_all(copy_into_array);
1047 
1048   writer.dump(&_shared_table, "string");
1049 
1050   return array;
1051 }
1052 
1053 void StringTable::set_shared_strings_array_index(int root_index) {
1054   _shared_strings_array_root_index = root_index;
1055 }
1056 
1057 void StringTable::serialize_shared_table_header(SerializeClosure* soc) {






1058   _shared_table.serialize_header(soc);
1059 
1060   if (soc->writing()) {
1061     // Sanity. Make sure we don't use the shared table at dump time
1062     _shared_table.reset();
1063   } else if (!ArchiveHeapLoader::is_in_use()) {
1064     _shared_table.reset();
1065   }
1066 
1067   soc->do_bool(&_is_two_dimensional_shared_strings_array);
1068   soc->do_int(&_shared_strings_array_root_index);
1069 }
1070 #endif //INCLUDE_CDS_JAVA_HEAP

1038 
1039       assert(secondary != nullptr && secondary->is_objArray(), "must be");
1040       assert(secondary_index < secondary->length(), "no strings should have been added");
1041       secondary->obj_at_put(secondary_index, string);
1042     }
1043 
1044     index ++;
1045   };
1046   dumped_interned_strings->iterate_all(copy_into_array);
1047 
1048   writer.dump(&_shared_table, "string");
1049 
1050   return array;
1051 }
1052 
1053 void StringTable::set_shared_strings_array_index(int root_index) {
1054   _shared_strings_array_root_index = root_index;
1055 }
1056 
1057 void StringTable::serialize_shared_table_header(SerializeClosure* soc) {
1058   if (soc->writing() && !HeapShared::can_write()) {
1059     _shared_table.reset();
1060     _is_two_dimensional_shared_strings_array = false;
1061     _shared_strings_array_root_index = -1;
1062   }
1063 
1064   _shared_table.serialize_header(soc);
1065 
1066   if (soc->writing()) {
1067     // Sanity. Make sure we don't use the shared table at dump time
1068     _shared_table.reset();
1069   } else if (!ArchiveHeapLoader::is_in_use()) {
1070     _shared_table.reset();
1071   }
1072 
1073   soc->do_bool(&_is_two_dimensional_shared_strings_array);
1074   soc->do_int(&_shared_strings_array_root_index);
1075 }
1076 #endif //INCLUDE_CDS_JAVA_HEAP
< prev index next >