--- old/src/share/vm/utilities/hashtable.hpp 2017-07-21 13:45:13.224660383 -0400 +++ new/src/share/vm/utilities/hashtable.hpp 2017-07-21 13:45:12.992274106 -0400 @@ -253,18 +253,20 @@ // Debugging void print() PRODUCT_RETURN; -protected: - - unsigned int compute_hash(Symbol* name) { + unsigned int compute_hash(const Symbol* name) const { return (unsigned int) name->identity_hash(); } - int index_for(Symbol* name) { + int index_for(const Symbol* name) const { return this->hash_to_index(compute_hash(name)); } +protected: + // Table entry management HashtableEntry* new_entry(unsigned int hashValue, T obj); + // Don't create and use freelist of HashtableEntry. + HashtableEntry* allocate_new_entry(unsigned int hashValue, T obj); // The following method is MT-safe and may be used with caution. HashtableEntry* bucket(int i) const { @@ -324,31 +326,4 @@ template juint RehashableHashtable::seed() { return _seed; }; template bool RehashableHashtable::use_alternate_hashcode() { return _seed != 0; }; -// Versions of hashtable where two handles are used to compute the index. - -template class TwoOopHashtable : public Hashtable { - friend class VMStructs; -protected: - TwoOopHashtable(int table_size, int entry_size) - : Hashtable(table_size, entry_size) {} - - TwoOopHashtable(int table_size, int entry_size, HashtableBucket* t, - int number_of_entries) - : Hashtable(table_size, entry_size, t, number_of_entries) {} - -public: - unsigned int compute_hash(const Symbol* name, const ClassLoaderData* loader_data) const { - unsigned int name_hash = name->identity_hash(); - // loader is null with CDS - assert(loader_data != NULL || UseSharedSpaces || DumpSharedSpaces, - "only allowed with shared spaces"); - unsigned int loader_hash = loader_data == NULL ? 0 : loader_data->identity_hash(); - return name_hash ^ loader_hash; - } - - int index_for(Symbol* name, ClassLoaderData* loader_data) { - return this->hash_to_index(compute_hash(name, loader_data)); - } -}; - #endif // SHARE_VM_UTILITIES_HASHTABLE_HPP