hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp
changeset 1384 163a4d4fa951
parent 1374 4c24294029a9
child 1623 a0dd9009e992
--- a/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp	Tue Jul 01 11:59:44 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp	Thu Jul 03 03:17:29 2008 -0700
@@ -412,7 +412,11 @@
   // offset table was actually a lab allocation, and was divided into
   // several objects subsequently.  Fix this situation as we answer the
   // query, by updating entries as we cross them.
-  size_t next_index = _array->index_for(n) + 1;
+
+  // If the fist object's end q is at the card boundary. Start refining
+  // with the corresponding card (the value of the entry will be basically
+  // set to 0). If the object crosses the boundary -- start from the next card.
+  size_t next_index = _array->index_for(n) + !_array->is_card_boundary(n);
   HeapWord* next_boundary = _array->address_for_index(next_index);
   if (csp() != NULL) {
     if (addr >= csp()->top()) return csp()->top();