src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/gc_implementation/g1

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

Print this page




  37 // This barrier is specialized to use a logging barrier to support
  38 // snapshot-at-the-beginning marking.
  39 
  40 class G1SATBCardTableModRefBS: public CardTableModRefBS {
  41 protected:
  42   enum G1CardValues {
  43     g1_young_gen = CT_MR_BS_last_reserved << 1
  44   };
  45 
  46   G1SATBCardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind);
  47   ~G1SATBCardTableModRefBS() { }
  48 
  49 public:
  50   static int g1_young_card_val()   { return g1_young_gen; }
  51 
  52   // Add "pre_val" to a set of objects that may have been disconnected from the
  53   // pre-marking object graph.
  54   static void enqueue(oop pre_val);
  55 
  56   bool is_a(BarrierSet::Name bsn) {
  57     return bsn == BarrierSet::G1SATBCT || CardTableModRefBS::is_a(bsn);
  58   }
  59 
  60   virtual bool has_write_ref_pre_barrier() { return true; }
  61 
  62   // This notes that we don't need to access any BarrierSet data
  63   // structures, so this can be called from a static context.
  64   template <class T> static void write_ref_field_pre_static(T* field, oop newVal) {
  65     T heap_oop = oopDesc::load_heap_oop(field);
  66     if (!oopDesc::is_null(heap_oop)) {
  67       enqueue(oopDesc::decode_heap_oop(heap_oop));
  68     }
  69   }
  70 
  71   // We export this to make it available in cases where the static
  72   // type of the barrier set is known.  Note that it is non-virtual.
  73   template <class T> inline void inline_write_ref_field_pre(T* field, oop newVal) {
  74     write_ref_field_pre_static(field, newVal);
  75   }
  76 
  77   // These are the more general virtual versions.




  37 // This barrier is specialized to use a logging barrier to support
  38 // snapshot-at-the-beginning marking.
  39 
  40 class G1SATBCardTableModRefBS: public CardTableModRefBS {
  41 protected:
  42   enum G1CardValues {
  43     g1_young_gen = CT_MR_BS_last_reserved << 1
  44   };
  45 
  46   G1SATBCardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind);
  47   ~G1SATBCardTableModRefBS() { }
  48 
  49 public:
  50   static int g1_young_card_val()   { return g1_young_gen; }
  51 
  52   // Add "pre_val" to a set of objects that may have been disconnected from the
  53   // pre-marking object graph.
  54   static void enqueue(oop pre_val);
  55 
  56   bool is_a(BarrierSet::Name bsn) {
  57     return CardTableModRefBS::is_a(bsn);
  58   }
  59 
  60   virtual bool has_write_ref_pre_barrier() { return true; }
  61 
  62   // This notes that we don't need to access any BarrierSet data
  63   // structures, so this can be called from a static context.
  64   template <class T> static void write_ref_field_pre_static(T* field, oop newVal) {
  65     T heap_oop = oopDesc::load_heap_oop(field);
  66     if (!oopDesc::is_null(heap_oop)) {
  67       enqueue(oopDesc::decode_heap_oop(heap_oop));
  68     }
  69   }
  70 
  71   // We export this to make it available in cases where the static
  72   // type of the barrier set is known.  Note that it is non-virtual.
  73   template <class T> inline void inline_write_ref_field_pre(T* field, oop newVal) {
  74     write_ref_field_pre_static(field, newVal);
  75   }
  76 
  77   // These are the more general virtual versions.


src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File