0 /*
1 * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3 *
4 * This code is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 2 only, as
6 * published by the Free Software Foundation.
7 *
8 * This code is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * version 2 for more details (a copy is included in the LICENSE file that
12 * accompanied this code).
13 *
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.
|
0 /*
1 * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3 *
4 * This code is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 2 only, as
6 * published by the Free Software Foundation.
7 *
8 * This code is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * version 2 for more details (a copy is included in the LICENSE file that
12 * accompanied this code).
13 *
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.
|
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(const BarrierSet::FakeRtti& fake_rtti)
35 : BarrierSet(fake_rtti.add_tag(BarrierSet::ModRef)) { }
36 ~ModRefBarrierSet() { }
37
38 public:
39 template <DecoratorSet decorators, typename T>
40 inline void write_ref_field_pre(T* addr) {}
41
42 template <DecoratorSet decorators, typename T>
43 inline void write_ref_field_post(T *addr, oop new_value) {}
44
45 // Causes all refs in "mr" to be assumed to be modified.
46 virtual void invalidate(MemRegion mr) = 0;
47
48 // The caller guarantees that "mr" contains no references. (Perhaps it's
49 // objects have been moved elsewhere.)
50 virtual void clear(MemRegion mr) = 0;
51
52 // The ModRef abstraction introduces pre and post barriers
53 template <DecoratorSet decorators, typename BarrierSetT>
54 class AccessBarrier: public BarrierSet::AccessBarrier<decorators, BarrierSetT> {
55 typedef BarrierSet::AccessBarrier<decorators, BarrierSetT> Raw;
56
57 public:
58 template <typename T>
59 static void oop_store_in_heap(T* addr, oop value);
60 template <typename T>
61 static oop oop_atomic_cmpxchg_in_heap(oop new_value, T* addr, oop compare_value);
62 template <typename T>
63 static oop oop_atomic_xchg_in_heap(oop new_value, T* addr);
64
65 template <typename T>
|
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(const BarrierSet::FakeRtti& fake_rtti)
35 : BarrierSet(fake_rtti.add_tag(BarrierSet::ModRef)) { }
36 ~ModRefBarrierSet() { }
37
38 public:
39 template <DecoratorSet decorators, typename T>
40 inline void write_ref_field_pre(T* addr) {}
41
42 template <DecoratorSet decorators, typename T>
43 inline void write_ref_field_post(T *addr, oop new_value) {}
44
45 // Causes all refs in "mr" to be assumed to be modified.
46 virtual void invalidate(MemRegion mr) = 0;
47 virtual void write_region(MemRegion mr) = 0;
48
49 // The caller guarantees that "mr" contains no references. (Perhaps it's
50 // objects have been moved elsewhere.)
51 virtual void clear(MemRegion mr) = 0;
52
53 // The ModRef abstraction introduces pre and post barriers
54 template <DecoratorSet decorators, typename BarrierSetT>
55 class AccessBarrier: public BarrierSet::AccessBarrier<decorators, BarrierSetT> {
56 typedef BarrierSet::AccessBarrier<decorators, BarrierSetT> Raw;
57
58 public:
59 template <typename T>
60 static void oop_store_in_heap(T* addr, oop value);
61 template <typename T>
62 static oop oop_atomic_cmpxchg_in_heap(oop new_value, T* addr, oop compare_value);
63 template <typename T>
64 static oop oop_atomic_xchg_in_heap(oop new_value, T* addr);
65
66 template <typename T>
|