< prev index next >

src/share/vm/oops/instanceRefKlass.cpp

Print this page




  25 #include "precompiled.hpp"
  26 #include "classfile/javaClasses.hpp"
  27 #include "classfile/systemDictionary.hpp"
  28 #include "gc_implementation/shared/markSweep.inline.hpp"
  29 #include "gc_interface/collectedHeap.hpp"
  30 #include "gc_interface/collectedHeap.inline.hpp"
  31 #include "memory/genCollectedHeap.hpp"
  32 #include "memory/genOopClosures.inline.hpp"
  33 #include "oops/instanceRefKlass.hpp"
  34 #include "oops/oop.inline.hpp"
  35 #include "utilities/preserveException.hpp"
  36 #include "utilities/macros.hpp"
  37 #if INCLUDE_ALL_GCS
  38 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
  39 #include "gc_implementation/g1/g1OopClosures.inline.hpp"
  40 #include "gc_implementation/g1/g1RemSet.inline.hpp"
  41 #include "gc_implementation/g1/heapRegionManager.inline.hpp"
  42 #include "gc_implementation/parNew/parOopClosures.inline.hpp"
  43 #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
  44 #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"

  45 #include "oops/oop.pcgc.inline.hpp"
  46 #endif // INCLUDE_ALL_GCS
  47 
  48 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  49 
  50 template <class T>
  51 void specialized_oop_follow_contents(InstanceRefKlass* ref, oop obj) {
  52   T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
  53   T heap_oop = oopDesc::load_heap_oop(referent_addr);
  54   debug_only(
  55     if(TraceReferenceGC && PrintGCDetails) {
  56       gclog_or_tty->print_cr("InstanceRefKlass::oop_follow_contents " INTPTR_FORMAT, (void *)obj);
  57     }
  58   )
  59   if (!oopDesc::is_null(heap_oop)) {
  60     oop referent = oopDesc::decode_heap_oop_not_null(heap_oop);
  61     if (!referent->is_gc_marked() &&
  62         MarkSweep::ref_processor()->discover_reference(obj, ref->reference_type())) {
  63       // reference was discovered, referent will be traversed later
  64       ref->InstanceKlass::oop_follow_contents(obj);




  25 #include "precompiled.hpp"
  26 #include "classfile/javaClasses.hpp"
  27 #include "classfile/systemDictionary.hpp"
  28 #include "gc_implementation/shared/markSweep.inline.hpp"
  29 #include "gc_interface/collectedHeap.hpp"
  30 #include "gc_interface/collectedHeap.inline.hpp"
  31 #include "memory/genCollectedHeap.hpp"
  32 #include "memory/genOopClosures.inline.hpp"
  33 #include "oops/instanceRefKlass.hpp"
  34 #include "oops/oop.inline.hpp"
  35 #include "utilities/preserveException.hpp"
  36 #include "utilities/macros.hpp"
  37 #if INCLUDE_ALL_GCS
  38 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
  39 #include "gc_implementation/g1/g1OopClosures.inline.hpp"
  40 #include "gc_implementation/g1/g1RemSet.inline.hpp"
  41 #include "gc_implementation/g1/heapRegionManager.inline.hpp"
  42 #include "gc_implementation/parNew/parOopClosures.inline.hpp"
  43 #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
  44 #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
  45 #include "gc_implementation/shenandoah/shenandoahOopClosures.inline.hpp"
  46 #include "oops/oop.pcgc.inline.hpp"
  47 #endif // INCLUDE_ALL_GCS
  48 
  49 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
  50 
  51 template <class T>
  52 void specialized_oop_follow_contents(InstanceRefKlass* ref, oop obj) {
  53   T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
  54   T heap_oop = oopDesc::load_heap_oop(referent_addr);
  55   debug_only(
  56     if(TraceReferenceGC && PrintGCDetails) {
  57       gclog_or_tty->print_cr("InstanceRefKlass::oop_follow_contents " INTPTR_FORMAT, (void *)obj);
  58     }
  59   )
  60   if (!oopDesc::is_null(heap_oop)) {
  61     oop referent = oopDesc::decode_heap_oop_not_null(heap_oop);
  62     if (!referent->is_gc_marked() &&
  63         MarkSweep::ref_processor()->discover_reference(obj, ref->reference_type())) {
  64       // reference was discovered, referent will be traversed later
  65       ref->InstanceKlass::oop_follow_contents(obj);


< prev index next >