hotspot/src/share/vm/utilities/hashtable.hpp
changeset 46729 c62d2e8b2728
parent 46630 75aa3e39d02c
child 46742 24ec8a039c90
--- a/hotspot/src/share/vm/utilities/hashtable.hpp	Thu Jul 27 17:47:57 2017 -0700
+++ b/hotspot/src/share/vm/utilities/hashtable.hpp	Fri Jul 28 10:48:35 2017 -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<T, F>* new_entry(unsigned int hashValue, T obj);
+  // Don't create and use freelist of HashtableEntry.
+  HashtableEntry<T, F>* allocate_new_entry(unsigned int hashValue, T obj);
 
   // The following method is MT-safe and may be used with caution.
   HashtableEntry<T, F>* bucket(int i) const {
@@ -324,31 +326,4 @@
 template <class T, MEMFLAGS F> juint RehashableHashtable<T, F>::seed() { return _seed; };
 template <class T, MEMFLAGS F> bool  RehashableHashtable<T, F>::use_alternate_hashcode() { return _seed != 0; };
 
-// Versions of hashtable where two handles are used to compute the index.
-
-template <class T, MEMFLAGS F> class TwoOopHashtable : public Hashtable<T, F> {
-  friend class VMStructs;
-protected:
-  TwoOopHashtable(int table_size, int entry_size)
-    : Hashtable<T, F>(table_size, entry_size) {}
-
-  TwoOopHashtable(int table_size, int entry_size, HashtableBucket<F>* t,
-                  int number_of_entries)
-    : Hashtable<T, F>(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