equal
deleted
inserted
replaced
24 #define SHARE_GC_SHENANDOAH_SHENANDOAHCLOSURES_INLINE_HPP |
24 #define SHARE_GC_SHENANDOAH_SHENANDOAHCLOSURES_INLINE_HPP |
25 |
25 |
26 #include "gc/shenandoah/shenandoahAsserts.hpp" |
26 #include "gc/shenandoah/shenandoahAsserts.hpp" |
27 #include "gc/shenandoah/shenandoahClosures.hpp" |
27 #include "gc/shenandoah/shenandoahClosures.hpp" |
28 #include "gc/shenandoah/shenandoahHeap.inline.hpp" |
28 #include "gc/shenandoah/shenandoahHeap.inline.hpp" |
|
29 #include "gc/shenandoah/shenandoahTraversalGC.hpp" |
29 #include "oops/compressedOops.inline.hpp" |
30 #include "oops/compressedOops.inline.hpp" |
30 #include "runtime/thread.hpp" |
31 #include "runtime/thread.hpp" |
31 |
32 |
32 ShenandoahForwardedIsAliveClosure::ShenandoahForwardedIsAliveClosure() : |
33 ShenandoahForwardedIsAliveClosure::ShenandoahForwardedIsAliveClosure() : |
33 _mark_context(ShenandoahHeap::heap()->marking_context()) { |
34 _mark_context(ShenandoahHeap::heap()->marking_context()) { |
75 } |
76 } |
76 } |
77 } |
77 |
78 |
78 void ShenandoahUpdateRefsClosure::do_oop(oop* p) { do_oop_work(p); } |
79 void ShenandoahUpdateRefsClosure::do_oop(oop* p) { do_oop_work(p); } |
79 void ShenandoahUpdateRefsClosure::do_oop(narrowOop* p) { do_oop_work(p); } |
80 void ShenandoahUpdateRefsClosure::do_oop(narrowOop* p) { do_oop_work(p); } |
|
81 |
|
82 ShenandoahTraversalUpdateRefsClosure::ShenandoahTraversalUpdateRefsClosure() : |
|
83 _heap(ShenandoahHeap::heap()), |
|
84 _traversal_set(ShenandoahHeap::heap()->traversal_gc()->traversal_set()) { |
|
85 assert(_heap->is_traversal_mode(), "Why we here?"); |
|
86 } |
|
87 |
|
88 template <class T> |
|
89 void ShenandoahTraversalUpdateRefsClosure::do_oop_work(T* p) { |
|
90 T o = RawAccess<>::oop_load(p); |
|
91 if (!CompressedOops::is_null(o)) { |
|
92 oop obj = CompressedOops::decode_not_null(o); |
|
93 if (_heap->in_collection_set(obj) || _traversal_set->is_in((HeapWord*)obj)) { |
|
94 obj = ShenandoahBarrierSet::resolve_forwarded_not_null(obj); |
|
95 RawAccess<IS_NOT_NULL>::oop_store(p, obj); |
|
96 } else { |
|
97 shenandoah_assert_not_forwarded(p, obj); |
|
98 } |
|
99 } |
|
100 } |
|
101 |
|
102 void ShenandoahTraversalUpdateRefsClosure::do_oop(oop* p) { do_oop_work(p); } |
|
103 void ShenandoahTraversalUpdateRefsClosure::do_oop(narrowOop* p) { do_oop_work(p); } |
80 |
104 |
81 ShenandoahEvacuateUpdateRootsClosure::ShenandoahEvacuateUpdateRootsClosure() : |
105 ShenandoahEvacuateUpdateRootsClosure::ShenandoahEvacuateUpdateRootsClosure() : |
82 _heap(ShenandoahHeap::heap()), _thread(Thread::current()) { |
106 _heap(ShenandoahHeap::heap()), _thread(Thread::current()) { |
83 } |
107 } |
84 |
108 |