< prev index next >

src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp

Print this page




  60 typedef const ClassLoaderData* CldPtr;
  61 typedef const Method* MethodPtr;
  62 typedef const Symbol* SymbolPtr;
  63 typedef const JfrSymbolId::SymbolEntry* SymbolEntryPtr;
  64 typedef const JfrSymbolId::CStringEntry* CStringEntryPtr;
  65 
  66 static traceid module_id(PkgPtr pkg) {
  67   assert(pkg != NULL, "invariant");
  68   ModPtr module_entry = pkg->module();
  69   return module_entry != NULL && module_entry->is_named() ? TRACE_ID(module_entry) : 0;
  70 }
  71 
  72 static traceid package_id(KlassPtr klass) {
  73   assert(klass != NULL, "invariant");
  74   PkgPtr pkg_entry = klass->package();
  75   return pkg_entry == NULL ? 0 : TRACE_ID(pkg_entry);
  76 }
  77 
  78 static traceid cld_id(CldPtr cld) {
  79   assert(cld != NULL, "invariant");
  80   return cld->is_unsafe_anonymous() ? 0 : TRACE_ID(cld);
  81 }
  82 
  83 static void tag_leakp_klass_artifacts(KlassPtr k, bool class_unload) {
  84   assert(k != NULL, "invariant");
  85   PkgPtr pkg = k->package();
  86   if (pkg != NULL) {
  87     tag_leakp_artifact(pkg, class_unload);
  88     ModPtr module = pkg->module();
  89     if (module != NULL) {
  90       tag_leakp_artifact(module, class_unload);
  91     }
  92   }
  93   CldPtr cld = k->class_loader_data();
  94   assert(cld != NULL, "invariant");
  95   if (!cld->is_unsafe_anonymous()) {
  96     tag_leakp_artifact(cld, class_unload);
  97   }
  98 }
  99 
 100 class TagLeakpKlassArtifact {
 101   bool _class_unload;
 102  public:
 103   TagLeakpKlassArtifact(bool class_unload) : _class_unload(class_unload) {}
 104   bool operator()(KlassPtr klass) {
 105     if (_class_unload) {
 106       if (LEAKP_USED_THIS_EPOCH(klass)) {
 107         tag_leakp_klass_artifacts(klass, _class_unload);
 108       }
 109     } else {
 110       if (LEAKP_USED_PREV_EPOCH(klass)) {
 111         tag_leakp_klass_artifacts(klass, _class_unload);
 112       }
 113     }
 114     return true;
 115   }


 213   const traceid module_location_symbol_id = module_location != NULL ? artifacts->mark(module_location) : 0;
 214   writer->write((traceid)TRACE_ID(entry));
 215   writer->write(module_name_symbol_id == 0 ? (traceid)0 : (traceid)CREATE_SYMBOL_ID(module_name_symbol_id));
 216   writer->write(module_version_symbol_id == 0 ? (traceid)0 : (traceid)CREATE_SYMBOL_ID(module_version_symbol_id));
 217   writer->write(module_location_symbol_id == 0 ? (traceid)0 : (traceid)CREATE_SYMBOL_ID(module_location_symbol_id));
 218   writer->write(cld_id(entry->loader_data()));
 219   return 1;
 220 }
 221 
 222 typedef LeakPredicate<ModPtr> LeakModulePredicate;
 223 int _compare_mod_ptr_(ModPtr const& lhs, ModPtr const& rhs) { return lhs > rhs ? 1 : (lhs < rhs) ? -1 : 0; }
 224 typedef UniquePredicate<ModPtr, _compare_mod_ptr_> ModulePredicate;
 225 typedef JfrPredicatedArtifactWriterImplHost<ModPtr, LeakModulePredicate, write__artifact__module> LeakModuleWriterImpl;
 226 typedef JfrPredicatedArtifactWriterImplHost<ModPtr, ModulePredicate, write__artifact__module> ModuleWriterImpl;
 227 typedef JfrArtifactWriterHost<LeakModuleWriterImpl, TYPE_MODULE> LeakModuleWriter;
 228 typedef JfrArtifactWriterHost<ModuleWriterImpl, TYPE_MODULE> ModuleWriter;
 229 
 230 int write__artifact__classloader(JfrCheckpointWriter* writer, JfrArtifactSet* artifacts, const void* c) {
 231   assert(c != NULL, "invariant");
 232   CldPtr cld = (CldPtr)c;
 233   assert(!cld->is_unsafe_anonymous(), "invariant");
 234   const traceid cld_id = TRACE_ID(cld);
 235   // class loader type
 236   const Klass* class_loader_klass = cld->class_loader_klass();
 237   if (class_loader_klass == NULL) {
 238     // (primordial) boot class loader
 239     writer->write(cld_id); // class loader instance id
 240     writer->write((traceid)0);  // class loader type id (absence of)
 241     writer->write((traceid)CREATE_SYMBOL_ID(1)); // 1 maps to synthetic name -> "bootstrap"
 242   } else {
 243     Symbol* symbol_name = cld->name();
 244     const traceid symbol_name_id = symbol_name != NULL ? artifacts->mark(symbol_name) : 0;
 245     writer->write(cld_id); // class loader instance id
 246     writer->write(TRACE_ID(class_loader_klass)); // class loader type id
 247     writer->write(symbol_name_id == 0 ? (traceid)0 :
 248       (traceid)CREATE_SYMBOL_ID(symbol_name_id)); // class loader instance name
 249   }
 250   return 1;
 251 }
 252 
 253 typedef LeakPredicate<CldPtr> LeakCldPredicate;


 341                                              _predicate(class_unload),
 342                                              _method_used_predicate(class_unload),
 343                                              _method_flag_predicate(class_unload),
 344                                              _unique_predicate(class_unload) {}
 345 
 346   int operator()(KlassPtr klass) {
 347     assert(klass != NULL, "invariant");
 348     int count = 0;
 349     if (_predicate(klass)) {
 350       count += klass_symbols(klass);
 351       PkgPtr pkg = klass->package();
 352       if (pkg != NULL) {
 353         count += package_symbols(pkg);
 354         ModPtr module = pkg->module();
 355         if (module != NULL && module->is_named()) {
 356           count += module_symbols(module);
 357         }
 358       }
 359       CldPtr cld = klass->class_loader_data();
 360       assert(cld != NULL, "invariant");
 361       if (!cld->is_unsafe_anonymous()) {
 362         count += class_loader_symbols(cld);
 363       }
 364       if (_method_used_predicate(klass)) {
 365         count += method_symbols(klass);
 366       }
 367     }
 368     return count;
 369   }
 370 };
 371 
 372 template <template <typename> class Predicate>
 373 int KlassSymbolWriterImpl<Predicate>::klass_symbols(KlassPtr klass) {
 374   assert(klass != NULL, "invariant");
 375   assert(_predicate(klass), "invariant");
 376   const InstanceKlass* const ik = (const InstanceKlass*)klass;
 377   if (ik->is_unsafe_anonymous()) {
 378     CStringEntryPtr entry =
 379       this->_artifacts->map_cstring(JfrSymbolId::unsafe_anonymous_klass_name_hash_code(ik));
 380     assert(entry != NULL, "invariant");
 381     return _unique_predicate(entry->id()) ? write__artifact__cstring__entry__(this->_writer, entry) : 0;


 415     entry = this->_artifacts->map_symbol(sym);
 416     assert(entry != NULL, "invariant");
 417     if (_unique_predicate(entry->id())) {
 418       count += write__artifact__symbol__entry__(this->_writer, entry);
 419     }
 420   }
 421   sym = module->location();
 422   if (sym != NULL) {
 423     entry = this->_artifacts->map_symbol(sym);
 424     assert(entry != NULL, "invariant");
 425     if (_unique_predicate(entry->id())) {
 426       count += write__artifact__symbol__entry__(this->_writer, entry);
 427     }
 428   }
 429   return count;
 430 }
 431 
 432 template <template <typename> class Predicate>
 433 int KlassSymbolWriterImpl<Predicate>::class_loader_symbols(CldPtr cld) {
 434   assert(cld != NULL, "invariant");
 435   assert(!cld->is_unsafe_anonymous(), "invariant");
 436   int count = 0;
 437   // class loader type
 438   const Klass* class_loader_klass = cld->class_loader_klass();
 439   if (class_loader_klass == NULL) {
 440     // (primordial) boot class loader
 441     CStringEntryPtr entry = this->_artifacts->map_cstring(0);
 442     assert(entry != NULL, "invariant");
 443     assert(strncmp(entry->literal(),
 444       BOOTSTRAP_LOADER_NAME,
 445       BOOTSTRAP_LOADER_NAME_LEN) == 0, "invariant");
 446     if (_unique_predicate(entry->id())) {
 447       count += write__artifact__cstring__entry__(this->_writer, entry);
 448     }
 449   } else {
 450     const Symbol* class_loader_name = cld->name();
 451     if (class_loader_name != NULL) {
 452       SymbolEntryPtr entry = this->_artifacts->map_symbol(class_loader_name);
 453       assert(entry != NULL, "invariant");
 454       if (_unique_predicate(entry->id())) {
 455         count += write__artifact__symbol__entry__(this->_writer, entry);


 679   CompositeModuleWriterWithClear cmwwc(&cmw, &clear);
 680   KlassCompositeModuleWriterWithClear kmwwc(&cmwwc);
 681   _artifacts->iterate_klasses(kmwwc);
 682   CompositeModuleCallback callback(&cmwwc);
 683   _subsystem_callback = &callback;
 684   do_modules();
 685 }
 686 
 687 typedef CompositeFunctor<CldPtr, CldWriter, ClearArtifact<CldPtr> > CldWriterWithClear;
 688 typedef CompositeFunctor<CldPtr, LeakCldWriter, CldWriter> CompositeCldWriter;
 689 typedef CompositeFunctor<CldPtr, CompositeCldWriter, ClearArtifact<CldPtr> > CompositeCldWriterWithClear;
 690 typedef JfrArtifactCallbackHost<CldPtr, CldWriterWithClear> CldCallback;
 691 typedef JfrArtifactCallbackHost<CldPtr, CompositeCldWriterWithClear> CompositeCldCallback;
 692 
 693 class CldFieldSelector {
 694  public:
 695   typedef CldPtr TypePtr;
 696   static TypePtr select(KlassPtr klass) {
 697     assert(klass != NULL, "invariant");
 698     CldPtr cld = klass->class_loader_data();
 699     return cld->is_unsafe_anonymous() ? NULL : cld;
 700   }
 701 };
 702 
 703 typedef KlassToFieldEnvelope<CldFieldSelector, CldWriterWithClear> KlassCldWriterWithClear;
 704 typedef KlassToFieldEnvelope<CldFieldSelector, CompositeCldWriterWithClear> KlassCompositeCldWriterWithClear;
 705 
 706 /*
 707  * Composite operation
 708  *
 709  * LeakpClassLoaderWriter ->
 710  *   ClassLoaderWriter ->
 711  *     ClearArtifact<ClassLoaderData>
 712  */
 713 void JfrTypeSet::write_class_loader_constants(JfrCheckpointWriter* writer, JfrCheckpointWriter* leakp_writer) {
 714   assert(_artifacts->has_klass_entries(), "invariant");
 715   ClearArtifact<CldPtr> clear(_class_unload);
 716   CldWriter cldw(writer, _artifacts, _class_unload);
 717   if (leakp_writer == NULL) {
 718     CldWriterWithClear cldwwc(&cldw, &clear);
 719     KlassCldWriterWithClear kcldwwc(&cldwwc);


 905   assert(_subsystem_callback != NULL, "invariant");
 906   if (ANY_USED_THIS_EPOCH(cld)) { // includes leakp subset
 907     _subsystem_callback->do_artifact(cld);
 908   }
 909 }
 910 
 911 void JfrTypeSet::do_class_loader_data(ClassLoaderData* cld) {
 912   assert(_subsystem_callback != NULL, "invariant");
 913   if (ANY_USED_PREV_EPOCH(cld)) { // includes leakp subset
 914     _subsystem_callback->do_artifact(cld);
 915   }
 916 }
 917 
 918 class CLDCallback : public CLDClosure {
 919  private:
 920   bool _class_unload;
 921  public:
 922   CLDCallback(bool class_unload) : _class_unload(class_unload) {}
 923   void do_cld(ClassLoaderData* cld) {
 924      assert(cld != NULL, "invariant");
 925     if (cld->is_unsafe_anonymous()) {
 926       return;
 927     }
 928     if (_class_unload) {
 929       JfrTypeSet::do_unloaded_class_loader_data(cld);
 930       return;
 931     }
 932     JfrTypeSet::do_class_loader_data(cld);
 933   }
 934 };
 935 
 936 void JfrTypeSet::do_class_loaders() {
 937   CLDCallback cld_cb(_class_unload);
 938   if (_class_unload) {
 939     ClassLoaderDataGraph::cld_unloading_do(&cld_cb);
 940     return;
 941   }
 942   ClassLoaderDataGraph::loaded_cld_do(&cld_cb);
 943 }
 944 
 945 static void clear_artifacts(JfrArtifactSet* artifacts,




  60 typedef const ClassLoaderData* CldPtr;
  61 typedef const Method* MethodPtr;
  62 typedef const Symbol* SymbolPtr;
  63 typedef const JfrSymbolId::SymbolEntry* SymbolEntryPtr;
  64 typedef const JfrSymbolId::CStringEntry* CStringEntryPtr;
  65 
  66 static traceid module_id(PkgPtr pkg) {
  67   assert(pkg != NULL, "invariant");
  68   ModPtr module_entry = pkg->module();
  69   return module_entry != NULL && module_entry->is_named() ? TRACE_ID(module_entry) : 0;
  70 }
  71 
  72 static traceid package_id(KlassPtr klass) {
  73   assert(klass != NULL, "invariant");
  74   PkgPtr pkg_entry = klass->package();
  75   return pkg_entry == NULL ? 0 : TRACE_ID(pkg_entry);
  76 }
  77 
  78 static traceid cld_id(CldPtr cld) {
  79   assert(cld != NULL, "invariant");
  80   return cld->is_shortlived() ? 0 : TRACE_ID(cld);
  81 }
  82 
  83 static void tag_leakp_klass_artifacts(KlassPtr k, bool class_unload) {
  84   assert(k != NULL, "invariant");
  85   PkgPtr pkg = k->package();
  86   if (pkg != NULL) {
  87     tag_leakp_artifact(pkg, class_unload);
  88     ModPtr module = pkg->module();
  89     if (module != NULL) {
  90       tag_leakp_artifact(module, class_unload);
  91     }
  92   }
  93   CldPtr cld = k->class_loader_data();
  94   assert(cld != NULL, "invariant");
  95   if (!cld->is_shortlived()) {
  96     tag_leakp_artifact(cld, class_unload);
  97   }
  98 }
  99 
 100 class TagLeakpKlassArtifact {
 101   bool _class_unload;
 102  public:
 103   TagLeakpKlassArtifact(bool class_unload) : _class_unload(class_unload) {}
 104   bool operator()(KlassPtr klass) {
 105     if (_class_unload) {
 106       if (LEAKP_USED_THIS_EPOCH(klass)) {
 107         tag_leakp_klass_artifacts(klass, _class_unload);
 108       }
 109     } else {
 110       if (LEAKP_USED_PREV_EPOCH(klass)) {
 111         tag_leakp_klass_artifacts(klass, _class_unload);
 112       }
 113     }
 114     return true;
 115   }


 213   const traceid module_location_symbol_id = module_location != NULL ? artifacts->mark(module_location) : 0;
 214   writer->write((traceid)TRACE_ID(entry));
 215   writer->write(module_name_symbol_id == 0 ? (traceid)0 : (traceid)CREATE_SYMBOL_ID(module_name_symbol_id));
 216   writer->write(module_version_symbol_id == 0 ? (traceid)0 : (traceid)CREATE_SYMBOL_ID(module_version_symbol_id));
 217   writer->write(module_location_symbol_id == 0 ? (traceid)0 : (traceid)CREATE_SYMBOL_ID(module_location_symbol_id));
 218   writer->write(cld_id(entry->loader_data()));
 219   return 1;
 220 }
 221 
 222 typedef LeakPredicate<ModPtr> LeakModulePredicate;
 223 int _compare_mod_ptr_(ModPtr const& lhs, ModPtr const& rhs) { return lhs > rhs ? 1 : (lhs < rhs) ? -1 : 0; }
 224 typedef UniquePredicate<ModPtr, _compare_mod_ptr_> ModulePredicate;
 225 typedef JfrPredicatedArtifactWriterImplHost<ModPtr, LeakModulePredicate, write__artifact__module> LeakModuleWriterImpl;
 226 typedef JfrPredicatedArtifactWriterImplHost<ModPtr, ModulePredicate, write__artifact__module> ModuleWriterImpl;
 227 typedef JfrArtifactWriterHost<LeakModuleWriterImpl, TYPE_MODULE> LeakModuleWriter;
 228 typedef JfrArtifactWriterHost<ModuleWriterImpl, TYPE_MODULE> ModuleWriter;
 229 
 230 int write__artifact__classloader(JfrCheckpointWriter* writer, JfrArtifactSet* artifacts, const void* c) {
 231   assert(c != NULL, "invariant");
 232   CldPtr cld = (CldPtr)c;
 233   assert(!cld->is_shortlived(), "invariant");
 234   const traceid cld_id = TRACE_ID(cld);
 235   // class loader type
 236   const Klass* class_loader_klass = cld->class_loader_klass();
 237   if (class_loader_klass == NULL) {
 238     // (primordial) boot class loader
 239     writer->write(cld_id); // class loader instance id
 240     writer->write((traceid)0);  // class loader type id (absence of)
 241     writer->write((traceid)CREATE_SYMBOL_ID(1)); // 1 maps to synthetic name -> "bootstrap"
 242   } else {
 243     Symbol* symbol_name = cld->name();
 244     const traceid symbol_name_id = symbol_name != NULL ? artifacts->mark(symbol_name) : 0;
 245     writer->write(cld_id); // class loader instance id
 246     writer->write(TRACE_ID(class_loader_klass)); // class loader type id
 247     writer->write(symbol_name_id == 0 ? (traceid)0 :
 248       (traceid)CREATE_SYMBOL_ID(symbol_name_id)); // class loader instance name
 249   }
 250   return 1;
 251 }
 252 
 253 typedef LeakPredicate<CldPtr> LeakCldPredicate;


 341                                              _predicate(class_unload),
 342                                              _method_used_predicate(class_unload),
 343                                              _method_flag_predicate(class_unload),
 344                                              _unique_predicate(class_unload) {}
 345 
 346   int operator()(KlassPtr klass) {
 347     assert(klass != NULL, "invariant");
 348     int count = 0;
 349     if (_predicate(klass)) {
 350       count += klass_symbols(klass);
 351       PkgPtr pkg = klass->package();
 352       if (pkg != NULL) {
 353         count += package_symbols(pkg);
 354         ModPtr module = pkg->module();
 355         if (module != NULL && module->is_named()) {
 356           count += module_symbols(module);
 357         }
 358       }
 359       CldPtr cld = klass->class_loader_data();
 360       assert(cld != NULL, "invariant");
 361       if (!cld->is_shortlived()) {
 362         count += class_loader_symbols(cld);
 363       }
 364       if (_method_used_predicate(klass)) {
 365         count += method_symbols(klass);
 366       }
 367     }
 368     return count;
 369   }
 370 };
 371 
 372 template <template <typename> class Predicate>
 373 int KlassSymbolWriterImpl<Predicate>::klass_symbols(KlassPtr klass) {
 374   assert(klass != NULL, "invariant");
 375   assert(_predicate(klass), "invariant");
 376   const InstanceKlass* const ik = (const InstanceKlass*)klass;
 377   if (ik->is_unsafe_anonymous()) {
 378     CStringEntryPtr entry =
 379       this->_artifacts->map_cstring(JfrSymbolId::unsafe_anonymous_klass_name_hash_code(ik));
 380     assert(entry != NULL, "invariant");
 381     return _unique_predicate(entry->id()) ? write__artifact__cstring__entry__(this->_writer, entry) : 0;


 415     entry = this->_artifacts->map_symbol(sym);
 416     assert(entry != NULL, "invariant");
 417     if (_unique_predicate(entry->id())) {
 418       count += write__artifact__symbol__entry__(this->_writer, entry);
 419     }
 420   }
 421   sym = module->location();
 422   if (sym != NULL) {
 423     entry = this->_artifacts->map_symbol(sym);
 424     assert(entry != NULL, "invariant");
 425     if (_unique_predicate(entry->id())) {
 426       count += write__artifact__symbol__entry__(this->_writer, entry);
 427     }
 428   }
 429   return count;
 430 }
 431 
 432 template <template <typename> class Predicate>
 433 int KlassSymbolWriterImpl<Predicate>::class_loader_symbols(CldPtr cld) {
 434   assert(cld != NULL, "invariant");
 435   assert(!cld->is_shortlived(), "invariant");
 436   int count = 0;
 437   // class loader type
 438   const Klass* class_loader_klass = cld->class_loader_klass();
 439   if (class_loader_klass == NULL) {
 440     // (primordial) boot class loader
 441     CStringEntryPtr entry = this->_artifacts->map_cstring(0);
 442     assert(entry != NULL, "invariant");
 443     assert(strncmp(entry->literal(),
 444       BOOTSTRAP_LOADER_NAME,
 445       BOOTSTRAP_LOADER_NAME_LEN) == 0, "invariant");
 446     if (_unique_predicate(entry->id())) {
 447       count += write__artifact__cstring__entry__(this->_writer, entry);
 448     }
 449   } else {
 450     const Symbol* class_loader_name = cld->name();
 451     if (class_loader_name != NULL) {
 452       SymbolEntryPtr entry = this->_artifacts->map_symbol(class_loader_name);
 453       assert(entry != NULL, "invariant");
 454       if (_unique_predicate(entry->id())) {
 455         count += write__artifact__symbol__entry__(this->_writer, entry);


 679   CompositeModuleWriterWithClear cmwwc(&cmw, &clear);
 680   KlassCompositeModuleWriterWithClear kmwwc(&cmwwc);
 681   _artifacts->iterate_klasses(kmwwc);
 682   CompositeModuleCallback callback(&cmwwc);
 683   _subsystem_callback = &callback;
 684   do_modules();
 685 }
 686 
 687 typedef CompositeFunctor<CldPtr, CldWriter, ClearArtifact<CldPtr> > CldWriterWithClear;
 688 typedef CompositeFunctor<CldPtr, LeakCldWriter, CldWriter> CompositeCldWriter;
 689 typedef CompositeFunctor<CldPtr, CompositeCldWriter, ClearArtifact<CldPtr> > CompositeCldWriterWithClear;
 690 typedef JfrArtifactCallbackHost<CldPtr, CldWriterWithClear> CldCallback;
 691 typedef JfrArtifactCallbackHost<CldPtr, CompositeCldWriterWithClear> CompositeCldCallback;
 692 
 693 class CldFieldSelector {
 694  public:
 695   typedef CldPtr TypePtr;
 696   static TypePtr select(KlassPtr klass) {
 697     assert(klass != NULL, "invariant");
 698     CldPtr cld = klass->class_loader_data();
 699     return cld->is_shortlived() ? NULL : cld;
 700   }
 701 };
 702 
 703 typedef KlassToFieldEnvelope<CldFieldSelector, CldWriterWithClear> KlassCldWriterWithClear;
 704 typedef KlassToFieldEnvelope<CldFieldSelector, CompositeCldWriterWithClear> KlassCompositeCldWriterWithClear;
 705 
 706 /*
 707  * Composite operation
 708  *
 709  * LeakpClassLoaderWriter ->
 710  *   ClassLoaderWriter ->
 711  *     ClearArtifact<ClassLoaderData>
 712  */
 713 void JfrTypeSet::write_class_loader_constants(JfrCheckpointWriter* writer, JfrCheckpointWriter* leakp_writer) {
 714   assert(_artifacts->has_klass_entries(), "invariant");
 715   ClearArtifact<CldPtr> clear(_class_unload);
 716   CldWriter cldw(writer, _artifacts, _class_unload);
 717   if (leakp_writer == NULL) {
 718     CldWriterWithClear cldwwc(&cldw, &clear);
 719     KlassCldWriterWithClear kcldwwc(&cldwwc);


 905   assert(_subsystem_callback != NULL, "invariant");
 906   if (ANY_USED_THIS_EPOCH(cld)) { // includes leakp subset
 907     _subsystem_callback->do_artifact(cld);
 908   }
 909 }
 910 
 911 void JfrTypeSet::do_class_loader_data(ClassLoaderData* cld) {
 912   assert(_subsystem_callback != NULL, "invariant");
 913   if (ANY_USED_PREV_EPOCH(cld)) { // includes leakp subset
 914     _subsystem_callback->do_artifact(cld);
 915   }
 916 }
 917 
 918 class CLDCallback : public CLDClosure {
 919  private:
 920   bool _class_unload;
 921  public:
 922   CLDCallback(bool class_unload) : _class_unload(class_unload) {}
 923   void do_cld(ClassLoaderData* cld) {
 924      assert(cld != NULL, "invariant");
 925     if (cld->is_shortlived()) {
 926       return;
 927     }
 928     if (_class_unload) {
 929       JfrTypeSet::do_unloaded_class_loader_data(cld);
 930       return;
 931     }
 932     JfrTypeSet::do_class_loader_data(cld);
 933   }
 934 };
 935 
 936 void JfrTypeSet::do_class_loaders() {
 937   CLDCallback cld_cb(_class_unload);
 938   if (_class_unload) {
 939     ClassLoaderDataGraph::cld_unloading_do(&cld_cb);
 940     return;
 941   }
 942   ClassLoaderDataGraph::loaded_cld_do(&cld_cb);
 943 }
 944 
 945 static void clear_artifacts(JfrArtifactSet* artifacts,


< prev index next >