255 StringTable() : Hashtable<oop, mtSymbol>((int)StringTableSize,
256 sizeof (HashtableEntry<oop, mtSymbol>)) {}
257
258 StringTable(HashtableBucket<mtSymbol>* t, int number_of_entries)
259 : Hashtable<oop, mtSymbol>((int)StringTableSize, sizeof (HashtableEntry<oop, mtSymbol>), t,
260 number_of_entries) {}
261 public:
262 // The string table
263 static StringTable* the_table() { return _the_table; }
264
265 // Size of one bucket in the string table. Used when checking for rollover.
266 static uint bucket_size() { return sizeof(HashtableBucket<mtSymbol>); }
267
268 static void create_table() {
269 assert(_the_table == NULL, "One string table allowed.");
270 _the_table = new StringTable();
271 }
272
273 // GC support
274 // Delete pointers to otherwise-unreachable objects.
275 static void unlink(BoolObjectClosure* cl);
276
277 // Invoke "f->do_oop" on the locations of all oops in the table.
278 static void oops_do(OopClosure* f);
279
280 // Hashing algorithm, used as the hash value used by the
281 // StringTable for bucket selection and comparison (stored in the
282 // HashtableEntry structures). This is used in the String.intern() method.
283 static unsigned int hash_string(const jchar* s, int len);
284
285 // Internal test.
286 static void test_alt_hash() PRODUCT_RETURN;
287
288 // Probing
289 static oop lookup(Symbol* symbol);
290 static oop lookup(jchar* chars, int length);
291
292 // Interning
293 static oop intern(Symbol* symbol, TRAPS);
294 static oop intern(oop string, TRAPS);
295 static oop intern(const char *utf8_string, TRAPS);
|
255 StringTable() : Hashtable<oop, mtSymbol>((int)StringTableSize,
256 sizeof (HashtableEntry<oop, mtSymbol>)) {}
257
258 StringTable(HashtableBucket<mtSymbol>* t, int number_of_entries)
259 : Hashtable<oop, mtSymbol>((int)StringTableSize, sizeof (HashtableEntry<oop, mtSymbol>), t,
260 number_of_entries) {}
261 public:
262 // The string table
263 static StringTable* the_table() { return _the_table; }
264
265 // Size of one bucket in the string table. Used when checking for rollover.
266 static uint bucket_size() { return sizeof(HashtableBucket<mtSymbol>); }
267
268 static void create_table() {
269 assert(_the_table == NULL, "One string table allowed.");
270 _the_table = new StringTable();
271 }
272
273 // GC support
274 // Delete pointers to otherwise-unreachable objects.
275 static void unlink(BoolObjectClosure* cl, OopClosure* keep_alive);
276 static void unlink(BoolObjectClosure* cl) {
277 unlink(cl, NULL);
278 }
279
280 // Invoke "f->do_oop" on the locations of all oops in the table.
281 static void oops_do(OopClosure* f);
282
283 // Hashing algorithm, used as the hash value used by the
284 // StringTable for bucket selection and comparison (stored in the
285 // HashtableEntry structures). This is used in the String.intern() method.
286 static unsigned int hash_string(const jchar* s, int len);
287
288 // Internal test.
289 static void test_alt_hash() PRODUCT_RETURN;
290
291 // Probing
292 static oop lookup(Symbol* symbol);
293 static oop lookup(jchar* chars, int length);
294
295 // Interning
296 static oop intern(Symbol* symbol, TRAPS);
297 static oop intern(oop string, TRAPS);
298 static oop intern(const char *utf8_string, TRAPS);
|