< prev index next >

src/share/vm/oops/instanceRefKlass.inline.hpp

Print this page




  50     if (!referent->is_gc_marked() && (rp != NULL) &&
  51         rp->discover_reference(obj, reference_type())) {
  52       return;
  53     } else if (contains(referent_addr)) {
  54       // treat referent as normal oop
  55       Devirtualizer<nv>::do_oop(closure, referent_addr);
  56     }
  57   }
  58   T* next_addr = (T*)java_lang_ref_Reference::next_addr(obj);
  59   T next_oop  = oopDesc::load_heap_oop(next_addr);
  60   // Treat discovered as normal oop, if ref is not "active" (next non-NULL)
  61   if (!oopDesc::is_null(next_oop) && contains(disc_addr)) {
  62     // i.e. ref is not "active"
  63     log_develop_trace(gc, ref)("   Process discovered as normal " PTR_FORMAT, p2i(disc_addr));
  64     Devirtualizer<nv>::do_oop(closure, disc_addr);
  65   }
  66   // treat next as normal oop
  67   if (contains(next_addr)) {
  68     Devirtualizer<nv>::do_oop(closure, next_addr);
  69   }







  70 }
  71 
  72 class AlwaysContains {
  73  public:
  74   template <typename T> bool operator()(T* p) const { return true; }
  75 };
  76 
  77 template <bool nv, class OopClosureType>
  78 void InstanceRefKlass::oop_oop_iterate_ref_processing(oop obj, OopClosureType* closure) {
  79   AlwaysContains always_contains;
  80   if (UseCompressedOops) {
  81     oop_oop_iterate_ref_processing_specialized<nv, narrowOop>(obj, closure, always_contains);
  82   } else {
  83     oop_oop_iterate_ref_processing_specialized<nv, oop>(obj, closure, always_contains);
  84   }
  85 }
  86 
  87 class MrContains {
  88   const MemRegion _mr;
  89  public:




  50     if (!referent->is_gc_marked() && (rp != NULL) &&
  51         rp->discover_reference(obj, reference_type())) {
  52       return;
  53     } else if (contains(referent_addr)) {
  54       // treat referent as normal oop
  55       Devirtualizer<nv>::do_oop(closure, referent_addr);
  56     }
  57   }
  58   T* next_addr = (T*)java_lang_ref_Reference::next_addr(obj);
  59   T next_oop  = oopDesc::load_heap_oop(next_addr);
  60   // Treat discovered as normal oop, if ref is not "active" (next non-NULL)
  61   if (!oopDesc::is_null(next_oop) && contains(disc_addr)) {
  62     // i.e. ref is not "active"
  63     log_develop_trace(gc, ref)("   Process discovered as normal " PTR_FORMAT, p2i(disc_addr));
  64     Devirtualizer<nv>::do_oop(closure, disc_addr);
  65   }
  66   // treat next as normal oop
  67   if (contains(next_addr)) {
  68     Devirtualizer<nv>::do_oop(closure, next_addr);
  69   }
  70   // treat value as normal oop if Ephemeron
  71   if (reference_type() == REF_EPHEMERON) {
  72     T* value_addr = (T*)java_lang_ref_Ephemeron::value_addr(obj);
  73     if (contains(value_addr)) {
  74       Devirtualizer<nv>::do_oop(closure, value_addr);
  75     }
  76   }
  77 }
  78 
  79 class AlwaysContains {
  80  public:
  81   template <typename T> bool operator()(T* p) const { return true; }
  82 };
  83 
  84 template <bool nv, class OopClosureType>
  85 void InstanceRefKlass::oop_oop_iterate_ref_processing(oop obj, OopClosureType* closure) {
  86   AlwaysContains always_contains;
  87   if (UseCompressedOops) {
  88     oop_oop_iterate_ref_processing_specialized<nv, narrowOop>(obj, closure, always_contains);
  89   } else {
  90     oop_oop_iterate_ref_processing_specialized<nv, oop>(obj, closure, always_contains);
  91   }
  92 }
  93 
  94 class MrContains {
  95   const MemRegion _mr;
  96  public:


< prev index next >