< prev index next >

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

Print this page




 948 private:
 949   template <class T>
 950   void do_oop_work(T* p) {
 951     T o = RawAccess<>::oop_load(p);
 952     if (!CompressedOops::is_null(o)) {
 953       oop obj = CompressedOops::decode_not_null(o);
 954       oop fwd = (oop) ShenandoahForwarding::get_forwardee_raw_unchecked(obj);
 955       if (!oopDesc::equals_raw(obj, fwd)) {
 956         ShenandoahAsserts::print_failure(ShenandoahAsserts::_safe_all, obj, p, NULL,
 957                                          "Verify Roots", "Should not be forwarded", __FILE__, __LINE__);
 958       }
 959     }
 960   }
 961 
 962 public:
 963   void do_oop(narrowOop* p) { do_oop_work(p); }
 964   void do_oop(oop* p)       { do_oop_work(p); }
 965 };
 966 
 967 void ShenandoahVerifier::verify_roots_no_forwarded() {

 968   ShenandoahRootVerifier verifier;
 969   ShenandoahVerifyNoForwared cl;
 970   verifier.oops_do(&cl);
 971 }
 972 
 973 void ShenandoahVerifier::verify_roots_no_forwarded_except(ShenandoahRootVerifier::RootTypes types) {

 974   ShenandoahRootVerifier verifier;
 975   verifier.excludes(types);
 976   ShenandoahVerifyNoForwared cl;
 977   verifier.oops_do(&cl);
 978 }


 948 private:
 949   template <class T>
 950   void do_oop_work(T* p) {
 951     T o = RawAccess<>::oop_load(p);
 952     if (!CompressedOops::is_null(o)) {
 953       oop obj = CompressedOops::decode_not_null(o);
 954       oop fwd = (oop) ShenandoahForwarding::get_forwardee_raw_unchecked(obj);
 955       if (!oopDesc::equals_raw(obj, fwd)) {
 956         ShenandoahAsserts::print_failure(ShenandoahAsserts::_safe_all, obj, p, NULL,
 957                                          "Verify Roots", "Should not be forwarded", __FILE__, __LINE__);
 958       }
 959     }
 960   }
 961 
 962 public:
 963   void do_oop(narrowOop* p) { do_oop_work(p); }
 964   void do_oop(oop* p)       { do_oop_work(p); }
 965 };
 966 
 967 void ShenandoahVerifier::verify_roots_no_forwarded() {
 968   guarantee(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "only when nothing else happens");
 969   ShenandoahRootVerifier verifier;
 970   ShenandoahVerifyNoForwared cl;
 971   verifier.oops_do(&cl);
 972 }
 973 
 974 void ShenandoahVerifier::verify_roots_no_forwarded_except(ShenandoahRootVerifier::RootTypes types) {
 975   guarantee(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "only when nothing else happens");
 976   ShenandoahRootVerifier verifier;
 977   verifier.excludes(types);
 978   ShenandoahVerifyNoForwared cl;
 979   verifier.oops_do(&cl);
 980 }
< prev index next >