Skip to content


8292556: Clean up unused Hashtable instantiations
Browse files Browse the repository at this point in the history
Reviewed-by: hseigel, dholmes
  • Loading branch information
coleenp committed Aug 18, 2022
1 parent d543564 commit f2773f6
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions src/hotspot/share/utilities/hashtable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ template <MEMFLAGS F> void BasicHashtable<F>::free_buckets() {
// Default overload, for types that are uninteresting.
template<typename T> static size_t literal_size(T) { return 0; }

static size_t literal_size(Symbol *symbol) {
return symbol->size() * HeapWordSize;

static size_t literal_size(oop obj) {
if (obj == NULL) {
return 0;
Expand Down Expand Up @@ -258,26 +254,14 @@ template <class T> void BasicHashtable<F>::verify_table(const char* table_name)
#endif // PRODUCT

// Explicitly instantiate these types
template class Hashtable<nmethod*, mtGC>;
template class HashtableEntry<nmethod*, mtGC>;
template class BasicHashtable<mtGC>;
template class Hashtable<ConstantPool*, mtClass>;
template class Hashtable<Klass*, mtClass>;
template class BasicHashtable<mtClass>;
template class BasicHashtable<mtServiceability>;

template class Hashtable<nmethod*, mtGC>;
template class Hashtable<InstanceKlass*, mtClass>;
template class Hashtable<WeakHandle, mtClass>;
template class Hashtable<WeakHandle, mtServiceability>;
template class Hashtable<Symbol*, mtModule>;
template class Hashtable<Symbol*, mtClass>;
template class HashtableEntry<Symbol*, mtClass>;
template class HashtableBucket<mtClass>;
template class BasicHashtableEntry<mtSymbol>;
template class BasicHashtable<mtClass>;
template class BasicHashtable<mtClassShared>;
template class BasicHashtable<mtInternal>;
template class BasicHashtable<mtModule>;
template class BasicHashtable<mtCompiler>;
template class BasicHashtable<mtServiceability>;
template class BasicHashtable<mtLogging>;

template void BasicHashtable<mtClass>::verify_table<DictionaryEntry>(char const*);
template void BasicHashtable<mtClass>::verify_table<ProtectionDomainCacheEntry>(char const*);

1 comment on commit f2773f6

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.