hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp
changeset 37988 bf4018edea5e
parent 37985 539c597ee0fa
child 38011 74a6871d896b
child 38133 78b95467b9f1
equal deleted inserted replaced
37987:7b0667c9e794 37988:bf4018edea5e
    96   bool _concurrent;
    96   bool _concurrent;
    97 public:
    97 public:
    98   RefineCardTableEntryClosure() : _concurrent(true) { }
    98   RefineCardTableEntryClosure() : _concurrent(true) { }
    99 
    99 
   100   bool do_card_ptr(jbyte* card_ptr, uint worker_i) {
   100   bool do_card_ptr(jbyte* card_ptr, uint worker_i) {
   101     bool oops_into_cset = G1CollectedHeap::heap()->g1_rem_set()->refine_card(card_ptr, worker_i, false);
   101     bool oops_into_cset = G1CollectedHeap::heap()->g1_rem_set()->refine_card(card_ptr, worker_i, NULL);
   102     // This path is executed by the concurrent refine or mutator threads,
   102     // This path is executed by the concurrent refine or mutator threads,
   103     // concurrently, and so we do not care if card_ptr contains references
   103     // concurrently, and so we do not care if card_ptr contains references
   104     // that point into the collection set.
   104     // that point into the collection set.
   105     assert(!oops_into_cset, "should be");
   105     assert(!oops_into_cset, "should be");
   106 
   106 
  3088       }
  3088       }
  3089       return false;
  3089       return false;
  3090     }
  3090     }
  3091 };
  3091 };
  3092 
  3092 
  3093 #ifdef ASSERT
       
  3094 class VerifyCSetClosure: public HeapRegionClosure {
       
  3095 public:
       
  3096   bool doHeapRegion(HeapRegion* hr) {
       
  3097     // Here we check that the CSet region's RSet is ready for parallel
       
  3098     // iteration. The fields that we'll verify are only manipulated
       
  3099     // when the region is part of a CSet and is collected. Afterwards,
       
  3100     // we reset these fields when we clear the region's RSet (when the
       
  3101     // region is freed) so they are ready when the region is
       
  3102     // re-allocated. The only exception to this is if there's an
       
  3103     // evacuation failure and instead of freeing the region we leave
       
  3104     // it in the heap. In that case, we reset these fields during
       
  3105     // evacuation failure handling.
       
  3106     guarantee(hr->rem_set()->verify_ready_for_par_iteration(), "verification");
       
  3107 
       
  3108     // Here's a good place to add any other checks we'd like to
       
  3109     // perform on CSet regions.
       
  3110     return false;
       
  3111   }
       
  3112 };
       
  3113 #endif // ASSERT
       
  3114 
       
  3115 uint G1CollectedHeap::num_task_queues() const {
  3093 uint G1CollectedHeap::num_task_queues() const {
  3116   return _task_queues->size();
  3094   return _task_queues->size();
  3117 }
  3095 }
  3118 
  3096 
  3119 #if TASKQUEUE_STATS
  3097 #if TASKQUEUE_STATS
  3351           while (hr != NULL) {
  3329           while (hr != NULL) {
  3352             _hr_printer.cset(hr);
  3330             _hr_printer.cset(hr);
  3353             hr = hr->next_in_collection_set();
  3331             hr = hr->next_in_collection_set();
  3354           }
  3332           }
  3355         }
  3333         }
  3356 
       
  3357 #ifdef ASSERT
       
  3358         VerifyCSetClosure cl;
       
  3359         collection_set_iterate(&cl);
       
  3360 #endif // ASSERT
       
  3361 
  3334 
  3362         // Initialize the GC alloc regions.
  3335         // Initialize the GC alloc regions.
  3363         _allocator->init_gc_alloc_regions(evacuation_info);
  3336         _allocator->init_gc_alloc_regions(evacuation_info);
  3364 
  3337 
  3365         G1ParScanThreadStateSet per_thread_states(this, workers()->active_workers(), collection_set()->young_region_length());
  3338         G1ParScanThreadStateSet per_thread_states(this, workers()->active_workers(), collection_set()->young_region_length());