--- old/src/hotspot/share/classfile/compactHashtable.hpp 2018-09-20 11:16:34.500945765 -0700 +++ new/src/hotspot/share/classfile/compactHashtable.hpp 2018-09-20 11:16:34.232935526 -0700 @@ -123,6 +123,15 @@ public: void dump(SimpleCompactHashtable *cht, const char* table_name); + + static int default_num_buckets(size_t num_entries) { + return default_num_buckets((int)num_entries); + } + static int default_num_buckets(int num_entries) { + int num_buckets = num_entries / SharedSymbolTableBucketSize; + // calculation of num_buckets can result in zero buckets, we need at least one + return (num_buckets < 1) ? 1 : num_buckets; + } }; #endif // INCLUDE_CDS