Mercurial > hg > truffle
comparison src/share/vm/classfile/symbolTable.hpp @ 2378:924777755fad
6962930: make the string table size configurable
Reviewed-by: never, phh, stefank, kamg, dholmes, coleenp
author | jcoomes |
---|---|
date | Mon, 21 Mar 2011 18:38:00 -0700 |
parents | 3582bf76420e |
children | 352622fd140a |
comparison
equal
deleted
inserted
replaced
2377:57552dca1708 | 2378:924777755fad |
---|---|
214 | 214 |
215 static oop intern(Handle string_or_null, jchar* chars, int length, TRAPS); | 215 static oop intern(Handle string_or_null, jchar* chars, int length, TRAPS); |
216 oop basic_add(int index, Handle string_or_null, jchar* name, int len, | 216 oop basic_add(int index, Handle string_or_null, jchar* name, int len, |
217 unsigned int hashValue, TRAPS); | 217 unsigned int hashValue, TRAPS); |
218 | 218 |
219 // Table size | |
220 enum { | |
221 string_table_size = 1009 | |
222 }; | |
223 | |
224 oop lookup(int index, jchar* chars, int length, unsigned int hashValue); | 219 oop lookup(int index, jchar* chars, int length, unsigned int hashValue); |
225 | 220 |
226 StringTable() : Hashtable<oop>(string_table_size, sizeof (HashtableEntry<oop>)) {} | 221 StringTable() : Hashtable<oop>((int)StringTableSize, |
222 sizeof (HashtableEntry<oop>)) {} | |
227 | 223 |
228 StringTable(HashtableBucket* t, int number_of_entries) | 224 StringTable(HashtableBucket* t, int number_of_entries) |
229 : Hashtable<oop>(string_table_size, sizeof (HashtableEntry<oop>), t, | 225 : Hashtable<oop>((int)StringTableSize, sizeof (HashtableEntry<oop>), t, |
230 number_of_entries) {} | 226 number_of_entries) {} |
231 | 227 |
232 public: | 228 public: |
233 // The string table | 229 // The string table |
234 static StringTable* the_table() { return _the_table; } | 230 static StringTable* the_table() { return _the_table; } |
235 | 231 |
239 } | 235 } |
240 | 236 |
241 static void create_table(HashtableBucket* t, int length, | 237 static void create_table(HashtableBucket* t, int length, |
242 int number_of_entries) { | 238 int number_of_entries) { |
243 assert(_the_table == NULL, "One string table allowed."); | 239 assert(_the_table == NULL, "One string table allowed."); |
244 assert(length == string_table_size * sizeof(HashtableBucket), | 240 assert((size_t)length == StringTableSize * sizeof(HashtableBucket), |
245 "bad shared string size."); | 241 "bad shared string size."); |
246 _the_table = new StringTable(t, number_of_entries); | 242 _the_table = new StringTable(t, number_of_entries); |
247 } | 243 } |
248 | 244 |
249 static int hash_string(jchar* s, int len); | 245 static int hash_string(jchar* s, int len); |