diff -r a838e3707f3a -r e57e6addb978 src/hotspot/share/utilities/hashtable.cpp --- a/src/hotspot/share/utilities/hashtable.cpp Mon Apr 16 12:50:10 2018 +0530 +++ b/src/hotspot/share/utilities/hashtable.cpp Wed Apr 18 12:06:53 2018 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,6 +35,7 @@ #include "memory/metaspaceShared.hpp" #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" +#include "oops/weakHandle.inline.hpp" #include "runtime/safepoint.hpp" #include "utilities/dtrace.hpp" #include "utilities/hashtable.hpp" @@ -148,7 +149,6 @@ } // give the new table the free list as well new_table->copy_freelist(this); - assert(new_table->number_of_entries() == saved_entry_count, "lost entry on dictionary copy?"); // Destroy memory used by the buckets in the hashtable. The memory // for the elements has been used in a new table and is not @@ -263,6 +263,10 @@ } } +static int literal_size(ClassLoaderWeakHandle v) { + return literal_size(v.peek()); +} + template bool BasicHashtable::resize(int new_size) { assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint"); @@ -382,6 +386,13 @@ } #ifndef PRODUCT +template void print_literal(T l) { + l->print(); +} + +static void print_literal(ClassLoaderWeakHandle l) { + l.print(); +} template void Hashtable::print() { ResourceMark rm; @@ -390,7 +401,7 @@ HashtableEntry* entry = bucket(i); while(entry != NULL) { tty->print("%d : ", i); - entry->literal()->print(); + print_literal(entry->literal()); tty->cr(); entry = entry->next(); } @@ -443,21 +454,19 @@ #endif template class Hashtable; template class RehashableHashtable; -template class RehashableHashtable; +template class RehashableHashtable; template class Hashtable; template class Hashtable; template class Hashtable; -template class Hashtable; +template class Hashtable; template class Hashtable; -#if defined(SOLARIS) || defined(CHECK_UNHANDLED_OOPS) template class Hashtable; -template class RehashableHashtable; -#endif // SOLARIS || CHECK_UNHANDLED_OOPS -template class Hashtable; +template class Hashtable; template class Hashtable; template class HashtableEntry; template class HashtableEntry; template class HashtableEntry; +template class HashtableEntry; template class HashtableBucket; template class BasicHashtableEntry; template class BasicHashtableEntry;