mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 01:24:33 +02:00
8313564: Fix -Wconversion warnings in classfile code
Reviewed-by: matsaave, dholmes
This commit is contained in:
parent
e8a37b90db
commit
f66cd5008d
19 changed files with 57 additions and 52 deletions
|
@ -121,7 +121,7 @@ volatile bool _alt_hash = false;
|
|||
static bool _rehashed = false;
|
||||
static uint64_t _alt_hash_seed = 0;
|
||||
|
||||
uintx hash_string(const jchar* s, int len, bool useAlt) {
|
||||
unsigned int hash_string(const jchar* s, int len, bool useAlt) {
|
||||
return useAlt ?
|
||||
AltHashing::halfsiphash_32(_alt_hash_seed, s, len) :
|
||||
java_lang_String::hash_code(s, len);
|
||||
|
@ -241,12 +241,12 @@ void StringTable::create_table() {
|
|||
#endif
|
||||
}
|
||||
|
||||
size_t StringTable::item_added() {
|
||||
return Atomic::add(&_items_count, (size_t)1);
|
||||
void StringTable::item_added() {
|
||||
Atomic::inc(&_items_count);
|
||||
}
|
||||
|
||||
void StringTable::item_removed() {
|
||||
Atomic::add(&_items_count, (size_t)-1);
|
||||
Atomic::dec(&_items_count);
|
||||
}
|
||||
|
||||
double StringTable::get_load_factor() {
|
||||
|
@ -802,7 +802,7 @@ oop StringTable::lookup_shared(const jchar* name, int len) {
|
|||
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);
|
||||
fatal("Too many strings to be archived: %zu", _items_count);
|
||||
}
|
||||
|
||||
int total = (int)_items_count;
|
||||
|
@ -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: %zu", _items_count);
|
||||
MetaspaceShared::unrecoverable_writing_error();
|
||||
}
|
||||
|
||||
|
@ -888,7 +888,7 @@ oop StringTable::init_shared_table(const DumpedInternedStrings* dumped_interned_
|
|||
verify_secondary_array_index_bits();
|
||||
|
||||
_shared_table.reset();
|
||||
CompactHashtableWriter writer(_items_count, ArchiveBuilder::string_stats());
|
||||
CompactHashtableWriter writer((int)_items_count, ArchiveBuilder::string_stats());
|
||||
|
||||
int index = 0;
|
||||
auto copy_into_array = [&] (oop string, bool value_ignored) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue