< prev index next >

src/share/vm/utilities/hashtable.hpp

Print this page




 153 
 154   // Bucket handling
 155   int hash_to_index(unsigned int full_hash) const {
 156     int h = full_hash % _table_size;
 157     assert(h >= 0 && h < _table_size, "Illegal hash value");
 158     return h;
 159   }
 160 
 161 private:
 162   // Instance variables
 163   int               _table_size;
 164   HashtableBucket<F>*     _buckets;
 165   BasicHashtableEntry<F>* volatile _free_list;
 166   char*             _first_free_entry;
 167   char*             _end_block;
 168   int               _entry_size;
 169   volatile int      _number_of_entries;
 170 
 171 protected:
 172 
 173 #ifdef ASSERT
 174   void verify_lookup_length(int max_bucket_count, const char *table_name);
 175 #endif
 176 
 177   void initialize(int table_size, int entry_size, int number_of_entries);
 178 
 179   // Accessor
 180   int entry_size() const { return _entry_size; }
 181 
 182   // The following method is MT-safe and may be used with caution.
 183   BasicHashtableEntry<F>* bucket(int i) const;
 184 
 185   // The following method is not MT-safe and must be done under lock.
 186   BasicHashtableEntry<F>** bucket_addr(int i) { return _buckets[i].entry_addr(); }
 187 
 188   // Attempt to get an entry from the free list
 189   BasicHashtableEntry<F>* new_entry_free_list();
 190 
 191   // Table entry management
 192   BasicHashtableEntry<F>* new_entry(unsigned int hashValue);
 193 
 194   // Used when moving the entry to another table
 195   // Clean up links, but do not add to free_list
 196   void unlink_entry(BasicHashtableEntry<F>* entry) {




 153 
 154   // Bucket handling
 155   int hash_to_index(unsigned int full_hash) const {
 156     int h = full_hash % _table_size;
 157     assert(h >= 0 && h < _table_size, "Illegal hash value");
 158     return h;
 159   }
 160 
 161 private:
 162   // Instance variables
 163   int               _table_size;
 164   HashtableBucket<F>*     _buckets;
 165   BasicHashtableEntry<F>* volatile _free_list;
 166   char*             _first_free_entry;
 167   char*             _end_block;
 168   int               _entry_size;
 169   volatile int      _number_of_entries;
 170 
 171 protected:
 172 




 173   void initialize(int table_size, int entry_size, int number_of_entries);
 174 
 175   // Accessor
 176   int entry_size() const { return _entry_size; }
 177 
 178   // The following method is MT-safe and may be used with caution.
 179   BasicHashtableEntry<F>* bucket(int i) const;
 180 
 181   // The following method is not MT-safe and must be done under lock.
 182   BasicHashtableEntry<F>** bucket_addr(int i) { return _buckets[i].entry_addr(); }
 183 
 184   // Attempt to get an entry from the free list
 185   BasicHashtableEntry<F>* new_entry_free_list();
 186 
 187   // Table entry management
 188   BasicHashtableEntry<F>* new_entry(unsigned int hashValue);
 189 
 190   // Used when moving the entry to another table
 191   // Clean up links, but do not add to free_list
 192   void unlink_entry(BasicHashtableEntry<F>* entry) {


< prev index next >