8009763: Add WB test for String.intern()

Add convenience method in StringTable, add WhiteBox method and simple sanity test

Reviewed-by: mgerdin, zgu
This commit is contained in:
Leonid Mesnik 2013-04-02 11:28:33 +02:00 committed by Mikael Gerdin
parent 388d803077
commit a4300aa98b
5 changed files with 94 additions and 3 deletions

View file

@ -677,9 +677,14 @@ oop StringTable::lookup(Symbol* symbol) {
ResourceMark rm;
int length;
jchar* chars = symbol->as_unicode(length);
unsigned int hashValue = hash_string(chars, length);
int index = the_table()->hash_to_index(hashValue);
return the_table()->lookup(index, chars, length, hashValue);
return lookup(chars, length);
}
oop StringTable::lookup(jchar* name, int len) {
unsigned int hash = hash_string(name, len);
int index = the_table()->hash_to_index(hash);
return the_table()->lookup(index, name, len, hash);
}