8210236: Prepare ciReceiverTypeData::translate_receiver_data_from for concurrent class unloading
Reviewed-by: coleenp, roland
--- 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);
+ }
}
}
}