66 JavaThread* jt); 67 68 // We export this to make it available in cases where the static 69 // type of the barrier set is known. Note that it is non-virtual. 70 template <class T> inline void inline_write_ref_field_pre(T* field, oop newVal) { 71 write_ref_field_pre_static(field, newVal); 72 } 73 74 // These are the more general virtual versions. 75 virtual void write_ref_field_pre_work(oop* field, oop new_val) { 76 inline_write_ref_field_pre(field, new_val); 77 } 78 virtual void write_ref_field_pre_work(narrowOop* field, oop new_val) { 79 inline_write_ref_field_pre(field, new_val); 80 } 81 virtual void write_ref_field_pre_work(void* field, oop new_val) { 82 guarantee(false, "Not needed"); 83 } 84 85 template <class T> void write_ref_array_pre_work(T* dst, int count); 86 virtual void write_ref_array_pre(oop* dst, int count) { 87 write_ref_array_pre_work(dst, count); 88 } 89 virtual void write_ref_array_pre(narrowOop* dst, int count) { 90 write_ref_array_pre_work(dst, count); 91 } 92 }; 93 94 // Adds card-table logging to the post-barrier. 95 // Usual invariant: all dirty cards are logged in the DirtyCardQueueSet. 96 class G1SATBCardTableLoggingModRefBS: public G1SATBCardTableModRefBS { 97 private: 98 DirtyCardQueueSet& _dcqs; 99 public: 100 G1SATBCardTableLoggingModRefBS(MemRegion whole_heap, 101 int max_covered_regions); 102 103 bool is_a(BarrierSet::Name bsn) { 104 return bsn == BarrierSet::G1SATBCTLogging || 105 G1SATBCardTableModRefBS::is_a(bsn); 106 } 107 108 void write_ref_field_work(void* field, oop new_val); 109 110 // Can be called from static contexts. 111 static void write_ref_field_static(void* field, oop new_val); | 66 JavaThread* jt); 67 68 // We export this to make it available in cases where the static 69 // type of the barrier set is known. Note that it is non-virtual. 70 template <class T> inline void inline_write_ref_field_pre(T* field, oop newVal) { 71 write_ref_field_pre_static(field, newVal); 72 } 73 74 // These are the more general virtual versions. 75 virtual void write_ref_field_pre_work(oop* field, oop new_val) { 76 inline_write_ref_field_pre(field, new_val); 77 } 78 virtual void write_ref_field_pre_work(narrowOop* field, oop new_val) { 79 inline_write_ref_field_pre(field, new_val); 80 } 81 virtual void write_ref_field_pre_work(void* field, oop new_val) { 82 guarantee(false, "Not needed"); 83 } 84 85 template <class T> void write_ref_array_pre_work(T* dst, int count); 86 virtual void write_ref_array_pre(oop* dst, int count, bool dest_uninitialized) { 87 if (!dest_uninitialized) { 88 write_ref_array_pre_work(dst, count); 89 } 90 } 91 virtual void write_ref_array_pre(narrowOop* dst, int count, bool dest_uninitialized) { 92 if (!dest_uninitialized) { 93 write_ref_array_pre_work(dst, count); 94 } 95 } 96 }; 97 98 // Adds card-table logging to the post-barrier. 99 // Usual invariant: all dirty cards are logged in the DirtyCardQueueSet. 100 class G1SATBCardTableLoggingModRefBS: public G1SATBCardTableModRefBS { 101 private: 102 DirtyCardQueueSet& _dcqs; 103 public: 104 G1SATBCardTableLoggingModRefBS(MemRegion whole_heap, 105 int max_covered_regions); 106 107 bool is_a(BarrierSet::Name bsn) { 108 return bsn == BarrierSet::G1SATBCTLogging || 109 G1SATBCardTableModRefBS::is_a(bsn); 110 } 111 112 void write_ref_field_work(void* field, oop new_val); 113 114 // Can be called from static contexts. 115 static void write_ref_field_static(void* field, oop new_val); |