Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shipilev committed Oct 16, 2024
1 parent dcac4b0 commit 0f10c9d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/hotspot/share/cds/heapShared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,14 @@ void HeapShared::set_scratch_java_mirror(Klass* k, oop mirror) {
}

void HeapShared::remove_scratch_objects(Klass* k) {
// Before we remove the Java mirror from the table, we need to break the link
// from mirror to the Klass. Java mirror can still be alive, and it should
// not point to dead klass. See how InstanceKlass::deallocate_contents does it
// for normal mirrors.
oop mirror = _scratch_java_mirror_table->get_oop(k);
if (mirror != nullptr) {
java_lang_Class::set_klass(mirror, nullptr);
}
_scratch_java_mirror_table->remove_oop(k);
if (k->is_instance_klass()) {
_scratch_references_table->remove(InstanceKlass::cast(k)->constants());
Expand Down

0 comments on commit 0f10c9d

Please sign in to comment.