hashtable.cpp revision 1879
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/safepoint.hpp"
#include "utilities/dtrace.hpp"
#include "utilities/hashtable.hpp"
#include "utilities/hashtable.inline.hpp"
void*, unsigned int, oop, void*);
// This is a generic hashtable, designed to be used for the symbol
// and string tables.
//
// It is implemented as an open hash table with a fixed number of buckets.
//
// %note:
// - HashtableEntrys are allocated in blocks to reduce the space overhead.
if (_free_list) {
entry = _free_list;
} else {
}
}
return entry;
}
return entry;
}
// GC support
// Readers of the table are unlocked, so we should only be removing
// entries at a safepoint.
for (int i = 0; i < table_size(); ++i) {
HashtableEntry* entry = *p;
break;
}
} else {
}
}
}
}
for (int i = 0; i < table_size(); ++i) {
HashtableEntry** p = bucket_addr(i);
// Did the closure remove the literal from the table?
} else {
}
}
}
}
// Reverse the order of elements in the hash buckets.
void BasicHashtable::reverse() {
for (int i = 0; i < _table_size; ++i) {
BasicHashtableEntry* p = bucket(i);
while (p != NULL) {
new_list = p;
p = next;
}
*bucket_addr(i) = new_list;
}
}
// Copy the table to the shared space.
// Dump the hash table entries.
int i;
for (i = 0; i < _table_size; ++i) {
*p != NULL;
p = (*p)->next_addr()) {
warning("\nThe shared miscellaneous data space is not large "
"enough to \npreload requested classes. Use "
"-XX:SharedMiscDataSize= to increase \nthe initial "
"size of the miscellaneous data space.\n");
exit(2);
}
*top += entry_size();
}
}
// Set the shared bit.
for (i = 0; i < _table_size; ++i) {
p->set_shared();
}
}
}
// Reverse the order of elements in the hash buckets.
for (int i = 0; i < table_size(); ++i) {
HashtableEntry* p = bucket(i);
while (p != NULL) {
high_list = p;
} else {
low_list = p;
if (last_low_entry == NULL) {
last_low_entry = p;
}
}
p = next;
}
*bucket_addr(i) = low_list;
} else {
*bucket_addr(i) = high_list;
}
}
}
// Dump the hash table buckets.
warning("\nThe shared miscellaneous data space is not large "
"enough to \npreload requested classes. Use "
"-XX:SharedMiscDataSize= to increase \nthe initial "
"size of the miscellaneous data space.\n");
exit(2);
}
}
#ifndef PRODUCT
for (int i = 0; i < table_size(); i++) {
}
}
}
void BasicHashtable::verify() {
int count = 0;
for (int i = 0; i < table_size(); i++) {
++count;
}
}
}
#endif // PRODUCT
#ifdef ASSERT
warning("Performance bug: SystemDictionary lookup_count=%d "
"lookup_length=%d average=%lf load=%f",
}
}
#endif