8212663: Remove conservative at_safepoint assert when JFR writes type sets during class unloading
authoreosterlund
Mon, 22 Oct 2018 12:13:29 +0200
changeset 52212 e6973df15152
parent 52211 f298d05357fe
child 52213 51c0b3936f01
8212663: Remove conservative at_safepoint assert when JFR writes type sets during class unloading Reviewed-by: coleenp, dholmes, mgronlun
src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp
src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp
--- 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);