6728478: Assertion at parallel promotion from young to old generation
authorjmasa
Wed, 20 Aug 2008 23:05:04 -0700
changeset 1063 f666dc7f514d
parent 1062 e13fc5f9d15c
child 1064 5a65f2fad75a
child 1372 654bcf7839bc
child 1389 854d473cbd9c
6728478: Assertion at parallel promotion from young to old generation Summary: The fix avoids a call to address_for_index() in this particular situation where it is not known if the passed index is in bounds. Reviewed-by: tonyp
hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.cpp
hotspot/src/share/vm/memory/blockOffsetTable.hpp
--- a/hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.cpp	Wed Aug 20 15:41:36 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.cpp	Wed Aug 20 23:05:04 2008 -0700
@@ -229,7 +229,7 @@
     HeapWord* first_card_start = _bsa->address_for_index(first_card_index);
     if (first_card_start < pre_top) {
       HeapWord* second_card_start =
-        _bsa->address_for_index(first_card_index + 1);
+        _bsa->inc_by_region_size(first_card_start);
 
       // Ensure enough room to fill with the smallest block
       second_card_start = MAX2(second_card_start, pre_top + AlignmentReserve);
--- a/hotspot/src/share/vm/memory/blockOffsetTable.hpp	Wed Aug 20 15:41:36 2008 -0700
+++ b/hotspot/src/share/vm/memory/blockOffsetTable.hpp	Wed Aug 20 23:05:04 2008 -0700
@@ -199,6 +199,12 @@
   // "index" in "_offset_array".
   HeapWord* address_for_index(size_t index) const;
 
+  // Return the address "p" incremented by the size of
+  // a region.  This method does not align the address
+  // returned to the start of a region.  It is a simple
+  // primitive.
+  HeapWord* inc_by_region_size(HeapWord* p) const { return p + N_words; }
+
   // Shared space support
   void serialize(SerializeOopClosure* soc, HeapWord* start, HeapWord* end);
 };