8233416: JFR: assert((((((klass)->trace_id()) & (((1 << 1) << 8) | (JfrTraceIdEpoch::in_use_this_epoch_bit()))) != 0))) failed: invariant
authormgronlun
Thu, 07 Nov 2019 15:53:25 +0100
changeset 58966 6c6cce0f149d
parent 58965 86c8b22945a1
child 58967 3c2e49d43ba3
8233416: JFR: assert((((((klass)->trace_id()) & (((1 << 1) << 8) | (JfrTraceIdEpoch::in_use_this_epoch_bit()))) != 0))) failed: invariant Reviewed-by: egahlin
src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp
src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdBits.inline.hpp
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp	Thu Nov 07 15:48:43 2019 +0100
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp	Thu Nov 07 15:53:25 2019 +0100
@@ -42,7 +42,10 @@
 template <typename T>
 inline traceid set_used_and_get(const T* type) {
   assert(type != NULL, "invariant");
-  SET_USED_THIS_EPOCH(type);
+  if (SHOULD_TAG(type)) {
+    SET_USED_THIS_EPOCH(type);
+    JfrTraceIdEpoch::set_changed_tag_state();
+  }
   assert(USED_THIS_EPOCH(type), "invariant");
   return TRACE_ID(type);
 }
@@ -58,19 +61,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 get(klass);
-  }
-  assert(USED_THIS_EPOCH(klass), "invariant");
-  return TRACE_ID(klass);
+  return set_used_and_get(klass);
 }
 
 inline traceid JfrTraceId::use(const Method* method) {
-  assert(method != NULL, "invariant");
   return use(method->method_holder(), method);
 }
 
@@ -91,12 +85,10 @@
 }
 
 inline traceid JfrTraceId::use(const ModuleEntry* module) {
-  assert(module != NULL, "invariant");
   return set_used_and_get(module);
 }
 
 inline traceid JfrTraceId::use(const PackageEntry* package) {
-  assert(package != NULL, "invariant");
   return set_used_and_get(package);
 }
 
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdBits.inline.hpp	Thu Nov 07 15:48:43 2019 +0100
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdBits.inline.hpp	Thu Nov 07 15:53:25 2019 +0100
@@ -40,10 +40,8 @@
 
 inline void set_bits(jbyte bits, jbyte volatile* const dest) {
   assert(dest != NULL, "invariant");
-  if (bits != (*dest & bits)) {
-    *dest |= bits;
-    OrderAccess::storestore();
-  }
+  *dest |= bits;
+  OrderAccess::storestore();
 }
 
 inline jbyte traceid_and(jbyte current, jbyte bits) {