--- a/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.cpp Tue Sep 03 11:48:31 2019 +0200
+++ b/src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.cpp Tue Sep 03 13:15:27 2019 +0200
@@ -308,8 +308,7 @@
if (is_processed(method_id) || is_klass_unloaded(method_id)) {
return;
}
- assert(frame._method != NULL, "invariant");
- JfrTraceId::set_leakp(frame._method->method_holder(), frame._method);
+ JfrTraceId::set_leakp(frame._method);
}
void ObjectSampleCheckpoint::write_stacktrace(const JfrStackTrace* trace, JfrCheckpointWriter& writer) {
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp Tue Sep 03 11:48:31 2019 +0200
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp Tue Sep 03 13:15:27 2019 +0200
@@ -99,7 +99,7 @@
static traceid use(const ClassLoaderData* cld);
// leak profiler
- static void set_leakp(const Klass* klass, const Method* method);
+ static void set_leakp(const Method* method);
static void remove(const Klass* klass);
static void restore(const Klass* klass);
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp Tue Sep 03 11:48:31 2019 +0200
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp Tue Sep 03 13:15:27 2019 +0200
@@ -108,7 +108,10 @@
return cld->is_unsafe_anonymous() ? 0 : set_used_and_get(cld);
}
-inline void JfrTraceId::set_leakp(const Klass* klass, const Method* method) {
+inline void JfrTraceId::set_leakp(const Method* method) {
+ assert(method != NULL, "invariant");
+ const Klass* const klass = method->method_holder();
+ assert(klass != NULL, "invariant");
assert(METHOD_AND_CLASS_USED_THIS_EPOCH(klass), "invariant");
assert(METHOD_FLAG_USED_THIS_EPOCH(method), "invariant");
SET_LEAKP(klass);