hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
changeset 5079 c8e827e5dc2b
parent 5035 0e498c4df637
child 5082 19e725a3d2eb
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp	Thu Mar 11 11:44:43 2010 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp	Thu Mar 18 01:48:28 2010 -0700
@@ -3704,7 +3704,14 @@
         // enough to point to the next possible object header (the
         // bitmap knows by how much we need to move it as it knows its
         // granularity).
-        move_finger_to(_nextMarkBitMap->nextWord(_finger));
+        assert(_finger < _region_limit, "invariant");
+        HeapWord* new_finger = _nextMarkBitMap->nextWord(_finger);
+        // Check if bitmap iteration was aborted while scanning the last object
+        if (new_finger >= _region_limit) {
+            giveup_current_region();
+        } else {
+            move_finger_to(new_finger);
+        }
       }
     }
     // At this point we have either completed iterating over the