open Udiff src/hotspot/share/classfile/systemDictionary.cpp (original) (raw)
rev 49873 : 8199712: Flight Recorder Reviewed-by:
@@ -45,10 +45,11 @@ #include "compiler/compileBroker.hpp" #include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/oopStorage.inline.hpp" #include "interpreter/bytecodeStream.hpp" #include "interpreter/interpreter.hpp" +#include "jfr/jfrEvent.hpp" #include "logging/log.hpp" #include "logging/logStream.hpp" #include "memory/filemap.hpp" #include "memory/metaspaceClosure.hpp" #include "memory/oopFactory.hpp"
@@ -79,11 +80,10 @@ #include "runtime/sharedRuntime.hpp" #include "runtime/signature.hpp" #include "services/classLoadingService.hpp" #include "services/diagnosticCommand.hpp" #include "services/threadService.hpp" -#include "trace/tracing.hpp" #include "utilities/macros.hpp" #if INCLUDE_CDS #include "classfile/sharedClassUtil.hpp" #include "classfile/systemDictionaryShared.hpp" #endif
@@ -622,36 +622,20 @@ } } return NULL; }
-static void post_class_load_event(EventClassLoad* event,
const InstanceKlass* k,
const ClassLoaderData* init_cld) {
-#if INCLUDE_TRACE +static void post_class_load_event(EventClassLoad* event, const InstanceKlass* k, const ClassLoaderData* init_cld) { assert(event != NULL, "invariant"); assert(k != NULL, "invariant");
- if (event->should_commit()) {
- assert(event->should_commit(), "invariant"); event->set_loadedClass(k); event->set_definingClassLoader(k->class_loader_data()); event->set_initiatingClassLoader(init_cld); event->commit();
- } -#endif // INCLUDE_TRACE }
-static void class_define_event(InstanceKlass* k,
const ClassLoaderData* def_cld) {
-#if INCLUDE_TRACE
- EventClassDefine event;
- if (event.should_commit()) {
- event.set_definedClass(k);
- event.set_definingClassLoader(def_cld);
- event.commit();
- } -#endif // INCLUDE_TRACE -}
// Be careful when modifying this code: once you have run // placeholders()->find_and_add(PlaceholderTable::LOAD_INSTANCE), // you need to find_and_remove it before returning. // So be careful to not exit with a CHECK_ macro betweeen these calls.
@@ -880,13 +864,13 @@ } if (HAS_PENDING_EXCEPTION || k == NULL) { return NULL; }
- if (class_load_start_event.should_commit()) { post_class_load_event(&class_load_start_event, k, loader_data);
- }
#ifdef ASSERT { ClassLoaderData* loader_data = k->class_loader_data(); MutexLocker mu(SystemDictionary_lock, THREAD); Klass* kk = find_class(name, loader_data);
@@ -1044,13 +1028,14 @@ // notify jvmti if (JvmtiExport::should_post_class_load()) { assert(THREAD->is_Java_thread(), "thread->is_Java_thread()"); JvmtiExport::post_class_load((JavaThread *) THREAD, k); }
- if (class_load_start_event.should_commit()) { post_class_load_event(&class_load_start_event, k, loader_data); }
- } assert(host_klass != NULL || NULL == cp_patches, "cp_patches only found with host_klass"); return k;
}
@@ -1557,10 +1542,19 @@ // Class is not found or has the wrong name, return NULL return NULL; } }
+static void post_class_define_event(InstanceKlass* k, const ClassLoaderData* def_cld) {
EventClassDefine event;
if (event.should_commit()) {
event.set_definedClass(k);
event.set_definingClassLoader(def_cld);
event.commit();
} +}
void SystemDictionary::define_instance_class(InstanceKlass* k, TRAPS) {
HandleMark hm(THREAD); ClassLoaderData* loader_data = k->class_loader_data(); Handle class_loader_h(THREAD, loader_data->class_loader());
@@ -1625,11 +1619,11 @@ if (JvmtiExport::should_post_class_load()) { assert(THREAD->is_Java_thread(), "thread->is_Java_thread()"); JvmtiExport::post_class_load((JavaThread *) THREAD, k);
}
- class_define_event(k, loader_data);
- post_class_define_event(k, loader_data); }
// Support parallel classloading // All parallel class loaders, including bootstrap classloader // lock a placeholder entry for this class/class_loader pair