diff --git a/src/hotspot/share/gc/shared/modRefBarrierSet.hpp b/src/hotspot/share/gc/shared/modRefBarrierSet.hpp index 7e4e7a5..f64dbd7 100644 --- a/src/hotspot/share/gc/shared/modRefBarrierSet.hpp +++ b/src/hotspot/share/gc/shared/modRefBarrierSet.hpp @@ -47,6 +47,22 @@ public: virtual void invalidate(MemRegion mr) = 0; virtual void write_region(MemRegion mr) = 0; + // Operations on arrays, or general regions (e.g., for "clone") may be + // optimized by some barriers. + + // Below length is the # array elements being written + virtual void write_ref_array_pre(oop* dst, int length, + bool dest_uninitialized = false) {} + virtual void write_ref_array_pre(narrowOop* dst, int length, + bool dest_uninitialized = false) {} + // Below count is the # array elements being written, starting + // at the address "start", which may not necessarily be HeapWord-aligned + inline void write_ref_array(HeapWord* start, size_t count); + + protected: + virtual void write_ref_array_work(MemRegion mr) = 0; + + public: // The ModRef abstraction introduces pre and post barriers template class AccessBarrier: public BarrierSet::AccessBarrier {