64 _heap(ShenandoahHeap::heap()),
65 _bs(ShenandoahBarrierSet::barrier_set()),
66 _cset(_heap->collection_set()),
67 _thread(Thread::current()) {
68 }
69
70 virtual void do_oop(oop* p) { do_oop_work(p); }
71 virtual void do_oop(narrowOop* p) { do_oop_work(p); }
72 };
73
74 void ShenandoahBarrierSet::clone_barrier(oop obj) {
75 assert(ShenandoahCloneBarrier, "only get here with clone barriers enabled");
76 assert(_heap->has_forwarded_objects(), "only when heap is unstable");
77
78 // This is called for cloning an object (see jvm.cpp) after the clone
79 // has been made. We are not interested in any 'previous value' because
80 // it would be NULL in any case. But we *are* interested in any oop*
81 // that potentially need to be updated.
82
83 shenandoah_assert_correct(NULL, obj);
84 if (_heap->is_evacuation_in_progress()) {
85 ShenandoahEvacOOMScope evac_scope;
86 ShenandoahUpdateRefsForOopClosure</* evac = */ true, /* enqueue */ false> cl;
87 obj->oop_iterate(&cl);
88 } else if (_heap->is_concurrent_traversal_in_progress()) {
89 ShenandoahEvacOOMScope evac_scope;
90 ShenandoahUpdateRefsForOopClosure</* evac = */ true, /* enqueue */ true> cl;
91 obj->oop_iterate(&cl);
92 } else {
93 ShenandoahUpdateRefsForOopClosure</* evac = */ false, /* enqueue */ false> cl;
94 obj->oop_iterate(&cl);
95 }
96 }
97
98 #endif // SHARE_GC_SHENANDOAH_SHENANDOAHBARRIERSETCLONE_INLINE_HPP
|
64 _heap(ShenandoahHeap::heap()),
65 _bs(ShenandoahBarrierSet::barrier_set()),
66 _cset(_heap->collection_set()),
67 _thread(Thread::current()) {
68 }
69
70 virtual void do_oop(oop* p) { do_oop_work(p); }
71 virtual void do_oop(narrowOop* p) { do_oop_work(p); }
72 };
73
74 void ShenandoahBarrierSet::clone_barrier(oop obj) {
75 assert(ShenandoahCloneBarrier, "only get here with clone barriers enabled");
76 assert(_heap->has_forwarded_objects(), "only when heap is unstable");
77
78 // This is called for cloning an object (see jvm.cpp) after the clone
79 // has been made. We are not interested in any 'previous value' because
80 // it would be NULL in any case. But we *are* interested in any oop*
81 // that potentially need to be updated.
82
83 shenandoah_assert_correct(NULL, obj);
84 if (skip_bulk_update(cast_from_oop<HeapWord*>(obj))) return;
85 if (_heap->is_evacuation_in_progress()) {
86 ShenandoahEvacOOMScope evac_scope;
87 ShenandoahUpdateRefsForOopClosure</* evac = */ true, /* enqueue */ false> cl;
88 obj->oop_iterate(&cl);
89 } else if (_heap->is_concurrent_traversal_in_progress()) {
90 ShenandoahEvacOOMScope evac_scope;
91 ShenandoahUpdateRefsForOopClosure</* evac = */ true, /* enqueue */ true> cl;
92 obj->oop_iterate(&cl);
93 } else {
94 ShenandoahUpdateRefsForOopClosure</* evac = */ false, /* enqueue */ false> cl;
95 obj->oop_iterate(&cl);
96 }
97 }
98
99 #endif // SHARE_GC_SHENANDOAH_SHENANDOAHBARRIERSETCLONE_INLINE_HPP
|