# HG changeset patch # User tonyp # Date 1295627422 18000 # Node ID a672e43650cce9c1a1f6b27e841c581167805066 # Parent 377371490991635658bbd0ce6ae2c0c53d4ee9fd 7013718: G1: small fixes for two assert/guarantee failures Summary: Two small fixes to deal with a guarantee failure (the marking thread should join the SuspendibleThreadSet before calling a method that does pause prediction work so that said method is never called during a pause) and an assert failure (an assert is too strong). Reviewed-by: iveresov, johnc diff -r 377371490991 -r a672e43650cc src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp --- a/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp Thu Jan 20 13:57:12 2011 -0800 +++ b/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp Fri Jan 21 11:30:22 2011 -0500 @@ -251,7 +251,9 @@ // Now do the remainder of the cleanup operation. _cm->completeCleanup(); + _sts.join(); g1_policy->record_concurrent_mark_cleanup_completed(); + _sts.leave(); double cleanup_end_sec = os::elapsedTime(); if (PrintGC) { diff -r 377371490991 -r a672e43650cc src/share/vm/gc_implementation/g1/heapRegionSeq.cpp --- a/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp Thu Jan 20 13:57:12 2011 -0800 +++ b/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp Fri Jan 21 11:30:22 2011 -0500 @@ -195,10 +195,10 @@ assert(0 <= res && res < _regions.length(), err_msg("res: %d should be valid", res)); _alloc_search_start = res + (int) num; + assert(0 < _alloc_search_start && _alloc_search_start <= _regions.length(), + err_msg("_alloc_search_start: %d should be valid", + _alloc_search_start)); } - assert(0 < _alloc_search_start && _alloc_search_start <= _regions.length(), - err_msg("_alloc_search_start: %d should be valid", - _alloc_search_start)); return res; }