cleanup JEP-349-branch
authormgronlun
Tue, 03 Sep 2019 14:36:15 +0200
branchJEP-349-branch
changeset 57991 a101d496334a
parent 57990 b08487c6eb4d
child 57992 f2f7cb0f1a0f
cleanup
src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp
src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.hpp
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp	Tue Sep 03 14:05:01 2019 +0200
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp	Tue Sep 03 14:36:15 2019 +0200
@@ -53,6 +53,13 @@
 typedef const JfrSymbolId::SymbolEntry* SymbolEntryPtr;
 typedef const JfrSymbolId::CStringEntry* CStringEntryPtr;
 
+static JfrCheckpointWriter* _writer = NULL;
+static JfrCheckpointWriter* _leakp_writer = NULL;
+static JfrArtifactSet* _artifacts = NULL;
+static JfrArtifactClosure* _subsystem_callback = NULL;
+static bool _class_unload = false;
+static bool _flushpoint = false;
+
 // incremented on each rotation
 static u8 checkpoint_id = 1;
 
@@ -64,13 +71,6 @@
   return artifact_id != 0 ? CREATE_SYMBOL_ID(artifact_id) : 0;
 }
 
-static JfrCheckpointWriter* _writer = NULL;
-static JfrCheckpointWriter* _leakp_writer = NULL;
-static bool _class_unload = false;
-static bool _flushpoint = false;
-static JfrArtifactSet* _artifacts = NULL;
-static JfrArtifactClosure* _subsystem_callback = NULL;
-
 static bool current_epoch() {
   return _class_unload || _flushpoint;
 }
@@ -156,7 +156,7 @@
   assert(IS_LEAKP(value), "invariant");
 }
 
-static void tag_leakp_klass_artifacts(KlassPtr k, bool class_unload) {
+static void tag_leakp_klass_artifacts(KlassPtr k) {
   assert(k != NULL, "invariant");
   PkgPtr pkg = k->package();
   if (pkg != NULL) {
@@ -174,12 +174,11 @@
 }
 
 class TagLeakpKlassArtifact {
-  bool _class_unload;
-public:
-  TagLeakpKlassArtifact(bool class_unload) : _class_unload(class_unload) {}
+ public:
+  TagLeakpKlassArtifact(bool class_unload) {}
   bool operator()(KlassPtr klass) {
     if (IS_LEAKP(klass)) {
-      tag_leakp_klass_artifacts(klass, _class_unload);
+      tag_leakp_klass_artifacts(klass);
     }
     return true;
   }
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.hpp	Tue Sep 03 14:05:01 2019 +0200
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.hpp	Tue Sep 03 14:36:15 2019 +0200
@@ -185,34 +185,6 @@
   }
 };
 
-template <typename T, int compare(const T&, const T&)>
-class UniquePredicate {
- private:
-  GrowableArray<T> _seen;
- public:
-   UniquePredicate(bool) : _seen() {}
-   bool operator()(T const& value) {
-     bool not_unique;
-     _seen.template find_sorted<T, compare>(value, not_unique);
-     if (not_unique) {
-       return false;
-     }
-     _seen.template insert_sorted<compare>(value);
-     return true;
-   }
-};
-
-template <typename T, int compare(const T&, const T&)>
-class CompositeLeakPredicate {
-  LeakPredicate<T> _leak_predicate;
-  UniquePredicate<T, compare> _unique;
- public:
-  CompositeLeakPredicate(bool class_unload) : _leak_predicate(class_unload), _unique(class_unload) {}
-  bool operator()(T const& value) {
-    return _leak_predicate(value) && _unique(value);
-  }
-};
-
 template <typename T, typename IdType>
 class ListEntry : public JfrHashtableEntry<T, IdType> {
  public: