< prev index next >

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

Print this page
rev 52675 : 8213890: Implementation of JEP 344: Abortable Mixed Collections for G1
Reviewed-by:
Contributed-by: erik.helin@oracle.com, stefan.johansson@oracle.com
rev 52676 : imported patch AMGC-impl

@@ -35,10 +35,11 @@
 #include "gc/shared/ageTable.hpp"
 #include "memory/allocation.hpp"
 #include "oops/oop.hpp"
 #include "utilities/ticks.hpp"
 
+class G1OopStarChunkedList;
 class G1PLABAllocator;
 class G1EvacuationRootClosures;
 class HeapRegion;
 class outputStream;
 

@@ -85,12 +86,18 @@
     assert(_dest[original.value()].is_valid_gen(),
            "Dest state is invalid: " CSETSTATE_FORMAT, _dest[original.value()].value());
     return _dest[original.value()];
   }
 
+  size_t _num_optional_regions;
+  G1OopStarChunkedList* _oops_into_optional_regions;
+
 public:
-  G1ParScanThreadState(G1CollectedHeap* g1h, uint worker_id, size_t young_cset_length);
+  G1ParScanThreadState(G1CollectedHeap* g1h,
+                       uint worker_id,
+                       size_t young_cset_length,
+                       size_t optional_cset_length);
   virtual ~G1ParScanThreadState();
 
   void set_ref_discoverer(ReferenceDiscoverer* rd) { _scanner.set_ref_discoverer(rd); }
 
 #ifdef ASSERT

@@ -204,22 +211,33 @@
 
   inline void steal_and_trim_queue(RefToScanQueueSet *task_queues);
 
   // An attempt to evacuate "obj" has failed; take necessary steps.
   oop handle_evacuation_failure_par(oop obj, markOop m);
+
+  template <typename T>
+  inline void remember_root_into_optional_region(T* p);
+  template <typename T>
+  inline void remember_reference_into_optional_region(T* p);
+
+  inline G1OopStarChunkedList* oops_into_optional_region(const HeapRegion* hr);
 };
 
 class G1ParScanThreadStateSet : public StackObj {
   G1CollectedHeap* _g1h;
   G1ParScanThreadState** _states;
   size_t* _surviving_young_words_total;
   size_t _young_cset_length;
+  size_t _optional_cset_length;
   uint _n_workers;
   bool _flushed;
 
  public:
-  G1ParScanThreadStateSet(G1CollectedHeap* g1h, uint n_workers, size_t young_cset_length);
+  G1ParScanThreadStateSet(G1CollectedHeap* g1h,
+                          uint n_workers,
+                          size_t young_cset_length,
+                          size_t optional_cset_length);
   ~G1ParScanThreadStateSet();
 
   void flush();
 
   G1ParScanThreadState* state_for_worker(uint worker_id);
< prev index next >