equal
deleted
inserted
replaced
42 |
42 |
43 class JfrTraceIdEpoch : AllStatic { |
43 class JfrTraceIdEpoch : AllStatic { |
44 friend class JfrCheckpointManager; |
44 friend class JfrCheckpointManager; |
45 private: |
45 private: |
46 static bool _epoch_state; |
46 static bool _epoch_state; |
47 static bool volatile _klass_tagged_in_epoch; |
47 static bool volatile _tag_state; |
48 |
48 |
49 static void shift_epoch(); |
49 static void shift_epoch(); |
50 |
50 |
51 public: |
51 public: |
52 static bool epoch() { |
52 static bool epoch() { |
87 |
87 |
88 static traceid method_and_class_in_use_prev_epoch_bits() { |
88 static traceid method_and_class_in_use_prev_epoch_bits() { |
89 return _epoch_state ? METHOD_AND_CLASS_IN_USE_EPOCH_1_BITS : METHOD_AND_CLASS_IN_USE_EPOCH_2_BITS; |
89 return _epoch_state ? METHOD_AND_CLASS_IN_USE_EPOCH_1_BITS : METHOD_AND_CLASS_IN_USE_EPOCH_2_BITS; |
90 } |
90 } |
91 |
91 |
92 static bool is_klass_tagged_in_epoch() { |
92 static bool has_changed_tag_state() { |
93 if (OrderAccess::load_acquire(&_klass_tagged_in_epoch)) { |
93 if (OrderAccess::load_acquire(&_tag_state)) { |
94 OrderAccess::release_store(&_klass_tagged_in_epoch, false); |
94 OrderAccess::release_store(&_tag_state, false); |
95 return true; |
95 return true; |
96 } |
96 } |
97 return false; |
97 return false; |
98 } |
98 } |
99 |
99 |
100 static void set_klass_tagged_in_epoch() { |
100 static void set_changed_tag_state() { |
101 if (!OrderAccess::load_acquire(&_klass_tagged_in_epoch)) { |
101 if (!OrderAccess::load_acquire(&_tag_state)) { |
102 OrderAccess::release_store(&_klass_tagged_in_epoch, true); |
102 OrderAccess::release_store(&_tag_state, true); |
103 } |
103 } |
104 } |
104 } |
105 }; |
105 }; |
106 |
106 |
107 #endif // SHARE_JFR_RECORDER_CHECKPOINT_TYPES_TRACEID_JFRTRACEIDEPOCH_HPP |
107 #endif // SHARE_JFR_RECORDER_CHECKPOINT_TYPES_TRACEID_JFRTRACEIDEPOCH_HPP |