File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -810,10 +810,18 @@ void Klass::remove_unshareable_info() {
810810 set_class_loader_data (nullptr );
811811 set_is_shared ();
812812
813- // FIXME: validation in Klass::hash_secondary_supers() may fail for shared klasses.
814- // Even though the bitmaps always match, the canonical order of elements in the table
815- // is not guaranteed to stay the same (see tie breaker during Robin Hood hashing in Klass::hash_insert).
816- // assert(compute_secondary_supers_bitmap(secondary_supers()) == _secondary_supers_bitmap, "broken table");
813+ if (CDSConfig::is_dumping_classic_static_archive ()) {
814+ // "Classic" static archives are required to have deterministic contents.
815+ // The elements in _secondary_supers are addresses in the ArchiveBuilder
816+ // output buffer, so they should have deterministic values. If we rehash
817+ // _secondary_supers, its elements will appear in a deterministic order.
818+ //
819+ // Note that the bitmap is guaranteed to be deterministic, regardless of the
820+ // actual addresses of the elements in _secondary_supers. So rehashing shouldn't
821+ // change it.
822+ uintx bitmap = hash_secondary_supers (secondary_supers (), true );
823+ assert (bitmap == _secondary_supers_bitmap, " bitmap should not be changed due to rehashing" );
824+ }
817825}
818826
819827void Klass::remove_java_mirror () {
You can’t perform that action at this time.
0 commit comments