< prev index next >

src/share/vm/gc_implementation/shenandoah/shenandoahConcurrentMark.inline.hpp

Print this page
rev 11463 : Backport Traversal GC


  23 
  24 #ifndef SHARE_VM_GC_SHENANDOAH_SHENANDOAHCONCURRENTMARK_INLINE_HPP
  25 #define SHARE_VM_GC_SHENANDOAH_SHENANDOAHCONCURRENTMARK_INLINE_HPP
  26 
  27 #include "gc_implementation/shenandoah/shenandoahAsserts.hpp"
  28 #include "gc_implementation/shenandoah/shenandoahBarrierSet.inline.hpp"
  29 #include "gc_implementation/shenandoah/shenandoahConcurrentMark.hpp"
  30 #include "gc_implementation/shenandoah/shenandoahMarkingContext.inline.hpp"
  31 #include "gc_implementation/shenandoah/shenandoahHeap.inline.hpp"
  32 #include "gc_implementation/shenandoah/shenandoahOopClosures.inline.hpp"
  33 #include "gc_implementation/shenandoah/shenandoahStringDedup.hpp"
  34 #include "gc_implementation/shenandoah/shenandoahTaskqueue.inline.hpp"
  35 #include "memory/iterator.inline.hpp"
  36 #include "oops/oop.inline.hpp"
  37 #include "runtime/prefetch.inline.hpp"
  38 
  39 template <class T>
  40 void ShenandoahConcurrentMark::do_task(ShenandoahObjToScanQueue* q, T* cl, jushort* live_data, ShenandoahMarkTask* task) {
  41   oop obj = task->obj();
  42 
  43   shenandoah_assert_not_forwarded(NULL, obj);
  44   shenandoah_assert_marked(NULL, obj);
  45   shenandoah_assert_not_in_cset_except(NULL, obj, _heap->cancelled_gc());
  46 
  47   if (task->is_not_chunked()) {
  48     if (obj->is_instance()) {
  49       // Case 1: Normal oop, process as usual.
  50       obj->oop_iterate(cl);
  51     } else if (obj->is_objArray()) {
  52       // Case 2: Object array instance and no chunk is set. Must be the first
  53       // time we visit it, start the chunked processing.
  54       do_chunked_array_start<T>(q, cl, obj);
  55     } else {
  56       // Case 3: Primitive array. Do nothing, no oops there. We use the same
  57       // performance tweak TypeArrayKlass::oop_oop_iterate_impl is using:
  58       // We skip iterating over the klass pointer since we know that
  59       // Universe::TypeArrayKlass never moves.
  60       assert (obj->is_typeArray(), "should be type array");
  61     }
  62     // Count liveness the last: push the outstanding work to the queues first
  63     count_liveness(live_data, obj);




  23 
  24 #ifndef SHARE_VM_GC_SHENANDOAH_SHENANDOAHCONCURRENTMARK_INLINE_HPP
  25 #define SHARE_VM_GC_SHENANDOAH_SHENANDOAHCONCURRENTMARK_INLINE_HPP
  26 
  27 #include "gc_implementation/shenandoah/shenandoahAsserts.hpp"
  28 #include "gc_implementation/shenandoah/shenandoahBarrierSet.inline.hpp"
  29 #include "gc_implementation/shenandoah/shenandoahConcurrentMark.hpp"
  30 #include "gc_implementation/shenandoah/shenandoahMarkingContext.inline.hpp"
  31 #include "gc_implementation/shenandoah/shenandoahHeap.inline.hpp"
  32 #include "gc_implementation/shenandoah/shenandoahOopClosures.inline.hpp"
  33 #include "gc_implementation/shenandoah/shenandoahStringDedup.hpp"
  34 #include "gc_implementation/shenandoah/shenandoahTaskqueue.inline.hpp"
  35 #include "memory/iterator.inline.hpp"
  36 #include "oops/oop.inline.hpp"
  37 #include "runtime/prefetch.inline.hpp"
  38 
  39 template <class T>
  40 void ShenandoahConcurrentMark::do_task(ShenandoahObjToScanQueue* q, T* cl, jushort* live_data, ShenandoahMarkTask* task) {
  41   oop obj = task->obj();
  42 
  43   shenandoah_assert_not_forwarded_except(NULL, obj, _heap->is_concurrent_traversal_in_progress() && _heap->cancelled_gc());
  44   shenandoah_assert_marked(NULL, obj);
  45   shenandoah_assert_not_in_cset_except(NULL, obj, _heap->cancelled_gc());
  46 
  47   if (task->is_not_chunked()) {
  48     if (obj->is_instance()) {
  49       // Case 1: Normal oop, process as usual.
  50       obj->oop_iterate(cl);
  51     } else if (obj->is_objArray()) {
  52       // Case 2: Object array instance and no chunk is set. Must be the first
  53       // time we visit it, start the chunked processing.
  54       do_chunked_array_start<T>(q, cl, obj);
  55     } else {
  56       // Case 3: Primitive array. Do nothing, no oops there. We use the same
  57       // performance tweak TypeArrayKlass::oop_oop_iterate_impl is using:
  58       // We skip iterating over the klass pointer since we know that
  59       // Universe::TypeArrayKlass never moves.
  60       assert (obj->is_typeArray(), "should be type array");
  61     }
  62     // Count liveness the last: push the outstanding work to the queues first
  63     count_liveness(live_data, obj);


< prev index next >