--- old/src/share/vm/classfile/stringTable.hpp 2015-05-29 14:23:21.110438149 -0400 +++ new/src/share/vm/classfile/stringTable.hpp 2015-05-29 14:23:20.122381340 -0400 @@ -28,6 +28,10 @@ #include "memory/allocation.inline.hpp" #include "utilities/hashtable.hpp" +template class CompactHashtable; +class CompactHashtableWriter; +class FileMapInfo; + class StringTable : public RehashableHashtable { friend class VMStructs; friend class Symbol; @@ -36,17 +40,22 @@ // The string table static StringTable* _the_table; + // Shared string table + static CompactHashtable _shared_table; + static bool _ignore_shared_strings; + // Set if one bucket is out of balance due to hash algorithm deficiency static bool _needs_rehashing; // Claimed high water mark for parallel chunked scanning static volatile int _parallel_claimed_idx; - + static oop intern(Handle string_or_null, jchar* chars, int length, TRAPS); oop basic_add(int index, Handle string_or_null, jchar* name, int len, unsigned int hashValue, TRAPS); - oop lookup(int index, jchar* chars, int length, unsigned int hashValue); + oop lookup_dynamic(int index, jchar* chars, int length, unsigned int hashValue); + static oop lookup_shared(jchar* name, int len); // Apply the give oop closure to the entries to the buckets // in the range [start_idx, end_idx). @@ -141,12 +150,14 @@ static int verify_and_compare_entries(); // Sharing - static void copy_buckets(char** top, char*end) { - the_table()->Hashtable::copy_buckets(top, end); - } - static void copy_table(char** top, char*end) { - the_table()->Hashtable::copy_table(top, end); - } + static void ignore_shared_strings(bool v) { _ignore_shared_strings = v; } + static bool shared_string_ignored() { return _ignore_shared_strings; } + static void shared_oops_do(OopClosure* f); + static bool copy_shared_string(GrowableArray *string_space, + CompactHashtableWriter* ch_table); + static bool copy_compact_table(char** top, char* end, GrowableArray *string_space, + size_t* space_size); + static const char* init_shared_table(FileMapInfo *mapinfo, char* buffer); static void reverse() { the_table()->Hashtable::reverse(); }