Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 11 additions & 21 deletions src/hotspot/share/classfile/symbolTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,7 @@ inline bool symbol_equals_compact_hashtable_entry(Symbol* value, const char* key
static OffsetCompactHashtable<
const char*, Symbol*,
symbol_equals_compact_hashtable_entry
> _shared_table;

static OffsetCompactHashtable<
const char*, Symbol*,
symbol_equals_compact_hashtable_entry
> _dynamic_shared_table;
> _shared_table, _dynamic_shared_table, _shared_table_for_dumping;

// --------------------------------------------------------------------------

Expand Down Expand Up @@ -708,29 +703,24 @@ void SymbolTable::copy_shared_symbol_table(GrowableArray<Symbol*>* symbols,
void SymbolTable::write_to_archive(GrowableArray<Symbol*>* symbols) {
CompactHashtableWriter writer(int(_items_count), ArchiveBuilder::symbol_stats());
copy_shared_symbol_table(symbols, &writer);
if (CDSConfig::is_dumping_static_archive()) {
_shared_table.reset();
writer.dump(&_shared_table, "symbol");
} else {
assert(CDSConfig::is_dumping_dynamic_archive(), "must be");
_dynamic_shared_table.reset();
writer.dump(&_dynamic_shared_table, "symbol");
}
_shared_table_for_dumping.reset();
writer.dump(&_shared_table_for_dumping, "symbol");
}

void SymbolTable::serialize_shared_table_header(SerializeClosure* soc,
bool is_static_archive) {
OffsetCompactHashtable<const char*, Symbol*, symbol_equals_compact_hashtable_entry> * table;
if (is_static_archive) {
table = &_shared_table;
if (soc->reading()) {
if (is_static_archive) {
table = &_shared_table;
} else {
table = &_dynamic_shared_table;
}
} else {
table = &_dynamic_shared_table;
table = &_shared_table_for_dumping;
}

table->serialize_header(soc);
if (soc->writing()) {
// Sanity. Make sure we don't use the shared table at dump time
table->reset();
}
}
#endif //INCLUDE_CDS

Expand Down