mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-25 22:04:51 +02:00
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:
parent
388d803077
commit
a4300aa98b
5 changed files with 94 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue