< prev index next > src/hotspot/share/classfile/stringTable.cpp
Print this page
if (_items_count > (size_t)max_jint) {
fatal("Too many strings to be archived: %zu", _items_count);
}
int total = (int)_items_count;
! size_t single_array_size = objArrayOopDesc::object_size(total);
log_info(aot)("allocated string table for %d strings", total);
if (!ArchiveHeapWriter::is_too_large_to_archive(single_array_size)) {
// The entire table can fit in a single array
if (_items_count > (size_t)max_jint) {
fatal("Too many strings to be archived: %zu", _items_count);
}
int total = (int)_items_count;
! size_t single_array_size = refArrayOopDesc::object_size(total);
log_info(aot)("allocated string table for %d strings", total);
if (!ArchiveHeapWriter::is_too_large_to_archive(single_array_size)) {
// The entire table can fit in a single array
_shared_strings_array = OopHandle(Universe::vm_global(), array);
log_info(aot)("string table array (single level) length = %d", total);
} else {
// Split the table in two levels of arrays.
int primary_array_length = (total + _secondary_array_max_length - 1) / _secondary_array_max_length;
! size_t primary_array_size = objArrayOopDesc::object_size(primary_array_length);
! size_t secondary_array_size = objArrayOopDesc::object_size(_secondary_array_max_length);
if (ArchiveHeapWriter::is_too_large_to_archive(secondary_array_size)) {
// This can only happen if you have an extremely large number of classes that
// refer to more than 16384 * 16384 = 26M interned strings! Not a practical concern
// but bail out for safety.
_shared_strings_array = OopHandle(Universe::vm_global(), array);
log_info(aot)("string table array (single level) length = %d", total);
} else {
// Split the table in two levels of arrays.
int primary_array_length = (total + _secondary_array_max_length - 1) / _secondary_array_max_length;
! size_t primary_array_size = refArrayOopDesc::object_size(primary_array_length);
! size_t secondary_array_size = refArrayOopDesc::object_size(_secondary_array_max_length);
if (ArchiveHeapWriter::is_too_large_to_archive(secondary_array_size)) {
// This can only happen if you have an extremely large number of classes that
// refer to more than 16384 * 16384 = 26M interned strings! Not a practical concern
// but bail out for safety.
#ifndef PRODUCT
void StringTable::verify_secondary_array_index_bits() {
int max;
for (max = 1; ; max++) {
! size_t next_size = objArrayOopDesc::object_size(1 << (max + 1));
if (ArchiveHeapWriter::is_too_large_to_archive(next_size)) {
break;
}
}
// Currently max is 17 for +UseCompressedOops, 16 for -UseCompressedOops.
#ifndef PRODUCT
void StringTable::verify_secondary_array_index_bits() {
int max;
for (max = 1; ; max++) {
! size_t next_size = refArrayOopDesc::object_size(1 << (max + 1));
if (ArchiveHeapWriter::is_too_large_to_archive(next_size)) {
break;
}
}
// Currently max is 17 for +UseCompressedOops, 16 for -UseCompressedOops.
< prev index next >