< prev index next >

src/share/vm/gc/g1/g1CollectedHeap.hpp

Print this page
rev 8802 : G1 performance improvements: card batching, joining, sorting, prefetching and write barrier fence elision and simplification based on a global syncrhonization using handshakes piggybacking on thread-local safepoints.

@@ -55,10 +55,11 @@
 class HRRSCleanupTask;
 class GenerationSpec;
 class OopsInHeapRegionClosure;
 class G1KlassScanClosure;
 class G1ParScanThreadState;
+class GlobalSynchronizer;
 class ObjectClosure;
 class SpaceClosure;
 class CompactibleSpaceClosure;
 class Space;
 class G1CollectorPolicy;

@@ -167,11 +168,55 @@
 public:
   G1STWIsAliveClosure(G1CollectedHeap* g1) : _g1(g1) {}
   bool do_object_b(oop p);
 };
 
-class RefineCardTableEntryClosure;
+class RefineCardTableEntryClosure: public CardTableEntryClosure {
+public:
+  RefineCardTableEntryClosure() { }
+  bool do_card_ptr(jbyte* card_ptr, uint worker_i);
+};
+
+class CardBuffer : public CHeapObj<mtGC> {
+public:
+  CardBuffer *_next;
+  GlobalSynchronizer *_gs;
+  jbyte **_card_buffer;
+  MemRegion *_mr_buffer;
+  int _length;
+
+  int _misses;
+
+  CardBuffer();
+  virtual ~CardBuffer();
+};
+
+class BufferedRefineCardTableEntryClosure: public CardTableEntryClosure {
+  CardBuffer *_head_buffer;
+  CardBuffer *_tail_buffer;
+  CardBuffer *_current_buffer;
+
+  int _index;
+  int _async_buffers;
+
+  uint _worker_i;
+  G1CollectedHeap *const _g1h;
+
+  bool pre_sync(CardBuffer *buffer, bool hard);
+  bool sync(CardBuffer *buffer, bool hard);
+  void post_sync(CardBuffer *buffer);
+
+  void general_flush(bool hard);
+  void soft_flush();
+public:
+  BufferedRefineCardTableEntryClosure();
+  ~BufferedRefineCardTableEntryClosure();
+  static int buffer_size();
+  bool do_card_ptr(jbyte *card_ptr, uint worker_i);
+  void flush_buffer();
+};
+
 
 class G1RegionMappingChangedListener : public G1MappingChangedListener {
  private:
   void reset_from_card_cache(uint start_idx, size_t num_regions);
  public:

@@ -829,12 +874,11 @@
 
   // A set of cards that cover the objects for which the Rsets should be updated
   // concurrently after the collection.
   DirtyCardQueueSet _dirty_card_queue_set;
 
-  // The closure used to refine a single card.
-  RefineCardTableEntryClosure* _refine_cte_cl;
+  bool _refine_cte_cl_concurrency;
 
   // A DirtyCardQueueSet that is used to hold cards that contain
   // references into the current collection set. This is used to
   // update the remembered sets of the regions in the collection
   // set in the event of an evacuation failure.

@@ -1018,10 +1062,11 @@
 
   volatile bool _free_regions_coming;
 
 public:
 
+  bool refine_cte_cl_concurrency();
   void set_refine_cte_cl_concurrency(bool concurrent);
 
   RefToScanQueue *task_queue(uint i) const;
 
   uint num_task_queues() const;
< prev index next >