# HG changeset patch # User eosterlund # Date 1543593083 -3600 # Node ID 7003a0220fe44ce09229fc2e7b127f598e8f523b # Parent 621efe32eb0be275f6b661969617868aaa919a63 8214231: Allow concurrent cleaning of TypeStackSlotEntries and ReturnTypeEntry Reviewed-by: rehn, coleenp diff -r 621efe32eb0b -r 7003a0220fe4 src/hotspot/share/ci/ciMethodData.cpp --- a/src/hotspot/share/ci/ciMethodData.cpp Fri Nov 30 15:29:19 2018 +0100 +++ b/src/hotspot/share/ci/ciMethodData.cpp Fri Nov 30 16:51:23 2018 +0100 @@ -198,17 +198,28 @@ } } - void ciTypeStackSlotEntries::translate_type_data_from(const TypeStackSlotEntries* entries) { for (int i = 0; i < number_of_entries(); i++) { intptr_t k = entries->type(i); - TypeStackSlotEntries::set_type(i, translate_klass(k)); + Klass* klass = (Klass*)klass_part(k); + if (klass != NULL && !klass->is_loader_alive()) { + // With concurrent class unloading, the MDO could have stale metadata; override it + TypeStackSlotEntries::set_type(i, TypeStackSlotEntries::with_status((Klass*)NULL, k)); + } else { + TypeStackSlotEntries::set_type(i, translate_klass(k)); + } } } void ciReturnTypeEntry::translate_type_data_from(const ReturnTypeEntry* ret) { intptr_t k = ret->type(); - set_type(translate_klass(k)); + Klass* klass = (Klass*)klass_part(k); + if (klass != NULL && !klass->is_loader_alive()) { + // With concurrent class unloading, the MDO could have stale metadata; override it + set_type(ReturnTypeEntry::with_status((Klass*)NULL, k)); + } else { + set_type(translate_klass(k)); + } } void ciSpeculativeTrapData::translate_from(const ProfileData* data) {