< prev index next >

src/hotspot/share/classfile/stringTable.hpp

Print this page


  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_CLASSFILE_STRINGTABLE_HPP
  26 #define SHARE_VM_CLASSFILE_STRINGTABLE_HPP
  27 
  28 #include "gc/shared/oopStorage.hpp"
  29 #include "gc/shared/oopStorageParState.hpp"
  30 #include "memory/allocation.hpp"
  31 #include "memory/padded.hpp"
  32 #include "oops/oop.hpp"
  33 #include "oops/weakHandle.hpp"
  34 #include "utilities/concurrentHashTable.hpp"
  35 
  36 template <class T, class N> class CompactHashtable;
  37 class CompactStringTableWriter;
  38 class SerializeClosure;
  39 
  40 class StringTable;
  41 class StringTableConfig;
  42 typedef ConcurrentHashTable<WeakHandle<vm_string_table_data>,
  43                             StringTableConfig, mtSymbol> StringTableHash;
  44 
  45 class StringTableCreateEntry;
  46 
  47 class StringTable : public CHeapObj<mtSymbol>{
  48   friend class VMStructs;
  49   friend class Symbol;
  50   friend class StringTableConfig;
  51   friend class StringTableCreateEntry;
  52 
  53 private:
  54   void grow(JavaThread* jt);
  55   void clean_dead_entries(JavaThread* jt);
  56 
  57   // The string table
  58   static StringTable* _the_table;
  59   // Shared string table
  60   static CompactHashtable<oop, char> _shared_table;
  61   static volatile bool _shared_string_mapped;
  62   static volatile bool _alt_hash;
  63 
  64 private:
  65 
  66   StringTableHash* _local_table;
  67   size_t _current_size;
  68   volatile bool _has_work;
  69   // Set if one bucket is out of balance due to hash algorithm deficiency
  70   volatile bool _needs_rehashing;
  71 
  72   OopStorage* _weak_handles;
  73 
  74   volatile size_t _items_count;
  75   DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile size_t));
  76   volatile size_t _uncleaned_items_count;
  77   DEFINE_PAD_MINUS_SIZE(2, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile size_t));
  78 
  79   double get_load_factor();
  80   double get_dead_factor();




  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_CLASSFILE_STRINGTABLE_HPP
  26 #define SHARE_VM_CLASSFILE_STRINGTABLE_HPP
  27 
  28 #include "gc/shared/oopStorage.hpp"
  29 #include "gc/shared/oopStorageParState.hpp"
  30 #include "memory/allocation.hpp"
  31 #include "memory/padded.hpp"
  32 #include "oops/oop.hpp"
  33 #include "oops/weakHandle.hpp"
  34 #include "utilities/concurrentHashTable.hpp"
  35 

  36 class CompactStringTableWriter;
  37 class SerializeClosure;
  38 
  39 class StringTable;
  40 class StringTableConfig;
  41 typedef ConcurrentHashTable<WeakHandle<vm_string_table_data>,
  42                             StringTableConfig, mtSymbol> StringTableHash;
  43 
  44 class StringTableCreateEntry;
  45 
  46 class StringTable : public CHeapObj<mtSymbol>{
  47   friend class VMStructs;
  48   friend class Symbol;
  49   friend class StringTableConfig;
  50   friend class StringTableCreateEntry;
  51 
  52 private:
  53   void grow(JavaThread* jt);
  54   void clean_dead_entries(JavaThread* jt);
  55 
  56   // The string table
  57   static StringTable* _the_table;


  58   static volatile bool _shared_string_mapped;
  59   static volatile bool _alt_hash;
  60 
  61 private:
  62 
  63   StringTableHash* _local_table;
  64   size_t _current_size;
  65   volatile bool _has_work;
  66   // Set if one bucket is out of balance due to hash algorithm deficiency
  67   volatile bool _needs_rehashing;
  68 
  69   OopStorage* _weak_handles;
  70 
  71   volatile size_t _items_count;
  72   DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile size_t));
  73   volatile size_t _uncleaned_items_count;
  74   DEFINE_PAD_MINUS_SIZE(2, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile size_t));
  75 
  76   double get_load_factor();
  77   double get_dead_factor();


< prev index next >