8212663: Remove conservative at_safepoint assert when JFR writes type sets during class unloading
Reviewed-by: coleenp, dholmes, mgronlun
--- a/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp Mon Oct 22 12:25:31 2018 +0100
+++ b/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp Mon Oct 22 12:13:29 2018 +0200
@@ -367,7 +367,7 @@
}
void JfrCheckpointManager::write_type_set_for_unloaded_classes() {
- assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!");
+ assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
JfrTypeManager::write_type_set_for_unloaded_classes();
}
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp Mon Oct 22 12:25:31 2018 +0100
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp Mon Oct 22 12:13:29 2018 +0200
@@ -158,7 +158,7 @@
}
void JfrTypeManager::write_type_set_for_unloaded_classes() {
- assert(SafepointSynchronize::is_at_safepoint(), "invariant");
+ assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
JfrCheckpointWriter writer(false, true, Thread::current());
ClassUnloadTypeSet class_unload_set;
class_unload_set.serialize(writer);