diff src/share/vm/memory/cardTableRS.cpp @ 6:73e96e5c30df

6624765: Guarantee failure "Unexpected dirty card found" Summary: In verification take into account partial coverage of a region by a card and expansion of the card table. Reviewed-by: ysr, apetrusenko
author jmasa
date Fri, 15 Feb 2008 07:01:10 -0800
parents a61af66fc99e
children ba764ed4b6f2
line wrap: on
line diff
--- a/src/share/vm/memory/cardTableRS.cpp	Tue Feb 12 16:07:46 2008 -0800
+++ b/src/share/vm/memory/cardTableRS.cpp	Fri Feb 15 07:01:10 2008 -0800
@@ -556,10 +556,16 @@
 }
 
 
-void CardTableRS::verify_empty(MemRegion mr) {
+void CardTableRS::verify_aligned_region_empty(MemRegion mr) {
   if (!mr.is_empty()) {
     jbyte* cur_entry = byte_for(mr.start());
     jbyte* limit = byte_after(mr.last());
+    // The region mr may not start on a card boundary so
+    // the first card may reflect a write to the space
+    // just prior to mr.
+    if (!is_aligned(mr.start())) {
+      cur_entry++;
+    }
     for (;cur_entry < limit; cur_entry++) {
       guarantee(*cur_entry == CardTableModRefBS::clean_card,
                 "Unexpected dirty card found");