31 32 class ClassFileParser; 33 34 // An InstanceClassLoaderKlass is a specialization of the InstanceKlass. It does 35 // not add any field. It is added to walk the dependencies for the class loader 36 // key that this class loader points to. This is how the loader_data graph is 37 // walked and dependant class loaders are kept alive. I thought we walked 38 // the list later? 39 40 class InstanceClassLoaderKlass: public InstanceKlass { 41 friend class VMStructs; 42 friend class InstanceKlass; 43 private: 44 InstanceClassLoaderKlass(const ClassFileParser& parser) : InstanceKlass(parser, InstanceKlass::_misc_kind_class_loader) {} 45 46 public: 47 InstanceClassLoaderKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); } 48 49 // GC specific object visitors 50 // 51 #if INCLUDE_ALL_GCS 52 // Parallel Scavenge 53 void oop_ps_push_contents( oop obj, PSPromotionManager* pm); 54 // Parallel Compact 55 void oop_pc_follow_contents(oop obj, ParCompactionManager* cm); 56 void oop_pc_update_pointers(oop obj, ParCompactionManager* cm); 57 #endif 58 59 // Oop fields (and metadata) iterators 60 // [nv = true] Use non-virtual calls to do_oop_nv. 61 // [nv = false] Use virtual calls to do_oop. 62 // 63 // The InstanceClassLoaderKlass iterators also visit the CLD pointer (or mirror of anonymous klasses.) 64 65 private: 66 // Forward iteration 67 // Iterate over the oop fields and metadata. 68 template <bool nv, class OopClosureType> 69 inline void oop_oop_iterate(oop obj, OopClosureType* closure); 70 71 #if INCLUDE_ALL_GCS 72 // Reverse iteration 73 // Iterate over the oop fields and metadata. 74 template <bool nv, class OopClosureType> 75 inline void oop_oop_iterate_reverse(oop obj, OopClosureType* closure); 76 #endif 77 78 // Bounded range iteration 79 // Iterate over the oop fields and metadata. 80 template <bool nv, class OopClosureType> 81 inline void oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr); 82 83 public: 84 85 ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL) 86 ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL) 87 88 #if INCLUDE_ALL_GCS 89 ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_BACKWARDS) 90 ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_BACKWARDS) 91 #endif // INCLUDE_ALL_GCS 92 93 }; 94 95 #endif // SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP | 31 32 class ClassFileParser; 33 34 // An InstanceClassLoaderKlass is a specialization of the InstanceKlass. It does 35 // not add any field. It is added to walk the dependencies for the class loader 36 // key that this class loader points to. This is how the loader_data graph is 37 // walked and dependant class loaders are kept alive. I thought we walked 38 // the list later? 39 40 class InstanceClassLoaderKlass: public InstanceKlass { 41 friend class VMStructs; 42 friend class InstanceKlass; 43 private: 44 InstanceClassLoaderKlass(const ClassFileParser& parser) : InstanceKlass(parser, InstanceKlass::_misc_kind_class_loader) {} 45 46 public: 47 InstanceClassLoaderKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); } 48 49 // GC specific object visitors 50 // 51 #if INCLUDE_PARALLELGC 52 // Parallel Scavenge 53 void oop_ps_push_contents( oop obj, PSPromotionManager* pm); 54 // Parallel Compact 55 void oop_pc_follow_contents(oop obj, ParCompactionManager* cm); 56 void oop_pc_update_pointers(oop obj, ParCompactionManager* cm); 57 #endif 58 59 // Oop fields (and metadata) iterators 60 // [nv = true] Use non-virtual calls to do_oop_nv. 61 // [nv = false] Use virtual calls to do_oop. 62 // 63 // The InstanceClassLoaderKlass iterators also visit the CLD pointer (or mirror of anonymous klasses.) 64 65 private: 66 // Forward iteration 67 // Iterate over the oop fields and metadata. 68 template <bool nv, class OopClosureType> 69 inline void oop_oop_iterate(oop obj, OopClosureType* closure); 70 71 #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS 72 // Reverse iteration 73 // Iterate over the oop fields and metadata. 74 template <bool nv, class OopClosureType> 75 inline void oop_oop_iterate_reverse(oop obj, OopClosureType* closure); 76 #endif 77 78 // Bounded range iteration 79 // Iterate over the oop fields and metadata. 80 template <bool nv, class OopClosureType> 81 inline void oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr); 82 83 public: 84 85 ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL) 86 ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL) 87 88 #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS 89 ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_BACKWARDS) 90 ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_BACKWARDS) 91 #endif 92 93 }; 94 95 #endif // SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP |