提交 3072d4b7 编写于 作者: J jmasa

6843292: "Expect to be beyond new region unless impacting another region" assertion too strong

Summary: In the assertion allow for collision with the guard page.
Reviewed-by: tonyp, ysr, jcoomes
上级 a86d61a9
...@@ -253,8 +253,16 @@ void CardTableModRefBS::resize_covered_region(MemRegion new_region) { ...@@ -253,8 +253,16 @@ void CardTableModRefBS::resize_covered_region(MemRegion new_region) {
} }
#endif #endif
// The guard page is always committed and should not be committed over. // The guard page is always committed and should not be committed over.
HeapWord* const new_end_for_commit = MIN2(new_end_aligned, // "guarded" is used for assertion checking below and recalls the fact
_guard_region.start()); // that the would-be end of the new committed region would have
// penetrated the guard page.
HeapWord* new_end_for_commit = new_end_aligned;
DEBUG_ONLY(bool guarded = false;)
if (new_end_for_commit > _guard_region.start()) {
new_end_for_commit = _guard_region.start();
DEBUG_ONLY(guarded = true;)
}
if (new_end_for_commit > cur_committed.end()) { if (new_end_for_commit > cur_committed.end()) {
// Must commit new pages. // Must commit new pages.
...@@ -302,7 +310,7 @@ void CardTableModRefBS::resize_covered_region(MemRegion new_region) { ...@@ -302,7 +310,7 @@ void CardTableModRefBS::resize_covered_region(MemRegion new_region) {
// not the aligned up expanded region. // not the aligned up expanded region.
// jbyte* const end = byte_after(new_region.last()); // jbyte* const end = byte_after(new_region.last());
jbyte* const end = (jbyte*) new_end_for_commit; jbyte* const end = (jbyte*) new_end_for_commit;
assert((end >= byte_after(new_region.last())) || collided, assert((end >= byte_after(new_region.last())) || collided || guarded,
"Expect to be beyond new region unless impacting another region"); "Expect to be beyond new region unless impacting another region");
// do nothing if we resized downward. // do nothing if we resized downward.
#ifdef ASSERT #ifdef ASSERT
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册