1.1 --- a/src/share/vm/memory/cardTableModRefBS.cpp Fri Jul 31 10:41:29 2009 -0700 1.2 +++ b/src/share/vm/memory/cardTableModRefBS.cpp Sun Aug 02 19:10:31 2009 -0700 1.3 @@ -253,8 +253,16 @@ 1.4 } 1.5 #endif 1.6 // The guard page is always committed and should not be committed over. 1.7 - HeapWord* const new_end_for_commit = MIN2(new_end_aligned, 1.8 - _guard_region.start()); 1.9 + // "guarded" is used for assertion checking below and recalls the fact 1.10 + // that the would-be end of the new committed region would have 1.11 + // penetrated the guard page. 1.12 + HeapWord* new_end_for_commit = new_end_aligned; 1.13 + 1.14 + DEBUG_ONLY(bool guarded = false;) 1.15 + if (new_end_for_commit > _guard_region.start()) { 1.16 + new_end_for_commit = _guard_region.start(); 1.17 + DEBUG_ONLY(guarded = true;) 1.18 + } 1.19 1.20 if (new_end_for_commit > cur_committed.end()) { 1.21 // Must commit new pages. 1.22 @@ -302,7 +310,7 @@ 1.23 // not the aligned up expanded region. 1.24 // jbyte* const end = byte_after(new_region.last()); 1.25 jbyte* const end = (jbyte*) new_end_for_commit; 1.26 - assert((end >= byte_after(new_region.last())) || collided, 1.27 + assert((end >= byte_after(new_region.last())) || collided || guarded, 1.28 "Expect to be beyond new region unless impacting another region"); 1.29 // do nothing if we resized downward. 1.30 #ifdef ASSERT