< prev index next >

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

Print this page

        

@@ -962,55 +962,19 @@
 public:
   void do_oop(narrowOop* p) { do_oop_work(p); }
   void do_oop(oop* p)       { do_oop_work(p); }
 };
 
-class ShenandoahVerifyInToSpaceClosure : public OopClosure {
-private:
-  template <class T>
-  void do_oop_work(T* p) {
-    T o = RawAccess<>::oop_load(p);
-    if (!CompressedOops::is_null(o)) {
-      oop obj = CompressedOops::decode_not_null(o);
-      ShenandoahHeap* heap = ShenandoahHeap::heap_no_check();
-
-      if (!heap->marking_context()->is_marked(obj)) {
-        ShenandoahAsserts::print_failure(ShenandoahAsserts::_safe_all, obj, p, NULL,
-                "Verify Roots In To-Space", "Should be marked", __FILE__, __LINE__);
-      }
-
-      if (heap->in_collection_set(obj)) {
-        ShenandoahAsserts::print_failure(ShenandoahAsserts::_safe_all, obj, p, NULL,
-                "Verify Roots In To-Space", "Should not be in collection set", __FILE__, __LINE__);
-      }
-
-      oop fwd = (oop) ShenandoahForwarding::get_forwardee_raw_unchecked(obj);
-      if (!oopDesc::equals_raw(obj, fwd)) {
-        ShenandoahAsserts::print_failure(ShenandoahAsserts::_safe_all, obj, p, NULL,
-                "Verify Roots In To-Space", "Should not be forwarded", __FILE__, __LINE__);
-      }
-    }
-  }
-
-public:
-  void do_oop(narrowOop* p) { do_oop_work(p); }
-  void do_oop(oop* p)       { do_oop_work(p); }
-};
-
-void ShenandoahVerifier::verify_roots_in_to_space() {
-  ShenandoahRootVerifier verifier;
-  ShenandoahVerifyInToSpaceClosure cl;
-  verifier.oops_do(&cl);
-}
-
 void ShenandoahVerifier::verify_roots_no_forwarded() {
+  guarantee(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "only when nothing else happens");
   ShenandoahRootVerifier verifier;
   ShenandoahVerifyNoForwared cl;
   verifier.oops_do(&cl);
 }
 
 void ShenandoahVerifier::verify_roots_no_forwarded_except(ShenandoahRootVerifier::RootTypes types) {
+  guarantee(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "only when nothing else happens");
   ShenandoahRootVerifier verifier;
   verifier.excludes(types);
   ShenandoahVerifyNoForwared cl;
   verifier.oops_do(&cl);
 }
< prev index next >