mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-14 09:53:18 +00:00
8373062: JFR build failure with CDS disabled
Reviewed-by: egahlin
This commit is contained in:
parent
b5970c97bd
commit
bcbdf90fce
@ -1146,17 +1146,6 @@ void SystemDictionary::load_shared_class_misc(InstanceKlass* ik, ClassLoaderData
|
||||
}
|
||||
}
|
||||
|
||||
#if INCLUDE_JFR
|
||||
void SystemDictionary::post_class_load_event(EventClassLoad* event, const InstanceKlass* k, const ClassLoaderData* init_cld) {
|
||||
assert(event != nullptr, "invariant");
|
||||
assert(k != nullptr, "invariant");
|
||||
event->set_loadedClass(k);
|
||||
event->set_definingClassLoader(k->class_loader_data());
|
||||
event->set_initiatingClassLoader(init_cld);
|
||||
event->commit();
|
||||
}
|
||||
#endif // INCLUDE_JFR
|
||||
|
||||
// This is much more lightweight than SystemDictionary::resolve_or_null
|
||||
// - There's only a single Java thread at this point. No need for placeholder.
|
||||
// - All supertypes of ik have been loaded
|
||||
@ -1217,6 +1206,17 @@ void SystemDictionary::preload_class(Handle class_loader, InstanceKlass* ik, TRA
|
||||
|
||||
#endif // INCLUDE_CDS
|
||||
|
||||
#if INCLUDE_JFR
|
||||
void SystemDictionary::post_class_load_event(EventClassLoad* event, const InstanceKlass* k, const ClassLoaderData* init_cld) {
|
||||
assert(event != nullptr, "invariant");
|
||||
assert(k != nullptr, "invariant");
|
||||
event->set_loadedClass(k);
|
||||
event->set_definingClassLoader(k->class_loader_data());
|
||||
event->set_initiatingClassLoader(init_cld);
|
||||
event->commit();
|
||||
}
|
||||
#endif // INCLUDE_JFR
|
||||
|
||||
InstanceKlass* SystemDictionary::load_instance_class_impl(Symbol* class_name, Handle class_loader, TRAPS) {
|
||||
|
||||
if (class_loader.is_null()) {
|
||||
|
||||
@ -173,6 +173,7 @@ bool Jfr::on_start_flight_recording_option(const JavaVMOption** option, char* de
|
||||
return JfrOptionSet::parse_start_flight_recording_option(option, delimiter);
|
||||
}
|
||||
|
||||
#if INCLUDE_CDS
|
||||
void Jfr::on_restoration(const Klass* k, JavaThread* jt) {
|
||||
assert(k != nullptr, "invariant");
|
||||
JfrTraceId::restore(k);
|
||||
@ -180,3 +181,4 @@ void Jfr::on_restoration(const Klass* k, JavaThread* jt) {
|
||||
JfrClassDefineEvent::on_restoration(InstanceKlass::cast(k), jt);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -79,7 +79,7 @@ class Jfr : AllStatic {
|
||||
static void initialize_main_thread(JavaThread* jt);
|
||||
static bool has_sample_request(JavaThread* jt);
|
||||
static void check_and_process_sample_request(JavaThread* jt);
|
||||
static void on_restoration(const Klass* k, JavaThread* jt);
|
||||
CDS_ONLY(static void on_restoration(const Klass* k, JavaThread* jt);)
|
||||
};
|
||||
|
||||
#endif // SHARE_JFR_JFR_HPP
|
||||
|
||||
@ -171,6 +171,7 @@ void JfrClassDefineEvent::on_creation(const InstanceKlass* ik, const ClassFilePa
|
||||
}
|
||||
}
|
||||
|
||||
#if INCLUDE_CDS
|
||||
void JfrClassDefineEvent::on_restoration(const InstanceKlass* ik, JavaThread* jt) {
|
||||
assert(ik != nullptr, "invariant");
|
||||
assert(ik->trace_id() != 0, "invariant");
|
||||
@ -186,3 +187,4 @@ void JfrClassDefineEvent::on_restoration(const InstanceKlass* ik, JavaThread* jt
|
||||
send_event(ik, cl->is_modules_image() ? module_path(ik, jt) : get_source(cl, jt));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
#define SHARE_JFR_SUPPORT_JFRCLASSDEFINEEVENT_HPP
|
||||
|
||||
#include "memory/allStatic.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
|
||||
class ClassFileParser;
|
||||
class InstanceKlass;
|
||||
@ -34,7 +35,7 @@ class JavaThread;
|
||||
class JfrClassDefineEvent : AllStatic {
|
||||
public:
|
||||
static void on_creation(const InstanceKlass* ik, const ClassFileParser& parser, JavaThread* jt);
|
||||
static void on_restoration(const InstanceKlass* ik, JavaThread* jt);
|
||||
CDS_ONLY(static void on_restoration(const InstanceKlass* ik, JavaThread* jt);)
|
||||
};
|
||||
|
||||
#endif // SHARE_JFR_SUPPORT_JFRCLASSDEFINEEVENT_HPP
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user