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
16 changes: 12 additions & 4 deletions src/hotspot/share/oops/klass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,10 +810,18 @@ void Klass::remove_unshareable_info() {
set_class_loader_data(nullptr);
set_is_shared();

// FIXME: validation in Klass::hash_secondary_supers() may fail for shared klasses.
// Even though the bitmaps always match, the canonical order of elements in the table
// is not guaranteed to stay the same (see tie breaker during Robin Hood hashing in Klass::hash_insert).
//assert(compute_secondary_supers_bitmap(secondary_supers()) == _secondary_supers_bitmap, "broken table");
if (CDSConfig::is_dumping_classic_static_archive()) {
// "Classic" static archives are required to have deterministic contents.
// The elements in _secondary_supers are addresses in the ArchiveBuilder
// output buffer, so they should have deterministic values. If we rehash
// _secondary_supers, its elements will appear in a deterministic order.
//
// Note that the bitmap is guaranteed to be deterministic, regardless of the
// actual addresses of the elements in _secondary_supers. So rehashing shouldn't
// change it.
uintx bitmap = hash_secondary_supers(secondary_supers(), true);
assert(bitmap == _secondary_supers_bitmap, "bitmap should not be changed due to rehashing");
}
}

void Klass::remove_java_mirror() {
Expand Down