< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahRootVerifier.cpp

Print this page
rev 55429 : 8226311: Shenandoah: Concurrent evacuation of OopStorage backed weak roots


  37 #include "gc/shared/weakProcessor.inline.hpp"
  38 #include "memory/universe.hpp"
  39 #include "runtime/thread.hpp"
  40 #include "services/management.hpp"
  41 #include "utilities/debug.hpp"
  42 
  43 // Check for overflow of number of root types.
  44 STATIC_ASSERT((static_cast<uint>(ShenandoahRootVerifier::AllRoots) + 1) > static_cast<uint>(ShenandoahRootVerifier::AllRoots));
  45 
  46 ShenandoahRootVerifier::ShenandoahRootVerifier() : _types(AllRoots) {
  47 }
  48 
  49 void ShenandoahRootVerifier::excludes(RootTypes types) {
  50   _types = static_cast<ShenandoahRootVerifier::RootTypes>(static_cast<uint>(_types) & (~static_cast<uint>(types)));
  51 }
  52 
  53 bool ShenandoahRootVerifier::verify(RootTypes type) const {
  54   return (_types & type) != 0;
  55 }
  56 




  57 void ShenandoahRootVerifier::oops_do(OopClosure* oops) {
  58   CodeBlobToOopClosure blobs(oops, !CodeBlobToOopClosure::FixRelocations);
  59   if (verify(CodeRoots)) {
  60     shenandoah_assert_locked_or_safepoint(CodeCache_lock);
  61     CodeCache::blobs_do(&blobs);
  62   }
  63 
  64   if (verify(CLDGRoots)) {
  65     shenandoah_assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
  66     CLDToOopClosure clds(oops, ClassLoaderData::_claim_none);
  67     ClassLoaderDataGraph::cld_do(&clds);
  68   }
  69 
  70   if (verify(SerialRoots)) {
  71     shenandoah_assert_safepoint();
  72     Universe::oops_do(oops);
  73     Management::oops_do(oops);
  74     JvmtiExport::oops_do(oops);
  75     ObjectSynchronizer::oops_do(oops);
  76     SystemDictionary::oops_do(oops);




  37 #include "gc/shared/weakProcessor.inline.hpp"
  38 #include "memory/universe.hpp"
  39 #include "runtime/thread.hpp"
  40 #include "services/management.hpp"
  41 #include "utilities/debug.hpp"
  42 
  43 // Check for overflow of number of root types.
  44 STATIC_ASSERT((static_cast<uint>(ShenandoahRootVerifier::AllRoots) + 1) > static_cast<uint>(ShenandoahRootVerifier::AllRoots));
  45 
  46 ShenandoahRootVerifier::ShenandoahRootVerifier() : _types(AllRoots) {
  47 }
  48 
  49 void ShenandoahRootVerifier::excludes(RootTypes types) {
  50   _types = static_cast<ShenandoahRootVerifier::RootTypes>(static_cast<uint>(_types) & (~static_cast<uint>(types)));
  51 }
  52 
  53 bool ShenandoahRootVerifier::verify(RootTypes type) const {
  54   return (_types & type) != 0;
  55 }
  56 
  57 ShenandoahRootVerifier::RootTypes ShenandoahRootVerifier::combine(RootTypes t1, RootTypes t2) {
  58   return static_cast<ShenandoahRootVerifier::RootTypes>(static_cast<uint>(t1) | static_cast<uint>(t2));
  59 }
  60 
  61 void ShenandoahRootVerifier::oops_do(OopClosure* oops) {
  62   CodeBlobToOopClosure blobs(oops, !CodeBlobToOopClosure::FixRelocations);
  63   if (verify(CodeRoots)) {
  64     shenandoah_assert_locked_or_safepoint(CodeCache_lock);
  65     CodeCache::blobs_do(&blobs);
  66   }
  67 
  68   if (verify(CLDGRoots)) {
  69     shenandoah_assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
  70     CLDToOopClosure clds(oops, ClassLoaderData::_claim_none);
  71     ClassLoaderDataGraph::cld_do(&clds);
  72   }
  73 
  74   if (verify(SerialRoots)) {
  75     shenandoah_assert_safepoint();
  76     Universe::oops_do(oops);
  77     Management::oops_do(oops);
  78     JvmtiExport::oops_do(oops);
  79     ObjectSynchronizer::oops_do(oops);
  80     SystemDictionary::oops_do(oops);


< prev index next >