From 614115f2614427ee5e25136acc7fec06708aae83 Mon Sep 17 00:00:00 2001 From: ysr Date: Fri, 10 Sep 2010 17:07:55 -0700 Subject: [PATCH] 6983930: CMS: Various small cleanups ca September 2010 Summary: Fixed comment/documentation typos; converted some guarantee()s to assert()s. Reviewed-by: jmasa --- .../concurrentMarkSweep/binaryTreeDictionary.cpp | 4 ++-- .../concurrentMarkSweep/compactibleFreeListSpace.cpp | 6 +++--- .../concurrentMarkSweepGeneration.cpp | 2 +- .../gc_implementation/concurrentMarkSweep/freeList.cpp | 9 ++------- .../concurrentMarkSweep/promotionInfo.cpp | 4 ++-- src/share/vm/runtime/globals.hpp | 4 ++-- 6 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp index aac936ca2..5455523a9 100644 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp @@ -256,7 +256,7 @@ TreeChunk* TreeList::head_as_TreeChunk() { } TreeChunk* TreeList::first_available() { - guarantee(head() != NULL, "The head of the list cannot be NULL"); + assert(head() != NULL, "The head of the list cannot be NULL"); FreeChunk* fc = head()->next(); TreeChunk* retTC; if (fc == NULL) { @@ -272,7 +272,7 @@ TreeChunk* TreeList::first_available() { // those in the list for this size; potentially slow and expensive, // use with caution! TreeChunk* TreeList::largest_address() { - guarantee(head() != NULL, "The head of the list cannot be NULL"); + assert(head() != NULL, "The head of the list cannot be NULL"); FreeChunk* fc = head()->next(); TreeChunk* retTC; if (fc == NULL) { diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp index 30982f3dd..7c1d13de3 100644 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp @@ -1946,8 +1946,8 @@ void CompactibleFreeListSpace::save_marks() { bool CompactibleFreeListSpace::no_allocs_since_save_marks() { assert(_promoInfo.tracking(), "No preceding save_marks?"); - guarantee(SharedHeap::heap()->n_par_threads() == 0, - "Shouldn't be called (yet) during parallel part of gc."); + assert(SharedHeap::heap()->n_par_threads() == 0, + "Shouldn't be called if using parallel gc."); return _promoInfo.noPromotions(); } @@ -2569,7 +2569,7 @@ void CFLS_LAB::modify_initialization(size_t n, unsigned wt) { HeapWord* CFLS_LAB::alloc(size_t word_sz) { FreeChunk* res; - guarantee(word_sz == _cfls->adjustObjectSize(word_sz), "Error"); + assert(word_sz == _cfls->adjustObjectSize(word_sz), "Error"); if (word_sz >= CompactibleFreeListSpace::IndexSetSize) { // This locking manages sync with other large object allocations. MutexLockerEx x(_cfls->parDictionaryAllocLock(), diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp index f5d19544e..aab22dacf 100644 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp @@ -1332,7 +1332,7 @@ ConcurrentMarkSweepGeneration::allocation_limit_reached(Space* space, // ----------------------------------------------------- // FREE: klass_word & 1 == 1; mark_word holds block size // -// OBJECT: klass_word installed; klass_word != 0 && klass_word & 0 == 0; +// OBJECT: klass_word installed; klass_word != 0 && klass_word & 1 == 0; // obj->size() computes correct size // [Perm Gen objects needs to be "parsable" before they can be navigated] // diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp index ab9d88215..eebd8bb33 100644 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp @@ -165,13 +165,8 @@ void FreeList::removeChunk(FreeChunk*fc) { "Next of tail should be NULL"); } decrement_count(); -#define TRAP_CODE 1 -#if TRAP_CODE - if (head() == NULL) { - guarantee(tail() == NULL, "INVARIANT"); - guarantee(count() == 0, "INVARIANT"); - } -#endif + assert(((head() == NULL) + (tail() == NULL) + (count() == 0)) % 3 == 0, + "H/T/C Inconsistency"); // clear next and prev fields of fc, debug only NOT_PRODUCT( fc->linkPrev(NULL); diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp index 09602b5b7..fda8624ba 100644 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp @@ -253,8 +253,8 @@ void PromotionInfo::print_statistics(uint worker_id) const { cur_spool = cur_spool->nextSpoolBlock) { // the first entry is just a self-pointer; indices 1 through // bufferSize - 1 are occupied (thus, bufferSize - 1 slots). - guarantee((void*)cur_spool->displacedHdr == (void*)&cur_spool->displacedHdr, - "first entry of displacedHdr should be self-referential"); + assert((void*)cur_spool->displacedHdr == (void*)&cur_spool->displacedHdr, + "first entry of displacedHdr should be self-referential"); slots += cur_spool->bufferSize - 1; blocks++; } diff --git a/src/share/vm/runtime/globals.hpp b/src/share/vm/runtime/globals.hpp index 874235061..45378ec10 100644 --- a/src/share/vm/runtime/globals.hpp +++ b/src/share/vm/runtime/globals.hpp @@ -1541,13 +1541,13 @@ class CommandLineFlags { "Use BinaryTreeDictionary as default in the CMS generation") \ \ product(uintx, CMSIndexedFreeListReplenish, 4, \ - "Replenish and indexed free list with this number of chunks") \ + "Replenish an indexed free list with this number of chunks") \ \ product(bool, CMSReplenishIntermediate, true, \ "Replenish all intermediate free-list caches") \ \ product(bool, CMSSplitIndexedFreeListBlocks, true, \ - "When satisfying batched demand, splot blocks from the " \ + "When satisfying batched demand, split blocks from the " \ "IndexedFreeList whose size is a multiple of requested size") \ \ product(bool, CMSLoopWarn, false, \ -- GitLab