3149N/A * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// This is a generic hashtable, designed to be used for the symbol 0N/A// and string tables. 0N/A// It is implemented as an open hash table with a fixed number of buckets. 0N/A// - TableEntrys are allocated in blocks to reduce the space overhead. 0N/A unsigned int _hash;
// 32-bit hash for item 0N/A // Link to next element in the linked list for this bucket. EXCEPT 0N/A // bit 0 set indicates that this entry is shared and must not be 0N/A // unlinked from the table. Bit 0 is set during the dumping of the 0N/A // archive. Since shared entries are immutable, _next fields in the 0N/A // shared entries will not change. New entries will always be 0N/A // unshared and since pointers are align, bit 0 will always remain 0 0N/A // with no extra effort. 0N/A // Windows IA64 compiler requires subclasses to be able to access these 0N/A // Entry objects should not be created, they should be taken from the 0N/A // free list with BasicHashtable.new_entry(). 0N/A // Entry objects should not be destroyed. They should be placed on 0N/A // the free list instead with BasicHashtable.free_entry(). 0N/A // Instance variable 0N/A // The following methods use order access methods to avoid race 0N/A // conditions in multiprocessor systems. 0N/A // The following method is not MT-safe and must be done under lock. 0N/A // Reverse the order of elements in each of the buckets. 0N/A // Instance variables 0N/A // The following method is MT-safe and may be used with caution. 0N/A // The following method is not MT-safe and must be done under lock. 0N/A // Table entry management 3448N/A // Check that the table is unbalanced 3448N/A // Used when moving the entry to another table 3448N/A // Clean up links, but do not add to free_list 3448N/A // Move over freelist and free block for allocation 3448N/A // Free the buckets in this hashtable 0N/A // Reverse the order of elements in each of the buckets. Hashtable 0N/A // entries which refer to objects at a lower address than 'boundary' 0N/A // are separated from those which refer to objects at higher 0N/A // addresses, and appear first in the list. 0N/A // Table entry management 0N/A // The following method is MT-safe and may be used with caution. 0N/A // The following method is not MT-safe and must be done under lock. 3448N/A // Function to move these elements into the new table. 0N/A// Verions of hashtable where two handles are used to compute the index. 0N/A // Be careful with identity_hash(), it can safepoint and if this 0N/A // were one expression, the compiler could choose to unhandle each 0N/A // oop before calling identity_hash() for either of them. If the first 0N/A // causes a GC, the next would fail. 1879N/A#
endif // SHARE_VM_UTILITIES_HASHTABLE_HPP