14 * You should have received a copy of the GNU General Public License version
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #ifndef SHARE_VM_GC_SHARED_MODREFBARRIERSET_HPP
25 #define SHARE_VM_GC_SHARED_MODREFBARRIERSET_HPP
26
27 #include "gc/shared/barrierSet.hpp"
28 #include "memory/memRegion.hpp"
29
30 class Klass;
31
32 class ModRefBarrierSet: public BarrierSet {
33 protected:
34 ModRefBarrierSet(BarrierSetCodeGen* code_gen,
35 const BarrierSet::FakeRtti& fake_rtti)
36 : BarrierSet(code_gen,
37 fake_rtti.add_tag(BarrierSet::ModRef)) { }
38 ~ModRefBarrierSet() { }
39
40 public:
41 template <DecoratorSet decorators, typename T>
42 inline void write_ref_field_pre(T* addr) {}
43
44 template <DecoratorSet decorators, typename T>
45 inline void write_ref_field_post(T *addr, oop new_value) {}
46
47 // Causes all refs in "mr" to be assumed to be modified.
48 virtual void invalidate(MemRegion mr) = 0;
49 virtual void write_region(MemRegion mr) = 0;
50
51 // Operations on arrays, or general regions (e.g., for "clone") may be
52 // optimized by some barriers.
53
54 // Below length is the # array elements being written
55 virtual void write_ref_array_pre(oop* dst, size_t length,
|
14 * You should have received a copy of the GNU General Public License version
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #ifndef SHARE_VM_GC_SHARED_MODREFBARRIERSET_HPP
25 #define SHARE_VM_GC_SHARED_MODREFBARRIERSET_HPP
26
27 #include "gc/shared/barrierSet.hpp"
28 #include "memory/memRegion.hpp"
29
30 class Klass;
31
32 class ModRefBarrierSet: public BarrierSet {
33 protected:
34 ModRefBarrierSet(BarrierSetAssembler* barrier_set_assembler,
35 const BarrierSet::FakeRtti& fake_rtti)
36 : BarrierSet(barrier_set_assembler,
37 fake_rtti.add_tag(BarrierSet::ModRef)) { }
38 ~ModRefBarrierSet() { }
39
40 public:
41 template <DecoratorSet decorators, typename T>
42 inline void write_ref_field_pre(T* addr) {}
43
44 template <DecoratorSet decorators, typename T>
45 inline void write_ref_field_post(T *addr, oop new_value) {}
46
47 // Causes all refs in "mr" to be assumed to be modified.
48 virtual void invalidate(MemRegion mr) = 0;
49 virtual void write_region(MemRegion mr) = 0;
50
51 // Operations on arrays, or general regions (e.g., for "clone") may be
52 // optimized by some barriers.
53
54 // Below length is the # array elements being written
55 virtual void write_ref_array_pre(oop* dst, size_t length,
|