--- old/src/share/vm/classfile/symbolTable.hpp 2014-04-25 14:05:10.000000000 -0500 +++ new/src/share/vm/classfile/symbolTable.hpp 2014-04-25 14:05:10.000000000 -0500 @@ -44,9 +44,9 @@ // Class to hold a newly created or referenced Symbol* temporarily in scope. -// new_symbol() and lookup() will create a Symbol* if not already in the +// new_symbol() and lookup_and_add() will create a Symbol* if not already in the // symbol table and add to the symbol's reference count. -// probe() and lookup_only() will increment the refcount if symbol is found. +// lookup_and_ignore_hash() and lookup_and_hash() will increment the refcount if symbol is found. class TempNewSymbol : public StackObj { Symbol* _temp; @@ -161,11 +161,12 @@ static unsigned int hash_symbol(const char* s, int len); - static Symbol* lookup(const char* name, int len, TRAPS); // lookup only, won't add. Also calculate hash. - static Symbol* lookup_only(const char* name, int len, unsigned int& hash); + static Symbol* lookup_and_hash(const char* name, int len, unsigned int& hash); + // lookup and add if lookup failed + static Symbol* lookup_and_add(const char* name, int len, TRAPS); // Only copy to C string to be added if lookup failed. - static Symbol* lookup(const Symbol* sym, int begin, int end, TRAPS); + static Symbol* lookup_and_add(const Symbol* sym, int begin, int end, TRAPS); static void release(Symbol* sym); @@ -173,8 +174,8 @@ static Symbol** lookup_symbol_addr(Symbol* sym); // jchar (utf16) version of lookups - static Symbol* lookup_unicode(const jchar* name, int len, TRAPS); - static Symbol* lookup_only_unicode(const jchar* name, int len, unsigned int& hash); + static Symbol* lookup_and_add_unicode(const jchar* name, int len, TRAPS); + static Symbol* lookup_and_hash_unicode(const jchar* name, int len, unsigned int& hash); static void add(ClassLoaderData* loader_data, constantPoolHandle cp, int names_count, @@ -197,14 +198,14 @@ // Symbol creation static Symbol* new_symbol(const char* utf8_buffer, int length, TRAPS) { assert(utf8_buffer != NULL, "just checking"); - return lookup(utf8_buffer, length, THREAD); + return lookup_and_add(utf8_buffer, length, THREAD); } static Symbol* new_symbol(const char* name, TRAPS) { return new_symbol(name, (int)strlen(name), THREAD); } static Symbol* new_symbol(const Symbol* sym, int begin, int end, TRAPS) { assert(begin <= end && end <= sym->utf8_length(), "just checking"); - return lookup(sym, begin, end, THREAD); + return lookup_and_add(sym, begin, end, THREAD); } // Create a symbol in the arena for symbols that are not deleted @@ -216,13 +217,13 @@ // Needed for preloading classes in signatures when compiling. // Returns the symbol is already present in symbol table, otherwise // NULL. NO ALLOCATION IS GUARANTEED! - static Symbol* probe(const char* name, int len) { + static Symbol* lookup_and_ignore_hash(const char* name, int len) { unsigned int ignore_hash; - return lookup_only(name, len, ignore_hash); + return lookup_and_hash(name, len, ignore_hash); } - static Symbol* probe_unicode(const jchar* name, int len) { + static Symbol* lookup_and_ignore_hash_unicode(const jchar* name, int len) { unsigned int ignore_hash; - return lookup_only_unicode(name, len, ignore_hash); + return lookup_and_hash_unicode(name, len, ignore_hash); } // Histogram