< prev index next >

src/hotspot/share/jfr/recorder/storage/jfrEpochStorage.inline.hpp

Print this page

 58   assert(buffer->acquired_by_self(), "invariant");
 59   return buffer;
 60 }
 61 
 62 template <typename NodeType, template <typename> class RetrievalPolicy, bool EagerReclaim>
 63 void JfrEpochStorageHost<NodeType, RetrievalPolicy, EagerReclaim>::release(NodeType* buffer) {
 64   assert(buffer != NULL, "invariant");
 65   buffer->set_retired();
 66 }
 67 
 68 template <typename NodeType, template <typename> class RetrievalPolicy, bool EagerReclaim>
 69 void JfrEpochStorageHost<NodeType, RetrievalPolicy, EagerReclaim>::register_full(NodeType* buffer, Thread* thread) {
 70   // nothing here at the moment
 71 }
 72 
 73 template <typename NodeType, template <typename> class RetrievalPolicy, bool EagerReclaim>
 74 template <typename Functor>
 75 void JfrEpochStorageHost<NodeType, RetrievalPolicy, EagerReclaim>::iterate(Functor& functor, bool previous_epoch) {
 76   typedef ReinitializeAllReleaseRetiredOp<EpochMspace, typename EpochMspace::LiveList> PreviousEpochReleaseOperation;
 77   typedef CompositeOperation<Functor, PreviousEpochReleaseOperation> PreviousEpochOperation;
 78   typedef ReleaseRetiredOp<EpochMspace, typename EpochMspace::LiveList> CurrentEpochReleaseOperation;
 79   typedef CompositeOperation<Functor, CurrentEpochReleaseOperation> CurrentEpochOperation;
 80   if (previous_epoch) {
 81     PreviousEpochReleaseOperation pero(_mspace, _mspace->live_list(true));
 82     PreviousEpochOperation peo(&functor, &pero);
 83     process_live_list(peo, _mspace, true); // previous epoch list
 84     return;
 85   }
 86   if (EagerReclaim) {
 87     CurrentEpochReleaseOperation cero(_mspace, _mspace->live_list());
 88     CurrentEpochOperation ceo(&functor, &cero);
 89     process_live_list(ceo, _mspace, false); // current epoch list
 90     return;
 91   }
 92   process_live_list(functor, _mspace, false); // current epoch list
 93 }
 94 
 95 #ifdef ASSERT
 96 
 97 template <typename Mspace>
 98 class EmptyVerifier {
 99  private:
100   Mspace* _mspace;
101  public:
102   typedef typename Mspace::Node Node;
103   typedef typename Mspace::NodePtr NodePtr;
104   EmptyVerifier(Mspace* mspace) : _mspace(mspace) {}
105   bool process(NodePtr node) {
106     assert(node != NULL, "invariant");
107     assert(node->empty(), "invariant");
108     return true;

 58   assert(buffer->acquired_by_self(), "invariant");
 59   return buffer;
 60 }
 61 
 62 template <typename NodeType, template <typename> class RetrievalPolicy, bool EagerReclaim>
 63 void JfrEpochStorageHost<NodeType, RetrievalPolicy, EagerReclaim>::release(NodeType* buffer) {
 64   assert(buffer != NULL, "invariant");
 65   buffer->set_retired();
 66 }
 67 
 68 template <typename NodeType, template <typename> class RetrievalPolicy, bool EagerReclaim>
 69 void JfrEpochStorageHost<NodeType, RetrievalPolicy, EagerReclaim>::register_full(NodeType* buffer, Thread* thread) {
 70   // nothing here at the moment
 71 }
 72 
 73 template <typename NodeType, template <typename> class RetrievalPolicy, bool EagerReclaim>
 74 template <typename Functor>
 75 void JfrEpochStorageHost<NodeType, RetrievalPolicy, EagerReclaim>::iterate(Functor& functor, bool previous_epoch) {
 76   typedef ReinitializeAllReleaseRetiredOp<EpochMspace, typename EpochMspace::LiveList> PreviousEpochReleaseOperation;
 77   typedef CompositeOperation<Functor, PreviousEpochReleaseOperation> PreviousEpochOperation;
 78   typedef ReleaseRetiredOp<Functor, EpochMspace, typename EpochMspace::LiveList> CurrentEpochOperation;

 79   if (previous_epoch) {
 80     PreviousEpochReleaseOperation pero(_mspace, _mspace->live_list(true));
 81     PreviousEpochOperation peo(&functor, &pero);
 82     process_live_list(peo, _mspace, true); // previous epoch list
 83     return;
 84   }
 85   if (EagerReclaim) {
 86     CurrentEpochOperation ceo(functor, _mspace, _mspace->live_list());

 87     process_live_list(ceo, _mspace, false); // current epoch list
 88     return;
 89   }
 90   process_live_list(functor, _mspace, false); // current epoch list
 91 }
 92 
 93 #ifdef ASSERT
 94 
 95 template <typename Mspace>
 96 class EmptyVerifier {
 97  private:
 98   Mspace* _mspace;
 99  public:
100   typedef typename Mspace::Node Node;
101   typedef typename Mspace::NodePtr NodePtr;
102   EmptyVerifier(Mspace* mspace) : _mspace(mspace) {}
103   bool process(NodePtr node) {
104     assert(node != NULL, "invariant");
105     assert(node->empty(), "invariant");
106     return true;
< prev index next >