# HG changeset patch # User stefank # Date 1527061421 -7200 # Node ID 48d4abe945f186e371633fcabee5aeb20d44cd4b # Parent 3c6dc4b291cd17fe88d9c1490d538a1fb61319b7 8203490: StringTable::dump lacks a load barrier Reviewed-by: coleenp, pliden diff -r 3c6dc4b291cd -r 48d4abe945f1 src/hotspot/share/classfile/stringTable.cpp --- a/src/hotspot/share/classfile/stringTable.cpp Wed May 23 09:42:42 2018 +0200 +++ b/src/hotspot/share/classfile/stringTable.cpp Wed May 23 09:43:41 2018 +0200 @@ -434,7 +434,7 @@ void StringTable::dump(outputStream* st, bool verbose) { if (!verbose) { - the_table()->print_table_statistics(st, "StringTable"); + the_table()->print_table_statistics(st, "StringTable", string_object_no_keepalive); } else { Thread* THREAD = Thread::current(); st->print_cr("VERSION: 1.1"); diff -r 3c6dc4b291cd -r 48d4abe945f1 src/hotspot/share/utilities/hashtable.cpp --- a/src/hotspot/share/utilities/hashtable.cpp Wed May 23 09:42:42 2018 +0200 +++ b/src/hotspot/share/utilities/hashtable.cpp Wed May 23 09:43:41 2018 +0200 @@ -320,7 +320,8 @@ // literals. template void Hashtable::print_table_statistics(outputStream* st, - const char *table_name) { + const char *table_name, + T (*literal_load_barrier)(HashtableEntry*)) { NumberSeq summary; int literal_bytes = 0; for (int i = 0; i < this->table_size(); ++i) { @@ -328,7 +329,8 @@ for (HashtableEntry* e = this->bucket(i); e != NULL; e = e->next()) { count++; - literal_bytes += literal_size(e->literal()); + T l = (literal_load_barrier != NULL) ? literal_load_barrier(e) : e->literal(); + literal_bytes += literal_size(l); } summary.add((double)count); } diff -r 3c6dc4b291cd -r 48d4abe945f1 src/hotspot/share/utilities/hashtable.hpp --- a/src/hotspot/share/utilities/hashtable.hpp Wed May 23 09:42:42 2018 +0200 +++ b/src/hotspot/share/utilities/hashtable.hpp Wed May 23 09:43:41 2018 +0200 @@ -265,7 +265,7 @@ return this->hash_to_index(compute_hash(name)); } - void print_table_statistics(outputStream* st, const char *table_name); + void print_table_statistics(outputStream* st, const char *table_name, T (*literal_load_barrier)(HashtableEntry*) = NULL); protected: