--- old/src/share/vm/classfile/systemDictionary.cpp 2020-01-16 16:56:28.883517810 +0300 +++ new/src/share/vm/classfile/systemDictionary.cpp 2020-01-16 16:56:28.835519359 +0300 @@ -38,8 +38,10 @@ #include "compiler/compileBroker.hpp" #include "interpreter/bytecodeStream.hpp" #include "interpreter/interpreter.hpp" +#if INCLUDE_JFR #include "jfr/jfrEvents.hpp" #include "jfr/jni/jfrUpcalls.hpp" +#endif #include "memory/filemap.hpp" #include "memory/gcLocker.hpp" #include "memory/oopFactory.hpp" @@ -603,11 +605,11 @@ return (nh); } +#if INCLUDE_JFR // utility function for class load event static void post_class_load_event(EventClassLoad &event, instanceKlassHandle k, Handle initiating_loader) { -#if INCLUDE_JFR if (event.should_commit()) { event.set_loadedClass(k()); event.set_definingClassLoader(k->class_loader_data()); @@ -617,8 +619,8 @@ (ClassLoaderData*)NULL); event.commit(); } -#endif // INCLUDE_JFR } +#endif // INCLUDE_JFR Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name, Handle class_loader, @@ -627,7 +629,9 @@ assert(name != NULL && !FieldType::is_array(name) && !FieldType::is_obj(name), "invalid class name"); +#if INCLUDE_JFR EventClassLoad class_load_start_event; +#endif // UseNewReflection // Fix for 4474172; see evaluation for more details @@ -878,7 +882,9 @@ return NULL; } +#if INCLUDE_JFR post_class_load_event(class_load_start_event, k, class_loader); +#endif #ifdef ASSERT { @@ -1003,7 +1009,9 @@ TRAPS) { TempNewSymbol parsed_name = NULL; +#if INCLUDE_JFR EventClassLoad class_load_start_event; +#endif ClassLoaderData* loader_data; if (host_klass.not_null()) { @@ -1064,7 +1072,9 @@ JvmtiExport::post_class_load((JavaThread *) THREAD, k()); } +#if INCLUDE_JFR post_class_load_event(class_load_start_event, k, class_loader); +#endif } assert(host_klass.not_null() || cp_patches == NULL, "cp_patches only found with host_klass"); @@ -1434,6 +1444,7 @@ } } +#if INCLUDE_JFR static void post_class_define_event(InstanceKlass* k, const ClassLoaderData* def_cld) { EventClassDefine event; if (event.should_commit()) { @@ -1442,6 +1453,7 @@ event.commit(); } } +#endif void SystemDictionary::define_instance_class(instanceKlassHandle k, TRAPS) { @@ -1513,7 +1525,9 @@ } +#if INCLUDE_JFR post_class_define_event(k(), loader_data); +#endif } // Support parallel classloading