< prev index next >

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

Print this page

        

@@ -89,11 +89,11 @@
 
 VirtualSpaceSummary CollectedHeap::create_heap_space_summary() {
   size_t capacity_in_words = capacity() / HeapWordSize;
 
   return VirtualSpaceSummary(
-    _reserved.start(), _reserved.start() + capacity_in_words, _reserved.end());
+    reserved_region().start(), reserved_region().start() + capacity_in_words, reserved_region().end());
 }
 
 GCHeapSummary CollectedHeap::create_heap_summary() {
   VirtualSpaceSummary heap_space = create_heap_space_summary();
   return GCHeapSummary(heap_space, used());

@@ -176,15 +176,15 @@
 bool CollectedHeap::is_oop(oop object) const {
   if (!check_obj_alignment(object)) {
     return false;
   }
 
-  if (!is_in(object)) {
+  if (!is_in_reserved(object)) {
     return false;
   }
 
-  if (is_in(object->klass_or_null())) {
+  if (is_in_reserved(object->klass_or_null())) {
     return false;
   }
 
   return true;
 }

@@ -341,15 +341,10 @@
     }
   }
 }
 #endif // PRODUCT
 
-void CollectedHeap::check_oop_location(void* addr) const {
-  assert(check_obj_alignment(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 +369,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_in_reserved(start), "not in heap");
+  assert(Universe::heap()->is_in_reserved(start + words - 1), "not in heap");
 }
 
 void CollectedHeap::zap_filler_array(HeapWord* start, size_t words, bool zap)
 {
   if (ZapFillerObjects && zap) {

@@ -519,16 +514,16 @@
 
 void CollectedHeap::post_full_gc_dump(GCTimer* timer) {
   full_gc_dump(timer, false);
 }
 
-void CollectedHeap::initialize_reserved_region(const ReservedHeapSpace& rs) {
+void CollectedHeap::initialize_reserved_region(HeapWord *start, HeapWord *end) {
   // It is important to do this in a way such that concurrent readers can't
   // temporarily think something is in the heap.  (Seen this happen in asserts.)
   _reserved.set_word_size(0);
-  _reserved.set_start((HeapWord*)rs.base());
-  _reserved.set_end((HeapWord*)rs.end());
+  _reserved.set_start(start);
+  _reserved.set_end(end);
 }
 
 void CollectedHeap::post_initialize() {
   initialize_serviceability();
 }
< prev index next >