< prev index next >

src/share/vm/gc_interface/collectedHeap.cpp

Print this page




 203   assert(Heap_lock->is_locked(), "Precondition#2");
 204   GCCauseSetter gcs(this, cause);
 205   switch (cause) {
 206     case GCCause::_heap_inspection:
 207     case GCCause::_heap_dump:
 208     case GCCause::_metadata_GC_threshold : {
 209       HandleMark hm;
 210       do_full_collection(false);        // don't clear all soft refs
 211       break;
 212     }
 213     case GCCause::_last_ditch_collection: {
 214       HandleMark hm;
 215       do_full_collection(true);         // do clear all soft refs
 216       break;
 217     }
 218     default:
 219       ShouldNotReachHere(); // Unexpected use of this function
 220   }
 221 }
 222 





 223 void CollectedHeap::pre_initialize() {
 224   // Used for ReduceInitialCardMarks (when COMPILER2 is used);
 225   // otherwise remains unused.
 226 #ifdef COMPILER2
 227   _defer_initial_card_mark =    ReduceInitialCardMarks && can_elide_tlab_store_barriers()
 228                              && (DeferInitialCardMark || card_mark_must_follow_store());
 229 #else
 230   assert(_defer_initial_card_mark == false, "Who would set it?");
 231 #endif
 232 }
 233 
 234 #ifndef PRODUCT
 235 void CollectedHeap::check_for_bad_heap_word_value(HeapWord* addr, size_t size) {
 236   if (CheckMemoryInitialization && ZapUnusedHeapArea) {
 237     for (size_t slot = 0; slot < size; slot += 1) {
 238       assert((*(intptr_t*) (addr + slot)) != ((intptr_t) badHeapWordVal),
 239              "Found badHeapWordValue in post-allocation check");
 240     }
 241   }
 242 }




 203   assert(Heap_lock->is_locked(), "Precondition#2");
 204   GCCauseSetter gcs(this, cause);
 205   switch (cause) {
 206     case GCCause::_heap_inspection:
 207     case GCCause::_heap_dump:
 208     case GCCause::_metadata_GC_threshold : {
 209       HandleMark hm;
 210       do_full_collection(false);        // don't clear all soft refs
 211       break;
 212     }
 213     case GCCause::_last_ditch_collection: {
 214       HandleMark hm;
 215       do_full_collection(true);         // do clear all soft refs
 216       break;
 217     }
 218     default:
 219       ShouldNotReachHere(); // Unexpected use of this function
 220   }
 221 }
 222 
 223 void CollectedHeap::set_barrier_set(BarrierSet* barrier_set) {
 224   _barrier_set = barrier_set;
 225   oopDesc::set_bs(_barrier_set);
 226 }
 227 
 228 void CollectedHeap::pre_initialize() {
 229   // Used for ReduceInitialCardMarks (when COMPILER2 is used);
 230   // otherwise remains unused.
 231 #ifdef COMPILER2
 232   _defer_initial_card_mark =    ReduceInitialCardMarks && can_elide_tlab_store_barriers()
 233                              && (DeferInitialCardMark || card_mark_must_follow_store());
 234 #else
 235   assert(_defer_initial_card_mark == false, "Who would set it?");
 236 #endif
 237 }
 238 
 239 #ifndef PRODUCT
 240 void CollectedHeap::check_for_bad_heap_word_value(HeapWord* addr, size_t size) {
 241   if (CheckMemoryInitialization && ZapUnusedHeapArea) {
 242     for (size_t slot = 0; slot < size; slot += 1) {
 243       assert((*(intptr_t*) (addr + slot)) != ((intptr_t) badHeapWordVal),
 244              "Found badHeapWordValue in post-allocation check");
 245     }
 246   }
 247 }


< prev index next >