-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8313564: Fix -Wconversion warnings in classfile code #15111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6ea354b
Fix -Wconversion warnings in classfile code.
coleenp bfad5ce
Fix vmIntrinsics.cpp
coleenp 830e836
Fix classLoader.cpp
coleenp 8bd60e8
Fix systemDictionaryShared.cpp
coleenp e73ea64
Fix klassFactory.cpp
coleenp 2d7b8ba
Fix fieldLayoutBuilder.cpp by fixing Contended command line parameter.
coleenp e488736
Fix loaderConstraints.cpp, altHashing.cpp, classLoaderExt.cpp
coleenp dd21775
Fix compactHashtable.cpp
coleenp 3fa12be
unset Wconversion
coleenp 0e97905
Missed a case that gets -Wconversion warning for ContendedPaddingWidt…
coleenp 864a80f
David's suggestions.
coleenp 4019e4e
Fix Atomic items_added code.
coleenp a092d42
Revert items_count change to int. Add check for items_count overflow…
coleenp 9cfa3f3
Add %zu
coleenp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,7 +114,7 @@ volatile bool StringTable::_needs_rehashing = false; | |
| OopStorage* StringTable::_oop_storage; | ||
|
|
||
| static size_t _current_size = 0; | ||
| static volatile int _items_count = 0; | ||
| static volatile size_t _items_count = 0; | ||
|
|
||
| volatile bool _alt_hash = false; | ||
|
|
||
|
|
@@ -665,7 +665,7 @@ class VerifyCompStrings : StackObj { | |
| string_hash, string_equals> _table; | ||
| public: | ||
| size_t _errors; | ||
| VerifyCompStrings() : _table((_items_count / 8) + 1, 0 /* do not resize */), _errors(0) {} | ||
| VerifyCompStrings() : _table(unsigned(_items_count / 8) + 1, 0 /* do not resize */), _errors(0) {} | ||
| bool operator()(WeakHandle* val) { | ||
| oop s = val->resolve(); | ||
| if (s == nullptr) { | ||
|
|
@@ -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 > max_jint) { | ||
| fatal("Too many strings to be archived: %d", _items_count); | ||
| if (_items_count > (size_t)max_jint) { | ||
| fatal("Too many strings to be archived: " SIZE_FORMAT, _items_count); | ||
| } | ||
|
|
||
| int total = _items_count; | ||
| int total = (int)_items_count; | ||
| size_t single_array_size = objArrayOopDesc::object_size(total); | ||
|
|
||
| log_info(cds)("allocated string table for %d strings", total); | ||
|
|
@@ -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: %d", _items_count); | ||
| log_error(cds)("Too many strings to be archived: " SIZE_FORMAT, _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()); | ||
coleenp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| int index = 0; | ||
| auto copy_into_array = [&] (oop string, bool value_ignored) { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,7 +87,7 @@ static size_t _symbols_removed = 0; | |
| static size_t _symbols_counted = 0; | ||
| static size_t _current_size = 0; | ||
|
|
||
| static volatile int _items_count = 0; | ||
| static volatile size_t _items_count = 0; | ||
| static volatile bool _has_items_to_clean = false; | ||
|
|
||
|
|
||
|
|
@@ -657,11 +657,14 @@ void SymbolTable::copy_shared_symbol_table(GrowableArray<Symbol*>* symbols, | |
| } | ||
|
|
||
| size_t SymbolTable::estimate_size_for_archive() { | ||
| return CompactHashtableWriter::estimate_size(_items_count); | ||
| if (_items_count > (size_t)max_jint) { | ||
| fatal("Too many symbols to be archived: " SIZE_FORMAT, _items_count); | ||
|
||
| } | ||
| return CompactHashtableWriter::estimate_size(int(_items_count)); | ||
| } | ||
|
|
||
| void SymbolTable::write_to_archive(GrowableArray<Symbol*>* symbols) { | ||
| CompactHashtableWriter writer(_items_count, ArchiveBuilder::symbol_stats()); | ||
| CompactHashtableWriter writer(int(_items_count), ArchiveBuilder::symbol_stats()); | ||
| copy_shared_symbol_table(symbols, &writer); | ||
| if (!DynamicDumpSharedSpaces) { | ||
| _shared_table.reset(); | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.