15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_GC_G1_G1FULLGCOOPCLOSURES_INLINE_HPP
26 #define SHARE_GC_G1_G1FULLGCOOPCLOSURES_INLINE_HPP
27
28 #include "gc/g1/g1FullGCOopClosures.hpp"
29
30 #include "gc/g1/g1Allocator.inline.hpp"
31 #include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp"
32 #include "gc/g1/g1FullCollector.inline.hpp"
33 #include "gc/g1/g1FullGCMarker.inline.hpp"
34 #include "gc/g1/g1HeapRegionRemSet.inline.hpp"
35 #include "memory/iterator.inline.hpp"
36 #include "memory/universe.hpp"
37 #include "oops/access.inline.hpp"
38 #include "oops/compressedOops.inline.hpp"
39 #include "oops/oop.inline.hpp"
40
41 template <typename T>
42 inline void G1MarkAndPushClosure::do_oop_work(T* p) {
43 _marker->mark_and_push(p);
44 }
45
46 inline void G1MarkAndPushClosure::do_oop(oop* p) {
47 do_oop_work(p);
48 }
49
50 inline void G1MarkAndPushClosure::do_oop(narrowOop* p) {
51 do_oop_work(p);
52 }
53
54 template <class T> inline void G1AdjustClosure::adjust_pointer(T* p) {
55 T heap_oop = RawAccess<>::oop_load(p);
56 if (CompressedOops::is_null(heap_oop)) {
57 return;
58 }
59
60 oop obj = CompressedOops::decode_not_null(heap_oop);
61 assert(Universe::heap()->is_in(obj), "should be in heap");
62 if (!_collector->is_compacting(obj)) {
63 // We never forward objects in non-compacting regions so there is no need to
64 // process them further.
65 return;
66 }
67
68 if (obj->is_forwarded()) {
69 oop forwardee = obj->forwardee();
70 // Forwarded, just update.
71 assert(G1CollectedHeap::heap()->is_in_reserved(forwardee), "should be in object space");
72 RawAccess<IS_NOT_NULL>::oop_store(p, forwardee);
73 }
74
75 }
76
77 inline void G1AdjustClosure::do_oop(oop* p) { do_oop_work(p); }
78 inline void G1AdjustClosure::do_oop(narrowOop* p) { do_oop_work(p); }
79
80 inline bool G1IsAliveClosure::do_object_b(oop p) {
81 return _bitmap->is_marked(p);
82 }
83
84 template<typename T>
85 inline void G1FullKeepAliveClosure::do_oop_work(T* p) {
86 _marker->mark_and_push(p);
87 }
88
89 #endif // SHARE_GC_G1_G1FULLGCOOPCLOSURES_INLINE_HPP
|
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_GC_G1_G1FULLGCOOPCLOSURES_INLINE_HPP
26 #define SHARE_GC_G1_G1FULLGCOOPCLOSURES_INLINE_HPP
27
28 #include "gc/g1/g1FullGCOopClosures.hpp"
29
30 #include "gc/g1/g1Allocator.inline.hpp"
31 #include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp"
32 #include "gc/g1/g1FullCollector.inline.hpp"
33 #include "gc/g1/g1FullGCMarker.inline.hpp"
34 #include "gc/g1/g1HeapRegionRemSet.inline.hpp"
35 #include "gc/shared/slidingForwarding.inline.hpp"
36 #include "memory/iterator.inline.hpp"
37 #include "memory/universe.hpp"
38 #include "oops/access.inline.hpp"
39 #include "oops/compressedOops.inline.hpp"
40 #include "oops/oop.inline.hpp"
41
42 template <typename T>
43 inline void G1MarkAndPushClosure::do_oop_work(T* p) {
44 _marker->mark_and_push(p);
45 }
46
47 inline void G1MarkAndPushClosure::do_oop(oop* p) {
48 do_oop_work(p);
49 }
50
51 inline void G1MarkAndPushClosure::do_oop(narrowOop* p) {
52 do_oop_work(p);
53 }
54
55 template <class T> inline void G1AdjustClosure::adjust_pointer(T* p) {
56 T heap_oop = RawAccess<>::oop_load(p);
57 if (CompressedOops::is_null(heap_oop)) {
58 return;
59 }
60
61 oop obj = CompressedOops::decode_not_null(heap_oop);
62 assert(Universe::heap()->is_in(obj), "should be in heap");
63 if (!_collector->is_compacting(obj)) {
64 // We never forward objects in non-compacting regions so there is no need to
65 // process them further.
66 return;
67 }
68
69 if (SlidingForwarding::is_forwarded(obj)) {
70 oop forwardee = SlidingForwarding::forwardee(obj);
71 // Forwarded, just update.
72 assert(G1CollectedHeap::heap()->is_in_reserved(forwardee), "should be in object space");
73 RawAccess<IS_NOT_NULL>::oop_store(p, forwardee);
74 }
75
76 }
77
78 inline void G1AdjustClosure::do_oop(oop* p) { do_oop_work(p); }
79 inline void G1AdjustClosure::do_oop(narrowOop* p) { do_oop_work(p); }
80
81 inline bool G1IsAliveClosure::do_object_b(oop p) {
82 return _bitmap->is_marked(p);
83 }
84
85 template<typename T>
86 inline void G1FullKeepAliveClosure::do_oop_work(T* p) {
87 _marker->mark_and_push(p);
88 }
89
90 #endif // SHARE_GC_G1_G1FULLGCOOPCLOSURES_INLINE_HPP
|