From d2d605cad549f5fb4a69ff7ddca227c6610cd14b Mon Sep 17 00:00:00 2001 From: tonyp Date: Fri, 21 Jan 2011 11:30:22 -0500 Subject: [PATCH] 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 --- src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp | 2 ++ src/share/vm/gc_implementation/g1/heapRegionSeq.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp b/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp index 8186e61ce..91fdd4a19 100644 --- a/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp +++ b/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp @@ -251,7 +251,9 @@ void ConcurrentMarkThread::run() { // 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 --git a/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp b/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp index 0363352af..2e15190c5 100644 --- a/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp +++ b/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp @@ -195,10 +195,10 @@ int HeapRegionSeq::find_contiguous(size_t num) { 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; } -- GitLab