changeset 52942:7003a0220fe4

8214231: Allow concurrent cleaning of TypeStackSlotEntries and ReturnTypeEntry Reviewed-by: rehn, coleenp
author eosterlund
date Fri, 30 Nov 2018 16:51:23 +0100
parents 621efe32eb0b
children 447236ceaf28
files src/hotspot/share/ci/ciMethodData.cpp
diffstat 1 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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) {