< prev index next >

src/hotspot/share/classfile/stringTable.hpp

Print this page

        

*** 56,91 **** // The string table static StringTable* _the_table; // Shared string table static CompactHashtable<oop, char> _shared_table; ! static bool _shared_string_mapped; ! static bool _alt_hash; private: - // Set if one bucket is out of balance due to hash algorithm deficiency StringTableHash* _local_table; size_t _current_size; volatile bool _has_work; volatile bool _needs_rehashing; OopStorage* _weak_handles; ! volatile size_t _items; DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile size_t)); ! volatile size_t _uncleaned_items; DEFINE_PAD_MINUS_SIZE(2, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile size_t)); double get_load_factor(); double get_dead_factor(); void check_concurrent_work(); void trigger_concurrent_work(); static size_t item_added(); static void item_removed(); ! size_t add_items_to_clean(size_t ndead); StringTable(); static oop intern(Handle string_or_null_h, jchar* name, int len, TRAPS); oop do_intern(Handle string_or_null, jchar* name, int len, uintx hash, TRAPS); --- 56,92 ---- // The string table static StringTable* _the_table; // Shared string table static CompactHashtable<oop, char> _shared_table; ! static volatile bool _shared_string_mapped; ! static volatile bool _alt_hash; ! private: StringTableHash* _local_table; size_t _current_size; volatile bool _has_work; + // Set if one bucket is out of balance due to hash algorithm deficiency volatile bool _needs_rehashing; OopStorage* _weak_handles; ! volatile size_t _items_count; DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile size_t)); ! volatile size_t _uncleaned_items_count; DEFINE_PAD_MINUS_SIZE(2, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile size_t)); double get_load_factor(); double get_dead_factor(); void check_concurrent_work(); void trigger_concurrent_work(); static size_t item_added(); static void item_removed(); ! size_t add_items_count_to_clean(size_t ndead); StringTable(); static oop intern(Handle string_or_null_h, jchar* name, int len, TRAPS); oop do_intern(Handle string_or_null, jchar* name, int len, uintx hash, TRAPS);
*** 98,108 **** bool do_rehash(); public: // The string table static StringTable* the_table() { return _the_table; } ! size_t table_size(Thread* thread = NULL); static OopStorage* weak_storage() { return the_table()->_weak_handles; } static void create_table() { assert(_the_table == NULL, "One string table allowed."); --- 99,109 ---- bool do_rehash(); public: // The string table static StringTable* the_table() { return _the_table; } ! size_t table_size(); static OopStorage* weak_storage() { return the_table()->_weak_handles; } static void create_table() { assert(_the_table == NULL, "One string table allowed.");
*** 114,135 **** // GC support // Must be called before a parallel walk where strings might die. static void reset_dead_counter() { ! the_table()->_uncleaned_items = 0; } // After the parallel walk this method must be called to trigger // cleaning. Note it might trigger a resize instead. static void finish_dead_counter() { the_table()->check_concurrent_work(); } // If GC uses ParState directly it should add the number of cleared // strings to this method. static void inc_dead_counter(size_t ndead) { ! the_table()->add_items_to_clean(ndead); } // Delete pointers to otherwise-unreachable objects. static void unlink(BoolObjectClosure* cl) { unlink_or_oops_do(cl); --- 115,136 ---- // GC support // Must be called before a parallel walk where strings might die. static void reset_dead_counter() { ! the_table()->_uncleaned_items_count = 0; } // After the parallel walk this method must be called to trigger // cleaning. Note it might trigger a resize instead. static void finish_dead_counter() { the_table()->check_concurrent_work(); } // If GC uses ParState directly it should add the number of cleared // strings to this method. static void inc_dead_counter(size_t ndead) { ! the_table()->add_items_count_to_clean(ndead); } // Delete pointers to otherwise-unreachable objects. static void unlink(BoolObjectClosure* cl) { unlink_or_oops_do(cl);
< prev index next >