mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-24 06:40:05 +00:00
8079840: G1StringDedupTable::deduplicate() reset String hash value unnecessarily
Only set hash value if String's hash value was 0. Reviewed-by: pliden, brutisso
This commit is contained in:
parent
961389c6ef
commit
cb51ce598c
@ -310,11 +310,11 @@ void G1StringDedupTable::deduplicate(oop java_string, G1StringDedupStat& stat) {
|
||||
// Compute hash
|
||||
hash = hash_code(value);
|
||||
stat.inc_hashed();
|
||||
}
|
||||
|
||||
if (use_java_hash() && hash != 0) {
|
||||
// Store hash code in cache
|
||||
java_lang_String::set_hash(java_string, hash);
|
||||
if (use_java_hash() && hash != 0) {
|
||||
// Store hash code in cache
|
||||
java_lang_String::set_hash(java_string, hash);
|
||||
}
|
||||
}
|
||||
|
||||
typeArrayOop existing_value = lookup_or_add(value, hash);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user