< prev index next >

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

Print this page

        

@@ -25,11 +25,11 @@
 #ifndef SHARE_GC_G1_G1PARSCANTHREADSTATE_HPP
 #define SHARE_GC_G1_G1PARSCANTHREADSTATE_HPP
 
 #include "gc/g1/g1CardTable.hpp"
 #include "gc/g1/g1CollectedHeap.hpp"
-#include "gc/g1/g1RedirtyCardsQueue.hpp"
+#include "gc/g1/g1DirtyCardQueue.hpp"
 #include "gc/g1/g1OopClosures.hpp"
 #include "gc/g1/g1Policy.hpp"
 #include "gc/g1/g1RemSet.hpp"
 #include "gc/g1/heapRegionRemSet.hpp"
 #include "gc/shared/ageTable.hpp"

@@ -44,11 +44,11 @@
 class outputStream;
 
 class G1ParScanThreadState : public CHeapObj<mtGC> {
   G1CollectedHeap* _g1h;
   RefToScanQueue* _refs;
-  G1RedirtyCardsQueue _rdcq;
+  G1DirtyCardQueue _dcq;
   G1CardTable* _ct;
   G1EvacuationRootClosures* _closures;
 
   G1PLABAllocator* _plab_allocator;
 

@@ -58,14 +58,10 @@
   uint _tenuring_threshold;
   G1ScanEvacuatedObjClosure  _scanner;
 
   uint _worker_id;
 
-  // Remember the last enqueued card to avoid enqueuing the same card over and over;
-  // since we only ever scan a card once, this is sufficient.
-  size_t _last_enqueued_card;
-
   // Upper and lower threshold to start and end work queue draining.
   uint const _stack_trim_upper_threshold;
   uint const _stack_trim_lower_threshold;
 
   Tickspan _trim_ticks;

@@ -79,11 +75,11 @@
   // available for allocation.
   bool _old_gen_is_full;
 
 #define PADDING_ELEM_NUM (DEFAULT_CACHE_LINE_SIZE / sizeof(size_t))
 
-  G1RedirtyCardsQueue& redirty_cards_queue()     { return _rdcq; }
+  G1DirtyCardQueue& dirty_card_queue()           { return _dcq; }
   G1CardTable* ct()                              { return _ct; }
 
   G1HeapRegionAttr dest(G1HeapRegionAttr original) const {
     assert(original.is_valid(),
            "Original region attr invalid: %s", original.get_type_str());

@@ -95,11 +91,10 @@
   size_t _num_optional_regions;
   G1OopStarChunkedList* _oops_into_optional_regions;
 
 public:
   G1ParScanThreadState(G1CollectedHeap* g1h,
-                       G1RedirtyCardsQueueSet* rdcqs,
                        uint worker_id,
                        size_t young_cset_length,
                        size_t optional_cset_length);
   virtual ~G1ParScanThreadState();
 

@@ -131,22 +126,27 @@
     if (!region_attr.needs_remset_update()) {
       return;
     }
     size_t card_index = ct()->index_for(p);
     // If the card hasn't been added to the buffer, do it.
-    if (_last_enqueued_card != card_index) {
-      redirty_cards_queue().enqueue(ct()->byte_for_index(card_index));
-      _last_enqueued_card = card_index;
+    if (ct()->mark_card_deferred(card_index)) {
+      dirty_card_queue().enqueue(ct()->byte_for_index(card_index));
     }
   }
 
   G1EvacuationRootClosures* closures() { return _closures; }
   uint worker_id() { return _worker_id; }
 
   size_t lab_waste_words() const;
   size_t lab_undo_waste_words() const;
 
+  size_t* surviving_young_words() {
+    // We add one to hide entry 0 which accumulates surviving words for
+    // age -1 regions (i.e. non-young ones)
+    return _surviving_young_words + 1;
+  }
+
   void flush(size_t* surviving_young_words);
 
 private:
   #define G1_PARTIAL_ARRAY_MASK 0x2
 

@@ -196,33 +196,33 @@
   HeapWord* allocate_in_next_plab(G1HeapRegionAttr const region_attr,
                                   G1HeapRegionAttr* dest,
                                   size_t word_sz,
                                   bool previous_plab_refill_failed);
 
-  inline G1HeapRegionAttr next_region_attr(G1HeapRegionAttr const region_attr, markWord const m, uint& age);
+  inline G1HeapRegionAttr next_region_attr(G1HeapRegionAttr const region_attr, markOop const m, uint& age);
 
   void report_promotion_event(G1HeapRegionAttr const dest_attr,
                               oop const old, size_t word_sz, uint age,
                               HeapWord * const obj_ptr) const;
 
   inline bool needs_partial_trimming() const;
   inline bool is_partially_trimmed() const;
 
   inline void trim_queue_to_threshold(uint threshold);
 public:
-  oop copy_to_survivor_space(G1HeapRegionAttr const region_attr, oop const obj, markWord const old_mark);
+  oop copy_to_survivor_space(G1HeapRegionAttr const region_attr, oop const obj, markOop const old_mark);
 
   void trim_queue();
   void trim_queue_partially();
 
   Tickspan trim_ticks() const;
   void reset_trim_ticks();
 
   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, markWord m);
+  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);

@@ -230,21 +230,19 @@
   inline G1OopStarChunkedList* oops_into_optional_region(const HeapRegion* hr);
 };
 
 class G1ParScanThreadStateSet : public StackObj {
   G1CollectedHeap* _g1h;
-  G1RedirtyCardsQueueSet* _rdcqs;
   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,
-                          G1RedirtyCardsQueueSet* rdcqs,
                           uint n_workers,
                           size_t young_cset_length,
                           size_t optional_cset_length);
   ~G1ParScanThreadStateSet();
 
< prev index next >