changeset 1701:179464550c7d

6983930: CMS: Various small cleanups ca September 2010 Summary: Fixed comment/documentation typos; converted some guarantee()s to assert()s. Reviewed-by: jmasa
author ysr
date Fri, 10 Sep 2010 17:07:55 -0700
parents dee553c74493
children eeade8e89248
files src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp src/share/vm/runtime/globals.hpp
diffstat 6 files changed, 12 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp	Wed Sep 01 00:40:05 2010 -0700
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp	Fri Sep 10 17:07:55 2010 -0700
@@ -256,7 +256,7 @@
 }
 
 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 @@
 // 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) {
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp	Wed Sep 01 00:40:05 2010 -0700
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp	Fri Sep 10 17:07:55 2010 -0700
@@ -1946,8 +1946,8 @@
 
 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 @@
 
 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(),
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Wed Sep 01 00:40:05 2010 -0700
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Fri Sep 10 17:07:55 2010 -0700
@@ -1332,7 +1332,7 @@
 // -----------------------------------------------------
 // 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]
 //
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp	Wed Sep 01 00:40:05 2010 -0700
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp	Fri Sep 10 17:07:55 2010 -0700
@@ -165,13 +165,8 @@
        "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);
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp	Wed Sep 01 00:40:05 2010 -0700
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp	Fri Sep 10 17:07:55 2010 -0700
@@ -253,8 +253,8 @@
        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++;
   }
--- a/src/share/vm/runtime/globals.hpp	Wed Sep 01 00:40:05 2010 -0700
+++ b/src/share/vm/runtime/globals.hpp	Fri Sep 10 17:07:55 2010 -0700
@@ -1541,13 +1541,13 @@
           "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,                                         \