diff src/share/vm/utilities/hashtable.cpp @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents 5e2dc722e70d
children a5d6f0c3585f
line wrap: on
line diff
--- a/src/share/vm/utilities/hashtable.cpp	Fri Aug 31 16:39:35 2012 -0700
+++ b/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>;