src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp
changeset 54425 13c02cc7a6e5
parent 54423 6c0ab8bd8da5
child 54766 1321f8cf9de5
equal deleted inserted replaced
54424:b354ffb03ae4 54425:13c02cc7a6e5
   105     cl.do_oop(dst++);
   105     cl.do_oop(dst++);
   106   }
   106   }
   107 }
   107 }
   108 
   108 
   109 void ShenandoahBarrierSet::write_ref_array(HeapWord* start, size_t count) {
   109 void ShenandoahBarrierSet::write_ref_array(HeapWord* start, size_t count) {
   110   assert(UseShenandoahGC, "should be enabled");
   110   assert(_heap->is_update_refs_in_progress(), "should not be here otherwise");
   111   if (count == 0) return;
   111   assert(count > 0, "Should have been filtered before");
   112   if (!ShenandoahCloneBarrier) return;
       
   113 
       
   114   if (!need_update_refs_barrier()) return;
       
   115 
   112 
   116   if (_heap->is_concurrent_traversal_in_progress()) {
   113   if (_heap->is_concurrent_traversal_in_progress()) {
   117     ShenandoahEvacOOMScope oom_evac_scope;
   114     ShenandoahEvacOOMScope oom_evac_scope;
   118     if (UseCompressedOops) {
   115     if (UseCompressedOops) {
   119       write_ref_array_loop<narrowOop, /* wb = */ true>(start, count);
   116       write_ref_array_loop<narrowOop, /* wb = */ true>(start, count);
   195   shenandoah_assert_not_forwarded_except  (v, o, o == NULL || _heap->cancelled_gc() || !_heap->is_concurrent_mark_in_progress());
   192   shenandoah_assert_not_forwarded_except  (v, o, o == NULL || _heap->cancelled_gc() || !_heap->is_concurrent_mark_in_progress());
   196   shenandoah_assert_not_in_cset_except    (v, o, o == NULL || _heap->cancelled_gc() || !_heap->is_concurrent_mark_in_progress());
   193   shenandoah_assert_not_in_cset_except    (v, o, o == NULL || _heap->cancelled_gc() || !_heap->is_concurrent_mark_in_progress());
   197 }
   194 }
   198 
   195 
   199 void ShenandoahBarrierSet::write_region(MemRegion mr) {
   196 void ShenandoahBarrierSet::write_region(MemRegion mr) {
   200   assert(UseShenandoahGC, "should be enabled");
       
   201   if (!ShenandoahCloneBarrier) return;
   197   if (!ShenandoahCloneBarrier) return;
   202   if (! need_update_refs_barrier()) return;
   198   if (!_heap->is_update_refs_in_progress()) return;
   203 
   199 
   204   // This is called for cloning an object (see jvm.cpp) after the clone
   200   // This is called for cloning an object (see jvm.cpp) after the clone
   205   // has been made. We are not interested in any 'previous value' because
   201   // has been made. We are not interested in any 'previous value' because
   206   // it would be NULL in any case. But we *are* interested in any oop*
   202   // it would be NULL in any case. But we *are* interested in any oop*
   207   // that potentially need to be updated.
   203   // that potentially need to be updated.