index

src/share/vm/gc_implementation/g1/g1HotCardCache.hpp

Print this page
rev 7184 : 6979279
rev 7185 : [mq]: rev1


  46 // the card containing the updated pointer is already dirty and, if
  47 // so, skips the remaining code in the barrier.
  48 //
  49 // Delaying the refinement of a card will make the card fail the
  50 // first is_dirty check in the write barrier, skipping the remainder
  51 // of the write barrier.
  52 //
  53 // This can significantly reduce the overhead of the write barrier
  54 // code, increasing throughput.
  55 
  56 class G1HotCardCache: public CHeapObj<mtGC> {
  57   G1CollectedHeap*   _g1h;
  58 
  59   // The card cache table
  60   jbyte**      _hot_cache;
  61 
  62   int          _hot_cache_size;
  63   int          _n_hot;
  64   int          _hot_cache_idx;
  65 

  66   volatile int _hot_cache_par_claimed_idx;
  67 
  68   bool         _use_cache;
  69 
  70   G1CardCounts _card_counts;
  71 
  72   // The number of cached cards a thread claims when flushing the cache
  73   static const int ClaimChunkSize = 32;
  74 
  75   bool default_use_cache() const {
  76     return (G1ConcRSLogCacheSize > 0);
  77   }
  78 
  79  public:
  80   G1HotCardCache(G1CollectedHeap* g1h);
  81   ~G1HotCardCache();
  82 
  83   void initialize(G1RegionToSpaceMapper* card_counts_storage);
  84 
  85   bool use_cache() { return _use_cache; }




  46 // the card containing the updated pointer is already dirty and, if
  47 // so, skips the remaining code in the barrier.
  48 //
  49 // Delaying the refinement of a card will make the card fail the
  50 // first is_dirty check in the write barrier, skipping the remainder
  51 // of the write barrier.
  52 //
  53 // This can significantly reduce the overhead of the write barrier
  54 // code, increasing throughput.
  55 
  56 class G1HotCardCache: public CHeapObj<mtGC> {
  57   G1CollectedHeap*   _g1h;
  58 
  59   // The card cache table
  60   jbyte**      _hot_cache;
  61 
  62   int          _hot_cache_size;
  63   int          _n_hot;
  64   int          _hot_cache_idx;
  65 
  66   int          _hot_cache_par_chunk_size;
  67   volatile int _hot_cache_par_claimed_idx;
  68 
  69   bool         _use_cache;
  70 
  71   G1CardCounts _card_counts;
  72 
  73   // The number of cached cards a thread claims when flushing the cache
  74   static const int ClaimChunkSize = 32;
  75 
  76   bool default_use_cache() const {
  77     return (G1ConcRSLogCacheSize > 0);
  78   }
  79 
  80  public:
  81   G1HotCardCache(G1CollectedHeap* g1h);
  82   ~G1HotCardCache();
  83 
  84   void initialize(G1RegionToSpaceMapper* card_counts_storage);
  85 
  86   bool use_cache() { return _use_cache; }


index