cleaner tagging JEP-349-branch
authormgronlun
Sun, 29 Sep 2019 16:12:47 +0200
branchJEP-349-branch
changeset 58392 be0dc16e920d
parent 58391 ff29dba057f9
child 58395 42d3bce9d538
cleaner tagging
src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp	Sun Sep 29 13:59:54 2019 +0200
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp	Sun Sep 29 16:12:47 2019 +0200
@@ -60,8 +60,10 @@
 inline traceid JfrTraceId::use(const Klass* klass) {
   assert(klass != NULL, "invariant");
   if (SHOULD_TAG(klass)) {
+    SET_USED_THIS_EPOCH(klass);
+    assert(USED_THIS_EPOCH(klass), "invariant");
     JfrTraceIdEpoch::set_changed_tag_state();
-    return set_used_and_get(klass);
+    return get(klass);
   }
   assert(USED_THIS_EPOCH(klass), "invariant");
   return TRACE_ID(klass);
@@ -75,20 +77,16 @@
 inline traceid JfrTraceId::use(const Klass* klass, const Method* method) {
   assert(klass != NULL, "invariant");
   assert(method != NULL, "invariant");
-  bool changed_tag_state = false;
   if (SHOULD_TAG_KLASS_METHOD(klass)) {
     SET_METHOD_AND_CLASS_USED_THIS_EPOCH(klass);
-    changed_tag_state = true;
   }
   assert(METHOD_AND_CLASS_USED_THIS_EPOCH(klass), "invariant");
   if (METHOD_FLAG_NOT_USED_THIS_EPOCH(method)) {
+    assert(USED_THIS_EPOCH(klass), "invariant");
     SET_METHOD_FLAG_USED_THIS_EPOCH(method);
-    changed_tag_state = true;
+    JfrTraceIdEpoch::set_changed_tag_state();
   }
   assert(METHOD_FLAG_USED_THIS_EPOCH(method), "invariant");
-  if (changed_tag_state) {
-    JfrTraceIdEpoch::set_changed_tag_state();
-  }
   return (METHOD_ID(klass, method));
 }