hotspot/src/share/vm/oops/instanceKlass.hpp
changeset 30150 d9c940aa42ef
parent 29698 9be8d1b0dfdc
child 30164 0c9f9e006921
equal deleted inserted replaced
30149:c0f930abe5ed 30150:d9c940aa42ef
   952 
   952 
   953 #if INCLUDE_JVMTI
   953 #if INCLUDE_JVMTI
   954   void adjust_default_methods(InstanceKlass* holder, bool* trace_name_printed);
   954   void adjust_default_methods(InstanceKlass* holder, bool* trace_name_printed);
   955 #endif // INCLUDE_JVMTI
   955 #endif // INCLUDE_JVMTI
   956 
   956 
   957   // Garbage collection
       
   958   void oop_follow_contents(oop obj);
       
   959   int  oop_adjust_pointers(oop obj);
       
   960 
       
   961   void clean_implementors_list(BoolObjectClosure* is_alive);
   957   void clean_implementors_list(BoolObjectClosure* is_alive);
   962   void clean_method_data(BoolObjectClosure* is_alive);
   958   void clean_method_data(BoolObjectClosure* is_alive);
   963   void clean_dependent_nmethods();
   959   void clean_dependent_nmethods();
   964 
   960 
   965   // Explicit metaspace deallocation of fields
   961   // Explicit metaspace deallocation of fields
   979 
   975 
   980   // callbacks for actions during class unloading
   976   // callbacks for actions during class unloading
   981   static void notify_unload_class(InstanceKlass* ik);
   977   static void notify_unload_class(InstanceKlass* ik);
   982   static void release_C_heap_structures(InstanceKlass* ik);
   978   static void release_C_heap_structures(InstanceKlass* ik);
   983 
   979 
   984   // Parallel Scavenge and Parallel Old
       
   985   PARALLEL_GC_DECLS
       
   986 
       
   987   // Naming
   980   // Naming
   988   const char* signature_name() const;
   981   const char* signature_name() const;
   989 
   982 
   990   // Iterators
   983   // GC specific object visitors
   991   int oop_oop_iterate(oop obj, ExtendedOopClosure* blk) {
   984   //
   992     return oop_oop_iterate_v(obj, blk);
   985   // Mark Sweep
   993   }
   986   void oop_ms_follow_contents(oop obj);
   994 
   987   int  oop_ms_adjust_pointers(oop obj);
   995   int oop_oop_iterate_m(oop obj, ExtendedOopClosure* blk, MemRegion mr) {
   988 #if INCLUDE_ALL_GCS
   996     return oop_oop_iterate_v_m(obj, blk, mr);
   989   // Parallel Scavenge
   997   }
   990   void oop_ps_push_contents(  oop obj, PSPromotionManager* pm);
   998 
   991   // Parallel Compact
   999 #define InstanceKlass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix)      \
   992   void oop_pc_follow_contents(oop obj, ParCompactionManager* cm);
  1000   int  oop_oop_iterate##nv_suffix(oop obj, OopClosureType* blk);           \
   993   void oop_pc_update_pointers(oop obj);
  1001   int  oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* blk,        \
   994 #endif
  1002                                       MemRegion mr);
   995 
       
   996   // Oop fields (and metadata) iterators
       
   997   //  [nv = true]  Use non-virtual calls to do_oop_nv.
       
   998   //  [nv = false] Use virtual calls to do_oop.
       
   999   //
       
  1000   // The InstanceKlass iterators also visits the Object's klass.
       
  1001 
       
  1002   // Forward iteration
       
  1003  public:
       
  1004   // Iterate over all oop fields in the oop maps.
       
  1005   template <bool nv, class OopClosureType>
       
  1006   inline void oop_oop_iterate_oop_maps(oop obj, OopClosureType* closure);
       
  1007 
       
  1008  protected:
       
  1009   // Iterate over all oop fields and metadata.
       
  1010   template <bool nv, class OopClosureType>
       
  1011   inline int oop_oop_iterate(oop obj, OopClosureType* closure);
       
  1012 
       
  1013  private:
       
  1014   // Iterate over all oop fields in the oop maps.
       
  1015   // Specialized for [T = oop] or [T = narrowOop].
       
  1016   template <bool nv, typename T, class OopClosureType>
       
  1017   inline void oop_oop_iterate_oop_maps_specialized(oop obj, OopClosureType* closure);
       
  1018 
       
  1019   // Iterate over all oop fields in one oop map.
       
  1020   template <bool nv, typename T, class OopClosureType>
       
  1021   inline void oop_oop_iterate_oop_map(OopMapBlock* map, oop obj, OopClosureType* closure);
       
  1022 
       
  1023 
       
  1024   // Reverse iteration
       
  1025 #if INCLUDE_ALL_GCS
       
  1026  public:
       
  1027   // Iterate over all oop fields in the oop maps.
       
  1028   template <bool nv, class OopClosureType>
       
  1029   inline void oop_oop_iterate_oop_maps_reverse(oop obj, OopClosureType* closure);
       
  1030 
       
  1031  protected:
       
  1032   // Iterate over all oop fields and metadata.
       
  1033   template <bool nv, class OopClosureType>
       
  1034   inline int oop_oop_iterate_reverse(oop obj, OopClosureType* closure);
       
  1035 
       
  1036  private:
       
  1037   // Iterate over all oop fields in the oop maps.
       
  1038   // Specialized for [T = oop] or [T = narrowOop].
       
  1039   template <bool nv, typename T, class OopClosureType>
       
  1040   inline void oop_oop_iterate_oop_maps_specialized_reverse(oop obj, OopClosureType* closure);
       
  1041 
       
  1042   // Iterate over all oop fields in one oop map.
       
  1043   template <bool nv, typename T, class OopClosureType>
       
  1044   inline void oop_oop_iterate_oop_map_reverse(OopMapBlock* map, oop obj, OopClosureType* closure);
       
  1045 #endif
       
  1046 
       
  1047 
       
  1048   // Bounded range iteration
       
  1049  public:
       
  1050   // Iterate over all oop fields in the oop maps.
       
  1051   template <bool nv, class OopClosureType>
       
  1052   inline void oop_oop_iterate_oop_maps_bounded(oop obj, OopClosureType* closure, MemRegion mr);
       
  1053 
       
  1054  protected:
       
  1055   // Iterate over all oop fields and metadata.
       
  1056   template <bool nv, class OopClosureType>
       
  1057   inline int oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr);
       
  1058 
       
  1059  private:
       
  1060   // Iterate over all oop fields in the oop maps.
       
  1061   // Specialized for [T = oop] or [T = narrowOop].
       
  1062   template <bool nv, typename T, class OopClosureType>
       
  1063   inline void oop_oop_iterate_oop_maps_specialized_bounded(oop obj, OopClosureType* closure, MemRegion mr);
       
  1064 
       
  1065   // Iterate over all oop fields in one oop map.
       
  1066   template <bool nv, typename T, class OopClosureType>
       
  1067   inline void oop_oop_iterate_oop_map_bounded(OopMapBlock* map, oop obj, OopClosureType* closure, MemRegion mr);
       
  1068 
       
  1069 
       
  1070  public:
       
  1071 
       
  1072 #define InstanceKlass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix)                   \
       
  1073   int  oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure);                    \
       
  1074   int  oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* closure, MemRegion mr);
  1003 
  1075 
  1004   ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_DECL)
  1076   ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_DECL)
  1005   ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_DECL)
  1077   ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_DECL)
  1006 
  1078 
  1007 #if INCLUDE_ALL_GCS
  1079 #if INCLUDE_ALL_GCS
  1008 #define InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \
  1080 #define InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix)  \
  1009   int  oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* blk);
  1081   int  oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure);
  1010 
  1082 
  1011   ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL)
  1083   ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL)
  1012   ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL)
  1084   ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL)
  1013 #endif // INCLUDE_ALL_GCS
  1085 #endif // INCLUDE_ALL_GCS
  1014 
  1086