< prev index next >

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

Print this page
@@ -464,10 +464,21 @@
                    "Interior location should not be in collection set",
                    file, line);
    }
  }
  
+ void ShenandoahAsserts::assert_in_young(void* interior_loc, oop obj, const char* file, int line) {
+   assert_correct(interior_loc, obj, file, line);
+ 
+   ShenandoahHeap* heap = ShenandoahHeap::heap();
+   if (!heap->heap_region_containing(obj)->is_young()) {
+     print_failure(_safe_all, obj, interior_loc, nullptr, "Shenandoah assert_in_young failed",
+                   "Object should be in young region",
+                   file, line);
+   }
+ }
+ 
  void ShenandoahAsserts::print_rp_failure(const char *label, BoolObjectClosure* actual,
                                           const char *file, int line) {
    ShenandoahMessageBuffer msg("%s\n", label);
    msg.append(" Actual:                  " PTR_FORMAT "\n", p2i(actual));
    report_vm_error(file, line, msg.buffer());
< prev index next >