hotspot/src/share/vm/oops/instanceKlass.cpp
changeset 25356 4a4a482298a6
parent 25351 7c198a690050
child 25490 59f226da8d81
equal deleted inserted replaced
25355:29c97629997e 25356:4a4a482298a6
    33 #include "interpreter/oopMapCache.hpp"
    33 #include "interpreter/oopMapCache.hpp"
    34 #include "interpreter/rewriter.hpp"
    34 #include "interpreter/rewriter.hpp"
    35 #include "jvmtifiles/jvmti.h"
    35 #include "jvmtifiles/jvmti.h"
    36 #include "memory/genOopClosures.inline.hpp"
    36 #include "memory/genOopClosures.inline.hpp"
    37 #include "memory/heapInspection.hpp"
    37 #include "memory/heapInspection.hpp"
       
    38 #include "memory/iterator.inline.hpp"
    38 #include "memory/metadataFactory.hpp"
    39 #include "memory/metadataFactory.hpp"
    39 #include "memory/oopFactory.hpp"
    40 #include "memory/oopFactory.hpp"
    40 #include "oops/fieldStreams.hpp"
    41 #include "oops/fieldStreams.hpp"
    41 #include "oops/instanceClassLoaderKlass.hpp"
    42 #include "oops/instanceClassLoaderKlass.hpp"
    42 #include "oops/instanceKlass.hpp"
    43 #include "oops/instanceKlass.hpp"
  2112 #endif // INCLUDE_ALL_GCS
  2113 #endif // INCLUDE_ALL_GCS
  2113 
  2114 
  2114 // closure's do_metadata() method dictates whether the given closure should be
  2115 // closure's do_metadata() method dictates whether the given closure should be
  2115 // applied to the klass ptr in the object header.
  2116 // applied to the klass ptr in the object header.
  2116 
  2117 
  2117 #define if_do_metadata_checked(closure, nv_suffix)                    \
       
  2118   /* Make sure the non-virtual and the virtual versions match. */     \
       
  2119   assert(closure->do_metadata##nv_suffix() == closure->do_metadata(), \
       
  2120       "Inconsistency in do_metadata");                                \
       
  2121   if (closure->do_metadata##nv_suffix())
       
  2122 
       
  2123 #define InstanceKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix)        \
  2118 #define InstanceKlass_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix)        \
  2124                                                                              \
  2119                                                                              \
  2125 int InstanceKlass::oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \
  2120 int InstanceKlass::oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \
  2126   SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::ik);\
  2121   SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::ik);\
  2127   /* header */                                                          \
  2122   /* header */                                                          \
  2141 #define InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \
  2136 #define InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \
  2142                                                                                 \
  2137                                                                                 \
  2143 int InstanceKlass::oop_oop_iterate_backwards##nv_suffix(oop obj,                \
  2138 int InstanceKlass::oop_oop_iterate_backwards##nv_suffix(oop obj,                \
  2144                                               OopClosureType* closure) {        \
  2139                                               OopClosureType* closure) {        \
  2145   SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::ik); \
  2140   SpecializationStats::record_iterate_call##nv_suffix(SpecializationStats::ik); \
  2146   /* header */                                                                  \
  2141                                                                                 \
  2147   if_do_metadata_checked(closure, nv_suffix) {                                  \
  2142   assert_should_ignore_metadata(closure, nv_suffix);                            \
  2148     closure->do_klass##nv_suffix(obj->klass());                                 \
  2143                                                                                 \
  2149   }                                                                             \
       
  2150   /* instance variables */                                                      \
  2144   /* instance variables */                                                      \
  2151   InstanceKlass_OOP_MAP_REVERSE_ITERATE(                                        \
  2145   InstanceKlass_OOP_MAP_REVERSE_ITERATE(                                        \
  2152     obj,                                                                        \
  2146     obj,                                                                        \
  2153     SpecializationStats::record_do_oop_call##nv_suffix(SpecializationStats::ik);\
  2147     SpecializationStats::record_do_oop_call##nv_suffix(SpecializationStats::ik);\
  2154     (closure)->do_oop##nv_suffix(p),                                            \
  2148     (closure)->do_oop##nv_suffix(p),                                            \