hotspot/src/share/vm/utilities/hashtable.cpp
changeset 13728 882756847a04
parent 13342 76a5de64aa62
child 17610 c6857feaac47
--- a/hotspot/src/share/vm/utilities/hashtable.cpp	Fri Aug 31 16:39:35 2012 -0700
+++ b/hotspot/src/share/vm/utilities/hashtable.cpp	Sat Sep 01 13:25:18 2012 -0400
@@ -94,20 +94,6 @@
 
 template <class T, MEMFLAGS F> jint Hashtable<T, F>::_seed = 0;
 
-template <class T, MEMFLAGS F> unsigned int Hashtable<T, F>::new_hash(Symbol* sym) {
-  ResourceMark rm;
-  // Use alternate hashing algorithm on this symbol.
-  return AltHashing::murmur3_32(seed(), (const jbyte*)sym->as_C_string(), sym->utf8_length());
-}
-
-template <class T, MEMFLAGS F> unsigned int Hashtable<T, F>::new_hash(oop string) {
-  ResourceMark rm;
-  int length;
-  jchar* chars = java_lang_String::as_unicode_string(string, length);
-  // Use alternate hashing algorithm on the string
-  return AltHashing::murmur3_32(seed(), chars, length);
-}
-
 // Create a new table and using alternate hash code, populate the new table
 // with the existing elements.   This can be used to change the hash code
 // and could in the future change the size of the table.
@@ -126,7 +112,7 @@
       HashtableEntry<T, F>* next = p->next();
       T string = p->literal();
       // Use alternate hashing algorithm on the symbol in the first table
-      unsigned int hashValue = new_hash(string);
+      unsigned int hashValue = string->new_hash(seed());
       // Get a new index relative to the new table (can also change size)
       int index = new_table->hash_to_index(hashValue);
       p->set_hash(hashValue);
@@ -314,9 +300,9 @@
 
 #endif
 // Explicitly instantiate these types
-template class Hashtable<constantPoolOop, mtClass>;
+template class Hashtable<ConstantPool*, mtClass>;
 template class Hashtable<Symbol*, mtSymbol>;
-template class Hashtable<klassOop, mtClass>;
+template class Hashtable<Klass*, mtClass>;
 template class Hashtable<oop, mtClass>;
 #ifdef SOLARIS
 template class Hashtable<oop, mtSymbol>;