folding operations back into subsystems JEP-349-branch
authormgronlun
Tue, 17 Sep 2019 12:37:53 +0200
branchJEP-349-branch
changeset 58184 2bc0dc4b7119
parent 58183 e1b896faca1c
child 58185 ff328fdeca2d
folding operations back into subsystems
src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp
src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.hpp
src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp
src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.hpp
src/hotspot/share/jfr/recorder/service/jfrRecorderService.cpp
--- a/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp	Tue Sep 17 12:06:48 2019 +0200
+++ b/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp	Tue Sep 17 12:37:53 2019 +0200
@@ -419,12 +419,16 @@
   }
 }
 
-void JfrCheckpointManager::notify_types_on_rotation() {
-  JfrTypeManager::notify_types_on_rotation();
+void JfrCheckpointManager::on_rotation() {
+  assert(SafepointSynchronize::is_at_safepoint(), "invariant");
+  JfrTypeManager::on_rotation();
+  notify_threads();
+  shift_epoch();
 }
 
 void JfrCheckpointManager::write_type_set() {
   JfrTypeManager::write_type_set();
+  write();
 }
 
 void JfrCheckpointManager::write_type_set_for_unloaded_classes() {
--- a/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.hpp	Tue Sep 17 12:06:48 2019 +0200
+++ b/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.hpp	Tue Sep 17 12:37:53 2019 +0200
@@ -87,7 +87,7 @@
   void synchronize_epoch();
   bool use_epoch_transition_mspace(const Thread* t) const;
   void notify_threads();
-  void notify_types_on_rotation();
+  void on_rotation();
   bool is_type_set_required();
   bool is_constant_set_required();
 
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp	Tue Sep 17 12:06:48 2019 +0200
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp	Tue Sep 17 12:37:53 2019 +0200
@@ -34,7 +34,6 @@
 #include "jfr/utilities/jfrIterator.hpp"
 #include "memory/resourceArea.hpp"
 #include "runtime/handles.inline.hpp"
-#include "runtime/safepoint.hpp"
 #include "runtime/thread.inline.hpp"
 #include "utilities/exceptions.hpp"
 #include "runtime/semaphore.hpp"
@@ -164,7 +163,7 @@
   serialize_thread_groups(writer);
 }
 
-void JfrTypeManager::notify_types_on_rotation() {
+void JfrTypeManager::on_rotation() {
   const Iterator iter(types);
   while (iter.has_next()) {
     iter.next()->on_rotation();
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.hpp	Tue Sep 17 12:06:48 2019 +0200
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.hpp	Tue Sep 17 12:37:53 2019 +0200
@@ -36,7 +36,7 @@
   static bool is_new_constant_registered();
   static void write_types(JfrCheckpointWriter& writer);
   static void write_threads(JfrCheckpointWriter& writer);
-  static void notify_types_on_rotation();
+  static void on_rotation();
   static void write_type_set();
   static void write_type_set_for_unloaded_classes();
   static size_t flush_type_set();
--- a/src/hotspot/share/jfr/recorder/service/jfrRecorderService.cpp	Tue Sep 17 12:06:48 2019 +0200
+++ b/src/hotspot/share/jfr/recorder/service/jfrRecorderService.cpp	Tue Sep 17 12:37:53 2019 +0200
@@ -598,9 +598,7 @@
     write_stringpool_safepoint(_string_pool, _chunkwriter);
   }
   _storage.write_at_safepoint();
-  _checkpoint_manager.notify_threads();
-  _checkpoint_manager.notify_types_on_rotation();
-  _checkpoint_manager.shift_epoch();
+  _checkpoint_manager.on_rotation();
   _chunkwriter.set_time_stamp();
 }
 
@@ -616,8 +614,6 @@
     // Note: There is a dependency on write_type_set() above, ensure the release is subsequent.
     ObjectSampler::release();
   }
-  // serialize any outstanding checkpoint memory
-  _checkpoint_manager.write();
   // serialize the metadata descriptor event and close out the chunk
   write_metadata(_chunkwriter);
   _repository.close_chunk();