< prev index next >

src/hotspot/share/oops/instanceClassLoaderKlass.hpp

8211447_01: revision due to comments from StefanJ and Thomas

8211447: Replace oop_pc_update_pointers with oop_iterate and closure

15  * 2 along with this work; if not, write to the Free Software Foundation,                                                  
16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.                                                           
17  *                                                                                                                         
18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA                                                 
19  * or visit www.oracle.com if you need additional information or have any                                                  
20  * questions.                                                                                                              
21  *                                                                                                                         
22  */                                                                                                                        
23 
24 #ifndef SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP                                                                         
25 #define SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP                                                                         
26 
27 #include "oops/instanceKlass.hpp"                                                                                          
28 #include "utilities/macros.hpp"                                                                                            
29 
30 class ClassFileParser;                                                                                                     
31 
32 // An InstanceClassLoaderKlass is a specialization of the InstanceKlass. It does                                           
33 // not add any field.  It is added to walk the dependencies for the class loader                                           
34 // key that this class loader points to.  This is how the loader_data graph is                                             
35 // walked and dependant class loaders are kept alive.  I thought we walked                                                 
36 // the list later?                                                                                                         
37 
38 class InstanceClassLoaderKlass: public InstanceKlass {                                                                     
39   friend class VMStructs;                                                                                                  
40   friend class InstanceKlass;                                                                                              
41 public:                                                                                                                    
42   static const KlassID ID = InstanceClassLoaderKlassID;                                                                    
43 
44 private:                                                                                                                   
45   InstanceClassLoaderKlass(const ClassFileParser& parser) : InstanceKlass(parser, InstanceKlass::_misc_kind_class_loader, I
46 
47 public:                                                                                                                    
48   InstanceClassLoaderKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }                              
49 
50   // GC specific object visitors                                                                                           
51   //                                                                                                                       
52 #if INCLUDE_PARALLELGC                                                                                                     
53   // Parallel Compact                                                                                                      
54   void oop_pc_update_pointers(oop obj, ParCompactionManager* cm);                                                          
55 #endif                                                                                                                     
56                                                                                                                            
57   // Oop fields (and metadata) iterators                                                                                   
58   //                                                                                                                       
59   // The InstanceClassLoaderKlass iterators also visit the CLD pointer (or mirror of anonymous klasses.)                   
60 
61  public:                                                                                                                   
62   // Forward iteration                                                                                                     
63   // Iterate over the oop fields and metadata.                                                                             
64   template <typename T, class OopClosureType>                                                                              
65   inline void oop_oop_iterate(oop obj, OopClosureType* closure);                                                           
66 
67   // Reverse iteration                                                                                                     
68   // Iterate over the oop fields and metadata.                                                                             
69   template <typename T, class OopClosureType>                                                                              
70   inline void oop_oop_iterate_reverse(oop obj, OopClosureType* closure);                                                   
71 
72   // Bounded range iteration                                                                                               
73   // Iterate over the oop fields and metadata.                                                                             
74   template <typename T, class OopClosureType>                                                                              
75   inline void oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr);                                     
76 };                                                                                                                         
77 
78 #endif // SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP                                                                       

15  * 2 along with this work; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17  *
18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19  * or visit www.oracle.com if you need additional information or have any
20  * questions.
21  *
22  */
23 
24 #ifndef SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP
25 #define SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP
26 
27 #include "oops/instanceKlass.hpp"
28 #include "utilities/macros.hpp"
29 
30 class ClassFileParser;
31 
32 // An InstanceClassLoaderKlass is a specialization of the InstanceKlass. It does
33 // not add any field.  It is added to walk the dependencies for the class loader
34 // key that this class loader points to.  This is how the loader_data graph is
35 // walked and dependent class loaders are kept alive.  I thought we walked
36 // the list later?
37 
38 class InstanceClassLoaderKlass: public InstanceKlass {
39   friend class VMStructs;
40   friend class InstanceKlass;
41 public:
42   static const KlassID ID = InstanceClassLoaderKlassID;
43 
44 private:
45   InstanceClassLoaderKlass(const ClassFileParser& parser) : InstanceKlass(parser, InstanceKlass::_misc_kind_class_loader, I
46 
47 public:
48   InstanceClassLoaderKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
49 







50   // Oop fields (and metadata) iterators
51   //
52   // The InstanceClassLoaderKlass iterators also visit the CLD pointer (or mirror of anonymous klasses.)
53 

54   // Forward iteration
55   // Iterate over the oop fields and metadata.
56   template <typename T, class OopClosureType>
57   inline void oop_oop_iterate(oop obj, OopClosureType* closure);
58 
59   // Reverse iteration
60   // Iterate over the oop fields and metadata.
61   template <typename T, class OopClosureType>
62   inline void oop_oop_iterate_reverse(oop obj, OopClosureType* closure);
63 
64   // Bounded range iteration
65   // Iterate over the oop fields and metadata.
66   template <typename T, class OopClosureType>
67   inline void oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr);
68 };
69 
70 #endif // SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP
< prev index next >