< prev index next >

src/hotspot/share/utilities/hashtable.hpp

Print this page




  14  *
  15  * You should have received a copy of the GNU General Public License version
  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_UTILITIES_HASHTABLE_HPP
  26 #define SHARE_VM_UTILITIES_HASHTABLE_HPP
  27 
  28 #include "classfile/classLoaderData.hpp"
  29 #include "memory/allocation.hpp"
  30 #include "oops/oop.hpp"
  31 #include "oops/symbol.hpp"
  32 #include "runtime/handles.hpp"
  33 



  34 // This is a generic hashtable, designed to be used for the symbol
  35 // and string tables.
  36 //
  37 // It is implemented as an open hash table with a fixed number of buckets.
  38 //
  39 // %note:
  40 //  - TableEntrys are allocated in blocks to reduce the space overhead.
  41 
  42 
  43 
  44 template <MEMFLAGS F> class BasicHashtableEntry : public CHeapObj<F> {
  45   friend class VMStructs;
  46 private:
  47   unsigned int         _hash;           // 32-bit hash for item
  48 
  49   // Link to next element in the linked list for this bucket.  EXCEPT
  50   // bit 0 set indicates that this entry is shared and must not be
  51   // unlinked from the table. Bit 0 is set during the dumping of the
  52   // archive. Since shared entries are immutable, _next fields in the
  53   // shared entries will not change.  New entries will always be




  14  *
  15  * You should have received a copy of the GNU General Public License version
  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_UTILITIES_HASHTABLE_HPP
  26 #define SHARE_VM_UTILITIES_HASHTABLE_HPP
  27 
  28 #include "classfile/classLoaderData.hpp"
  29 #include "memory/allocation.hpp"
  30 #include "oops/oop.hpp"
  31 #include "oops/symbol.hpp"
  32 #include "runtime/handles.hpp"
  33 
  34 // Version for StringTable and SymbolTable
  35 #define HASHTABLE_VERSION "VERSION: 1.1"
  36 
  37 // This is a generic hashtable, designed to be used for the symbol
  38 // and string tables.
  39 //
  40 // It is implemented as an open hash table with a fixed number of buckets.
  41 //
  42 // %note:
  43 //  - TableEntrys are allocated in blocks to reduce the space overhead.
  44 
  45 
  46 
  47 template <MEMFLAGS F> class BasicHashtableEntry : public CHeapObj<F> {
  48   friend class VMStructs;
  49 private:
  50   unsigned int         _hash;           // 32-bit hash for item
  51 
  52   // Link to next element in the linked list for this bucket.  EXCEPT
  53   // bit 0 set indicates that this entry is shared and must not be
  54   // unlinked from the table. Bit 0 is set during the dumping of the
  55   // archive. Since shared entries are immutable, _next fields in the
  56   // shared entries will not change.  New entries will always be


< prev index next >