< prev index next >

src/hotspot/share/gc/g1/g1HotCardCache.hpp

Print this page
rev 56302 : [mq]: 8231189-worker_i-renamings


  96 
  97   bool use_cache() { return _use_cache; }
  98 
  99   void set_use_cache(bool b) {
 100     _use_cache = (b ? default_use_cache() : false);
 101   }
 102 
 103   // Returns the card to be refined or NULL.
 104   //
 105   // Increments the count for given the card. if the card is not 'hot',
 106   // it is returned for immediate refining. Otherwise the card is
 107   // added to the hot card cache.
 108   // If there is enough room in the hot card cache for the card we're
 109   // adding, NULL is returned and no further action in needed.
 110   // If we evict a card from the cache to make room for the new card,
 111   // the evicted card is then returned for refinement.
 112   CardValue* insert(CardValue* card_ptr);
 113 
 114   // Refine the cards that have delayed as a result of
 115   // being in the cache.
 116   void drain(G1CardTableEntryClosure* cl, uint worker_i);
 117 
 118   // Set up for parallel processing of the cards in the hot cache
 119   void reset_hot_cache_claimed_index() {
 120     _hot_cache_par_claimed_idx = 0;
 121   }
 122 
 123   // Resets the hot card cache and discards the entries.
 124   void reset_hot_cache() {
 125     assert(SafepointSynchronize::is_at_safepoint(), "Should be at a safepoint");
 126     assert(Thread::current()->is_VM_thread(), "Current thread should be the VMthread");
 127     if (default_use_cache()) {
 128         reset_hot_cache_internal();
 129     }
 130   }
 131 
 132   // Zeros the values in the card counts table for the given region
 133   void reset_card_counts(HeapRegion* hr);
 134 
 135  private:
 136   void reset_hot_cache_internal() {


  96 
  97   bool use_cache() { return _use_cache; }
  98 
  99   void set_use_cache(bool b) {
 100     _use_cache = (b ? default_use_cache() : false);
 101   }
 102 
 103   // Returns the card to be refined or NULL.
 104   //
 105   // Increments the count for given the card. if the card is not 'hot',
 106   // it is returned for immediate refining. Otherwise the card is
 107   // added to the hot card cache.
 108   // If there is enough room in the hot card cache for the card we're
 109   // adding, NULL is returned and no further action in needed.
 110   // If we evict a card from the cache to make room for the new card,
 111   // the evicted card is then returned for refinement.
 112   CardValue* insert(CardValue* card_ptr);
 113 
 114   // Refine the cards that have delayed as a result of
 115   // being in the cache.
 116   void drain(G1CardTableEntryClosure* cl, uint worker_id);
 117 
 118   // Set up for parallel processing of the cards in the hot cache
 119   void reset_hot_cache_claimed_index() {
 120     _hot_cache_par_claimed_idx = 0;
 121   }
 122 
 123   // Resets the hot card cache and discards the entries.
 124   void reset_hot_cache() {
 125     assert(SafepointSynchronize::is_at_safepoint(), "Should be at a safepoint");
 126     assert(Thread::current()->is_VM_thread(), "Current thread should be the VMthread");
 127     if (default_use_cache()) {
 128         reset_hot_cache_internal();
 129     }
 130   }
 131 
 132   // Zeros the values in the card counts table for the given region
 133   void reset_card_counts(HeapRegion* hr);
 134 
 135  private:
 136   void reset_hot_cache_internal() {
< prev index next >