1.1 --- a/src/share/vm/classfile/classLoaderData.hpp Thu Aug 01 03:44:03 2019 +0100 1.2 +++ b/src/share/vm/classfile/classLoaderData.hpp Mon Aug 12 18:30:40 2019 +0300 1.3 @@ -32,8 +32,8 @@ 1.4 #include "runtime/mutex.hpp" 1.5 #include "utilities/growableArray.hpp" 1.6 #include "utilities/macros.hpp" 1.7 -#if INCLUDE_TRACE 1.8 -#include "utilities/ticks.hpp" 1.9 +#if INCLUDE_JFR 1.10 +#include "jfr/support/jfrTraceIdExtension.hpp" 1.11 #endif 1.12 1.13 // 1.14 @@ -70,7 +70,6 @@ 1.15 static bool _should_purge; 1.16 1.17 static ClassLoaderData* add(Handle class_loader, bool anonymous, TRAPS); 1.18 - static void post_class_unload_events(void); 1.19 static void clean_metaspaces(); 1.20 public: 1.21 static ClassLoaderData* find_or_create(Handle class_loader, TRAPS); 1.22 @@ -82,6 +81,7 @@ 1.23 static void always_strong_oops_do(OopClosure* blk, KlassClosure* klass_closure, bool must_claim); 1.24 // cld do 1.25 static void cld_do(CLDClosure* cl); 1.26 + static void cld_unloading_do(CLDClosure* cl); 1.27 static void roots_cld_do(CLDClosure* strong, CLDClosure* weak); 1.28 static void keep_alive_cld_do(CLDClosure* cl); 1.29 static void always_strong_cld_do(CLDClosure* cl); 1.30 @@ -116,12 +116,6 @@ 1.31 #ifndef PRODUCT 1.32 static bool contains_loader_data(ClassLoaderData* loader_data); 1.33 #endif 1.34 - 1.35 -#if INCLUDE_TRACE 1.36 - private: 1.37 - static Ticks _class_unload_time; 1.38 - static void class_unload_event(Klass* const k); 1.39 -#endif 1.40 }; 1.41 1.42 // ClassLoaderData class 1.43 @@ -213,6 +207,8 @@ 1.44 static Metaspace* _ro_metaspace; 1.45 static Metaspace* _rw_metaspace; 1.46 1.47 + JFR_ONLY(DEFINE_TRACE_ID_FIELD;) 1.48 + 1.49 void set_next(ClassLoaderData* next) { _next = next; } 1.50 ClassLoaderData* next() const { return _next; } 1.51 1.52 @@ -223,11 +219,6 @@ 1.53 1.54 Mutex* metaspace_lock() const { return _metaspace_lock; } 1.55 1.56 - // GC interface. 1.57 - void clear_claimed() { _claimed = 0; } 1.58 - bool claimed() const { return _claimed == 1; } 1.59 - bool claim(); 1.60 - 1.61 void unload(); 1.62 bool keep_alive() const { return _keep_alive; } 1.63 void classes_do(void f(Klass*)); 1.64 @@ -242,6 +233,11 @@ 1.65 1.66 public: 1.67 1.68 + // GC interface. 1.69 + void clear_claimed() { _claimed = 0; } 1.70 + bool claimed() const { return _claimed == 1; } 1.71 + bool claim(); 1.72 + 1.73 bool is_alive(BoolObjectClosure* is_alive_closure) const; 1.74 1.75 // Accessors 1.76 @@ -325,6 +321,8 @@ 1.77 Metaspace* ro_metaspace(); 1.78 Metaspace* rw_metaspace(); 1.79 void initialize_shared_metaspaces(); 1.80 + 1.81 + JFR_ONLY(DEFINE_TRACE_ID_METHODS;) 1.82 }; 1.83 1.84 // An iterator that distributes Klasses to parallel worker threads.