< prev index next >

src/hotspot/share/gc/shared/collectedHeap.cpp

Print this page

        

@@ -171,10 +171,22 @@
 
 bool CollectedHeap::request_concurrent_phase(const char* phase) {
   return false;
 }
 
+bool CollectedHeap::is_oop_location(void* addr) const {
+  if (!is_object_aligned(addr)) {
+    return false;
+  }
+
+  if (!_reserved.contains(addr)) {
+    return false;
+  }
+
+  return true;
+}
+
 bool CollectedHeap::is_oop(oop object) const {
   if (!is_object_aligned(object)) {
     return false;
   }
 

@@ -341,15 +353,10 @@
     }
   }
 }
 #endif // PRODUCT
 
-void CollectedHeap::check_oop_location(void* addr) const {
-  assert(is_object_aligned(addr), "address is not aligned");
-  assert(_reserved.contains(addr),  "address is not in reserved heap");
-}
-
 size_t CollectedHeap::max_tlab_size() const {
   // TLABs can't be bigger than we can fill with a int[Integer.MAX_VALUE].
   // This restriction could be removed by enabling filling with multiple arrays.
   // If we compute that the reasonable way as
   //    header_size + ((sizeof(jint) * max_jint) / HeapWordSize)

@@ -374,12 +381,12 @@
 #ifdef ASSERT
 void CollectedHeap::fill_args_check(HeapWord* start, size_t words)
 {
   assert(words >= min_fill_size(), "too small to fill");
   assert(is_object_aligned(words), "unaligned size");
-  DEBUG_ONLY(Universe::heap()->check_oop_location(start);)
-  DEBUG_ONLY(Universe::heap()->check_oop_location(start + words - MinObjAlignment);)
+  assert(Universe::heap()->is_oop_location(start), "invalid address");
+  assert(Universe::heap()->is_oop_location(start + words - MinObjAlignment), "invalid address");
 }
 
 void CollectedHeap::zap_filler_array(HeapWord* start, size_t words, bool zap)
 {
   if (ZapFillerObjects && zap) {
< prev index next >