29 #include "classfile/moduleEntry.hpp" |
29 #include "classfile/moduleEntry.hpp" |
30 #include "classfile/packageEntry.hpp" |
30 #include "classfile/packageEntry.hpp" |
31 #include "jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp" |
31 #include "jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp" |
32 #include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdBits.inline.hpp" |
32 #include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdBits.inline.hpp" |
33 #include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.hpp" |
33 #include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.hpp" |
34 #include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp" |
|
35 #include "jfr/support/jfrKlassExtension.hpp" |
34 #include "jfr/support/jfrKlassExtension.hpp" |
36 #include "oops/arrayKlass.hpp" |
35 #include "oops/arrayKlass.hpp" |
37 #include "oops/klass.hpp" |
36 #include "oops/klass.hpp" |
38 #include "oops/instanceKlass.hpp" |
37 #include "oops/instanceKlass.hpp" |
39 #include "oops/method.hpp" |
38 #include "oops/method.hpp" |
58 return TRACE_ID_RAW(t->jfr_thread_local()); |
57 return TRACE_ID_RAW(t->jfr_thread_local()); |
59 } |
58 } |
60 |
59 |
61 inline traceid JfrTraceId::use(const Klass* klass) { |
60 inline traceid JfrTraceId::use(const Klass* klass) { |
62 assert(klass != NULL, "invariant"); |
61 assert(klass != NULL, "invariant"); |
63 return set_used_and_get(klass); |
62 if (SHOULD_TAG(klass)) { |
|
63 SET_USED_THIS_EPOCH(klass); |
|
64 assert(USED_THIS_EPOCH(klass), "invariant"); |
|
65 JfrTraceIdEpoch::set_changed_tag_state(); |
|
66 return get(klass); |
|
67 } |
|
68 assert(USED_THIS_EPOCH(klass), "invariant"); |
|
69 return TRACE_ID(klass); |
64 } |
70 } |
65 |
71 |
66 inline traceid JfrTraceId::use(const Method* method) { |
72 inline traceid JfrTraceId::use(const Method* method) { |
67 assert(method != NULL, "invariant"); |
73 assert(method != NULL, "invariant"); |
68 return use(method->method_holder(), method); |
74 return use(method->method_holder(), method); |
69 } |
75 } |
70 |
76 |
71 inline traceid JfrTraceId::use(const Klass* klass, const Method* method) { |
77 inline traceid JfrTraceId::use(const Klass* klass, const Method* method) { |
72 assert(klass != NULL, "invariant"); |
78 assert(klass != NULL, "invariant"); |
73 assert(method != NULL, "invariant"); |
79 assert(method != NULL, "invariant"); |
74 SET_METHOD_FLAG_USED_THIS_EPOCH(method); |
80 if (SHOULD_TAG_KLASS_METHOD(klass)) { |
75 |
81 SET_METHOD_AND_CLASS_USED_THIS_EPOCH(klass); |
76 SET_METHOD_AND_CLASS_USED_THIS_EPOCH(klass); |
82 } |
77 assert(METHOD_AND_CLASS_USED_THIS_EPOCH(klass), "invariant"); |
83 assert(METHOD_AND_CLASS_USED_THIS_EPOCH(klass), "invariant"); |
|
84 if (METHOD_FLAG_NOT_USED_THIS_EPOCH(method)) { |
|
85 assert(USED_THIS_EPOCH(klass), "invariant"); |
|
86 SET_METHOD_FLAG_USED_THIS_EPOCH(method); |
|
87 JfrTraceIdEpoch::set_changed_tag_state(); |
|
88 } |
|
89 assert(METHOD_FLAG_USED_THIS_EPOCH(method), "invariant"); |
78 return (METHOD_ID(klass, method)); |
90 return (METHOD_ID(klass, method)); |
79 } |
91 } |
80 |
92 |
81 inline traceid JfrTraceId::use(const ModuleEntry* module) { |
93 inline traceid JfrTraceId::use(const ModuleEntry* module) { |
82 assert(module != NULL, "invariant"); |
94 assert(module != NULL, "invariant"); |