mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-25 13:54:38 +02:00
8015428: Remove unused CDS support from StringTable
The string in StringTable is not used by CDS anymore. Remove the unnecessary code in preparation for 8015422: Large performance hit when the StringTable is walked twice in Parallel Scavenge Reviewed-by: pliden, tschatzl, coleenp
This commit is contained in:
parent
2ccd92e927
commit
8b7d3c5d3b
1 changed files with 7 additions and 20 deletions
|
@ -745,41 +745,28 @@ void StringTable::unlink(BoolObjectClosure* is_alive) {
|
|||
HashtableEntry<oop, mtSymbol>** p = the_table()->bucket_addr(i);
|
||||
HashtableEntry<oop, mtSymbol>* entry = the_table()->bucket(i);
|
||||
while (entry != NULL) {
|
||||
// Shared entries are normally at the end of the bucket and if we run into
|
||||
// a shared entry, then there is nothing more to remove. However, if we
|
||||
// have rehashed the table, then the shared entries are no longer at the
|
||||
// end of the bucket.
|
||||
if (entry->is_shared() && !use_alternate_hashcode()) {
|
||||
break;
|
||||
}
|
||||
assert(entry->literal() != NULL, "just checking");
|
||||
if (entry->is_shared() || is_alive->do_object_b(entry->literal())) {
|
||||
assert(!entry->is_shared(), "CDS not used for the StringTable");
|
||||
|
||||
if (is_alive->do_object_b(entry->literal())) {
|
||||
p = entry->next_addr();
|
||||
} else {
|
||||
*p = entry->next();
|
||||
the_table()->free_entry(entry);
|
||||
}
|
||||
entry = (HashtableEntry<oop, mtSymbol>*)HashtableEntry<oop, mtSymbol>::make_ptr(*p);
|
||||
entry = *p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StringTable::oops_do(OopClosure* f) {
|
||||
for (int i = 0; i < the_table()->table_size(); ++i) {
|
||||
HashtableEntry<oop, mtSymbol>** p = the_table()->bucket_addr(i);
|
||||
HashtableEntry<oop, mtSymbol>* entry = the_table()->bucket(i);
|
||||
while (entry != NULL) {
|
||||
assert(!entry->is_shared(), "CDS not used for the StringTable");
|
||||
|
||||
f->do_oop((oop*)entry->literal_addr());
|
||||
|
||||
// Did the closure remove the literal from the table?
|
||||
if (entry->literal() == NULL) {
|
||||
assert(!entry->is_shared(), "immutable hashtable entry?");
|
||||
*p = entry->next();
|
||||
the_table()->free_entry(entry);
|
||||
} else {
|
||||
p = entry->next_addr();
|
||||
}
|
||||
entry = (HashtableEntry<oop, mtSymbol>*)HashtableEntry<oop, mtSymbol>::make_ptr(*p);
|
||||
entry = entry->next();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue