< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahBarrierSetClone.inline.hpp

Print this page
rev 58345 : 8240873: Shenandoah: Short-cut arraycopy barriers


  65           _heap(ShenandoahHeap::heap()),
  66           _bs(ShenandoahBarrierSet::barrier_set()),
  67           _cset(_heap->collection_set()),
  68           _thread(Thread::current()) {
  69   }
  70 
  71   virtual void do_oop(oop* p)       { do_oop_work(p); }
  72   virtual void do_oop(narrowOop* p) { do_oop_work(p); }
  73 };
  74 
  75 void ShenandoahBarrierSet::clone_barrier(oop obj) {
  76   assert(ShenandoahCloneBarrier, "only get here with clone barriers enabled");
  77   assert(_heap->has_forwarded_objects(), "only when heap is unstable");
  78 
  79   // This is called for cloning an object (see jvm.cpp) after the clone
  80   // has been made. We are not interested in any 'previous value' because
  81   // it would be NULL in any case. But we *are* interested in any oop*
  82   // that potentially need to be updated.
  83 
  84   shenandoah_assert_correct(NULL, obj);

  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


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