32 #include "gc/shenandoah/shenandoahForwarding.inline.hpp"
33 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
34 #include "gc/shenandoah/shenandoahHeapRegion.hpp"
35 #include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
36 #include "gc/shenandoah/shenandoahThreadLocalData.hpp"
37 #include "memory/iterator.inline.hpp"
38 #include "oops/oop.inline.hpp"
39
40 inline oop ShenandoahBarrierSet::resolve_forwarded_not_null(oop p) {
41 return ShenandoahForwarding::get_forwardee(p);
42 }
43
44 inline oop ShenandoahBarrierSet::resolve_forwarded(oop p) {
45 if (p != NULL) {
46 return resolve_forwarded_not_null(p);
47 } else {
48 return p;
49 }
50 }
51
52 inline void ShenandoahBarrierSet::enqueue(oop obj) {
53 shenandoah_assert_not_forwarded_if(NULL, obj, _heap->is_concurrent_traversal_in_progress());
54 assert(_satb_mark_queue_set.is_active(), "only get here when SATB active");
55
56 // Filter marked objects before hitting the SATB queues. The same predicate would
57 // be used by SATBMQ::filter to eliminate already marked objects downstream, but
58 // filtering here helps to avoid wasteful SATB queueing work to begin with.
59 if (!_heap->requires_marking<false>(obj)) return;
60
61 ShenandoahThreadLocalData::satb_mark_queue(Thread::current()).enqueue_known_active(obj);
62 }
63
64 template <DecoratorSet decorators, typename T>
65 inline void ShenandoahBarrierSet::satb_barrier(T *field) {
66 if (HasDecorator<decorators, IS_DEST_UNINITIALIZED>::value ||
67 HasDecorator<decorators, AS_NO_KEEPALIVE>::value) {
68 return;
69 }
70 if (ShenandoahSATBBarrier && _heap->is_concurrent_mark_in_progress()) {
71 T heap_oop = RawAccess<>::oop_load(field);
|
32 #include "gc/shenandoah/shenandoahForwarding.inline.hpp"
33 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
34 #include "gc/shenandoah/shenandoahHeapRegion.hpp"
35 #include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
36 #include "gc/shenandoah/shenandoahThreadLocalData.hpp"
37 #include "memory/iterator.inline.hpp"
38 #include "oops/oop.inline.hpp"
39
40 inline oop ShenandoahBarrierSet::resolve_forwarded_not_null(oop p) {
41 return ShenandoahForwarding::get_forwardee(p);
42 }
43
44 inline oop ShenandoahBarrierSet::resolve_forwarded(oop p) {
45 if (p != NULL) {
46 return resolve_forwarded_not_null(p);
47 } else {
48 return p;
49 }
50 }
51
52 inline oop ShenandoahBarrierSet::resolve_forwarded_not_null_mutator(oop p) {
53 return ShenandoahForwarding::get_forwardee_mutator(p);
54 }
55
56 inline void ShenandoahBarrierSet::enqueue(oop obj) {
57 shenandoah_assert_not_forwarded_if(NULL, obj, _heap->is_concurrent_traversal_in_progress());
58 assert(_satb_mark_queue_set.is_active(), "only get here when SATB active");
59
60 // Filter marked objects before hitting the SATB queues. The same predicate would
61 // be used by SATBMQ::filter to eliminate already marked objects downstream, but
62 // filtering here helps to avoid wasteful SATB queueing work to begin with.
63 if (!_heap->requires_marking<false>(obj)) return;
64
65 ShenandoahThreadLocalData::satb_mark_queue(Thread::current()).enqueue_known_active(obj);
66 }
67
68 template <DecoratorSet decorators, typename T>
69 inline void ShenandoahBarrierSet::satb_barrier(T *field) {
70 if (HasDecorator<decorators, IS_DEST_UNINITIALIZED>::value ||
71 HasDecorator<decorators, AS_NO_KEEPALIVE>::value) {
72 return;
73 }
74 if (ShenandoahSATBBarrier && _heap->is_concurrent_mark_in_progress()) {
75 T heap_oop = RawAccess<>::oop_load(field);
|