Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion src/hotspot/share/classfile/loaderConstraints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ void LoaderConstraintTable::print_table_statistics(outputStream* st) {
int len = set.num_constraints();
for (int i = 0; i < len; i++) {
LoaderConstraint* probe = set.constraint_at(i);
sum += (int)sizeof(*probe) + (probe->num_loaders() * (int)sizeof(ClassLoaderData*));
sum += (int)(sizeof(*probe) + (probe->num_loaders() * sizeof(ClassLoaderData*)));
}
return sum;
};
Expand Down
14 changes: 7 additions & 7 deletions src/hotspot/share/classfile/stringTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ volatile bool StringTable::_needs_rehashing = false;
OopStorage* StringTable::_oop_storage;

static size_t _current_size = 0;
static volatile size_t _items_count = 0;
static volatile int _items_count = 0;

volatile bool _alt_hash = false;

Expand Down Expand Up @@ -665,7 +665,7 @@ class VerifyCompStrings : StackObj {
string_hash, string_equals> _table;
public:
size_t _errors;
VerifyCompStrings() : _table(unsigned(_items_count / 8) + 1, 0 /* do not resize */), _errors(0) {}
VerifyCompStrings() : _table((_items_count / 8) + 1, 0 /* do not resize */), _errors(0) {}
bool operator()(WeakHandle* val) {
oop s = val->resolve();
if (s == nullptr) {
Expand Down Expand Up @@ -801,11 +801,11 @@ oop StringTable::lookup_shared(const jchar* name, int len) {
// to guarantee because CDS runs with a single Java thread. See JDK-8253495.)
void StringTable::allocate_shared_strings_array(TRAPS) {
assert(DumpSharedSpaces, "must be");
if (_items_count > (size_t)max_jint) {
fatal("Too many strings to be archived: " SIZE_FORMAT, _items_count);
if (_items_count > max_jint) {
fatal("Too many strings to be archived: %d", _items_count);
}

int total = (int)_items_count;
int total = _items_count;
size_t single_array_size = objArrayOopDesc::object_size(total);

log_info(cds)("allocated string table for %d strings", total);
Expand All @@ -825,7 +825,7 @@ void StringTable::allocate_shared_strings_array(TRAPS) {
// This can only happen if you have an extremely large number of classes that
// refer to more than 16384 * 16384 = 26M interned strings! Not a practical concern
// but bail out for safety.
log_error(cds)("Too many strings to be archived: " SIZE_FORMAT, _items_count);
log_error(cds)("Too many strings to be archived: %d", _items_count);
MetaspaceShared::unrecoverable_writing_error();
}

Expand Down Expand Up @@ -888,7 +888,7 @@ oop StringTable::init_shared_table(const DumpedInternedStrings* dumped_interned_
verify_secondary_array_index_bits();

_shared_table.reset();
CompactHashtableWriter writer((int)_items_count, ArchiveBuilder::string_stats());
CompactHashtableWriter writer(_items_count, ArchiveBuilder::string_stats());

int index = 0;
auto copy_into_array = [&] (oop string, bool value_ignored) {
Expand Down
10 changes: 5 additions & 5 deletions src/hotspot/share/classfile/symbolTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static size_t _symbols_removed = 0;
static size_t _symbols_counted = 0;
static size_t _current_size = 0;

static volatile size_t _items_count = 0;
static volatile int _items_count = 0;
static volatile bool _has_items_to_clean = false;


Expand Down Expand Up @@ -657,11 +657,11 @@ void SymbolTable::copy_shared_symbol_table(GrowableArray<Symbol*>* symbols,
}

size_t SymbolTable::estimate_size_for_archive() {
return CompactHashtableWriter::estimate_size(int(_items_count));
return CompactHashtableWriter::estimate_size(_items_count);
}

void SymbolTable::write_to_archive(GrowableArray<Symbol*>* symbols) {
CompactHashtableWriter writer(int(_items_count), ArchiveBuilder::symbol_stats());
CompactHashtableWriter writer(_items_count, ArchiveBuilder::symbol_stats());
copy_shared_symbol_table(symbols, &writer);
if (!DynamicDumpSharedSpaces) {
_shared_table.reset();
Expand Down Expand Up @@ -923,14 +923,14 @@ void SymbolTable::print_histogram() {
tty->print_cr(" Total removed " SIZE_FORMAT_W(7), _symbols_removed);
if (_symbols_counted > 0) {
tty->print_cr(" Percent removed %3.2f",
((float)_symbols_removed / (float)_symbols_counted) * 100);
((double)_symbols_removed / (double)_symbols_counted) * 100);
}
tty->print_cr(" Reference counts " SIZE_FORMAT_W(7), Symbol::_total_count);
tty->print_cr(" Symbol arena used " SIZE_FORMAT_W(7) "K", arena()->used() / K);
tty->print_cr(" Symbol arena size " SIZE_FORMAT_W(7) "K", arena()->size_in_bytes() / K);
tty->print_cr(" Total symbol length " SIZE_FORMAT_W(7), hi.total_length);
tty->print_cr(" Maximum symbol length " SIZE_FORMAT_W(7), hi.max_length);
tty->print_cr(" Average symbol length %7.2f", ((float)hi.total_length / (float)hi.total_count));
tty->print_cr(" Average symbol length %7.2f", ((double)hi.total_length / (double)hi.total_count));
tty->print_cr(" Symbol length histogram:");
tty->print_cr(" %6s %10s %10s", "Length", "#Symbols", "Size");
for (size_t i = 0; i < hi.results_length; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ JVMFlag::Error ObjectAlignmentInBytesConstraintFunc(int value, bool verbose) {
JVMFlag::Error ContendedPaddingWidthConstraintFunc(int value, bool verbose) {
if ((value % BytesPerLong) != 0) {
JVMFlag::printError(verbose,
"ContendedPaddingWidth (%u) must be "
"ContendedPaddingWidth (%d) must be "
"a multiple of %d\n",
value, BytesPerLong);
return JVMFlag::VIOLATES_CONSTRAINT;
Expand Down