6962930: make the string table size configurable

Reviewed-by: never, phh, stefank, kamg, dholmes, coleenp
This commit is contained in:
John Coomes 2011-03-21 18:38:00 -07:00
parent 31ac558f3d
commit 1ed31f9194
5 changed files with 32 additions and 29 deletions

View file

@ -216,18 +216,14 @@ private:
oop basic_add(int index, Handle string_or_null, jchar* name, int len,
unsigned int hashValue, TRAPS);
// Table size
enum {
string_table_size = 1009
};
oop lookup(int index, jchar* chars, int length, unsigned int hashValue);
StringTable() : Hashtable<oop>(string_table_size, sizeof (HashtableEntry<oop>)) {}
StringTable() : Hashtable<oop>((int)StringTableSize,
sizeof (HashtableEntry<oop>)) {}
StringTable(HashtableBucket* t, int number_of_entries)
: Hashtable<oop>(string_table_size, sizeof (HashtableEntry<oop>), t,
number_of_entries) {}
: Hashtable<oop>((int)StringTableSize, sizeof (HashtableEntry<oop>), t,
number_of_entries) {}
public:
// The string table
@ -241,7 +237,7 @@ public:
static void create_table(HashtableBucket* t, int length,
int number_of_entries) {
assert(_the_table == NULL, "One string table allowed.");
assert(length == string_table_size * sizeof(HashtableBucket),
assert((size_t)length == StringTableSize * sizeof(HashtableBucket),
"bad shared string size.");
_the_table = new StringTable(t, number_of_entries);
}