8210236: Prepare ciReceiverTypeData::translate_receiver_data_from for concurrent class unloading
authoreosterlund
Mon, 10 Sep 2018 11:24:26 +0200
changeset 51680 d058b410af0a
parent 51679 f7563db3ae1b
child 51681 72bdaf11dd6a
8210236: Prepare ciReceiverTypeData::translate_receiver_data_from for concurrent class unloading Reviewed-by: coleenp, roland
src/hotspot/share/ci/ciMethodData.cpp
--- a/src/hotspot/share/ci/ciMethodData.cpp	Mon Sep 10 10:02:48 2018 +0200
+++ b/src/hotspot/share/ci/ciMethodData.cpp	Mon Sep 10 11:24:26 2018 +0200
@@ -187,8 +187,13 @@
   for (uint row = 0; row < row_limit(); row++) {
     Klass* k = data->as_ReceiverTypeData()->receiver(row);
     if (k != NULL) {
-      ciKlass* klass = CURRENT_ENV->get_klass(k);
-      set_receiver(row, klass);
+      if (k->is_loader_alive()) {
+        ciKlass* klass = CURRENT_ENV->get_klass(k);
+        set_receiver(row, klass);
+      } else {
+        // With concurrent class unloading, the MDO could have stale metadata; override it
+        clear_row(row);
+      }
     }
   }
 }