< prev index next >

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

Print this page




  71 
  72 private:
  73   void check(ShenandoahAsserts::SafeLevel level, oop obj, bool test, const char* label) {
  74     if (!test) {
  75       ShenandoahAsserts::print_failure(level, obj, _interior_loc, _loc, _phase, label, __FILE__, __LINE__);
  76     }
  77   }
  78 
  79   template <class T>
  80   void do_oop_work(T* p) {
  81     T o = RawAccess<>::oop_load(p);
  82     if (!CompressedOops::is_null(o)) {
  83       oop obj = CompressedOops::decode_not_null(o);
  84 
  85       // Single threaded verification can use faster non-atomic stack and bitmap
  86       // methods.
  87       //
  88       // For performance reasons, only fully verify non-marked field values.
  89       // We are here when the host object for *p is already marked.
  90 
  91       if (_map->par_mark(obj)) {

  92         verify_oop_at(p, obj);
  93         _stack->push(ShenandoahVerifierTask(obj));
  94       }
  95     }
  96   }
  97 
  98   void verify_oop(oop obj) {
  99     // Perform consistency checks with gradually decreasing safety level. This guarantees
 100     // that failure report would not try to touch something that was not yet verified to be
 101     // safe to process.
 102 
 103     check(ShenandoahAsserts::_safe_unknown, obj, _heap->is_in(obj),
 104               "oop must be in heap");
 105     check(ShenandoahAsserts::_safe_unknown, obj, is_object_aligned(obj),
 106               "oop must be aligned");
 107 
 108     ShenandoahHeapRegion *obj_reg = _heap->heap_region_containing(obj);
 109     Klass* obj_klass = obj->klass_or_null();
 110 
 111     // Verify that obj is not in dead space:




  71 
  72 private:
  73   void check(ShenandoahAsserts::SafeLevel level, oop obj, bool test, const char* label) {
  74     if (!test) {
  75       ShenandoahAsserts::print_failure(level, obj, _interior_loc, _loc, _phase, label, __FILE__, __LINE__);
  76     }
  77   }
  78 
  79   template <class T>
  80   void do_oop_work(T* p) {
  81     T o = RawAccess<>::oop_load(p);
  82     if (!CompressedOops::is_null(o)) {
  83       oop obj = CompressedOops::decode_not_null(o);
  84 
  85       // Single threaded verification can use faster non-atomic stack and bitmap
  86       // methods.
  87       //
  88       // For performance reasons, only fully verify non-marked field values.
  89       // We are here when the host object for *p is already marked.
  90 
  91       HeapWord* addr = cast_from_oop<HeapWord*>(obj);
  92       if (_map->par_mark(addr)) {
  93         verify_oop_at(p, obj);
  94         _stack->push(ShenandoahVerifierTask(obj));
  95       }
  96     }
  97   }
  98 
  99   void verify_oop(oop obj) {
 100     // Perform consistency checks with gradually decreasing safety level. This guarantees
 101     // that failure report would not try to touch something that was not yet verified to be
 102     // safe to process.
 103 
 104     check(ShenandoahAsserts::_safe_unknown, obj, _heap->is_in(obj),
 105               "oop must be in heap");
 106     check(ShenandoahAsserts::_safe_unknown, obj, is_object_aligned(obj),
 107               "oop must be aligned");
 108 
 109     ShenandoahHeapRegion *obj_reg = _heap->heap_region_containing(obj);
 110     Klass* obj_klass = obj->klass_or_null();
 111 
 112     // Verify that obj is not in dead space:


< prev index next >