src/hotspot/share/gc/shenandoah/shenandoahSATBMarkQueueSet.cpp
changeset 58059 baa4dd528de0
parent 55498 e64383344f14
child 58679 9c3209ff7550
equal deleted inserted replaced
58058:b553ad95acf0 58059:baa4dd528de0
    25 
    25 
    26 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
    26 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
    27 #include "gc/shenandoah/shenandoahSATBMarkQueueSet.hpp"
    27 #include "gc/shenandoah/shenandoahSATBMarkQueueSet.hpp"
    28 #include "gc/shenandoah/shenandoahThreadLocalData.hpp"
    28 #include "gc/shenandoah/shenandoahThreadLocalData.hpp"
    29 
    29 
    30 ShenandoahSATBMarkQueueSet::ShenandoahSATBMarkQueueSet() :
    30 ShenandoahSATBMarkQueueSet::ShenandoahSATBMarkQueueSet(BufferNode::Allocator* allocator) :
    31   _heap(NULL),
    31   SATBMarkQueueSet(allocator)
    32   _satb_mark_queue_buffer_allocator("SATB Buffer Allocator", ShenandoahSATBBufferSize)
       
    33 {}
    32 {}
    34 
       
    35 void ShenandoahSATBMarkQueueSet::initialize(ShenandoahHeap* const heap,
       
    36                                             int process_completed_threshold,
       
    37                                             uint buffer_enqueue_threshold_percentage) {
       
    38   SATBMarkQueueSet::initialize(&_satb_mark_queue_buffer_allocator,
       
    39                                process_completed_threshold,
       
    40                                buffer_enqueue_threshold_percentage);
       
    41   _heap = heap;
       
    42 }
       
    43 
    33 
    44 SATBMarkQueue& ShenandoahSATBMarkQueueSet::satb_queue_for_thread(Thread* const t) const {
    34 SATBMarkQueue& ShenandoahSATBMarkQueueSet::satb_queue_for_thread(Thread* const t) const {
    45   return ShenandoahThreadLocalData::satb_mark_queue(t);
    35   return ShenandoahThreadLocalData::satb_mark_queue(t);
    46 }
    36 }
    47 
    37 
    58     return !_heap->requires_marking<RESOLVE>(entry);
    48     return !_heap->requires_marking<RESOLVE>(entry);
    59   }
    49   }
    60 };
    50 };
    61 
    51 
    62 void ShenandoahSATBMarkQueueSet::filter(SATBMarkQueue* queue) {
    52 void ShenandoahSATBMarkQueueSet::filter(SATBMarkQueue* queue) {
    63   assert(_heap != NULL, "SATB queue set not initialized");
    53   ShenandoahHeap* heap = ShenandoahHeap::heap();
    64   if (_heap->has_forwarded_objects()) {
    54   if (heap->has_forwarded_objects()) {
    65     apply_filter(ShenandoahSATBMarkQueueFilterFn<true>(_heap), queue);
    55     apply_filter(ShenandoahSATBMarkQueueFilterFn<true>(heap), queue);
    66   } else {
    56   } else {
    67     apply_filter(ShenandoahSATBMarkQueueFilterFn<false>(_heap), queue);
    57     apply_filter(ShenandoahSATBMarkQueueFilterFn<false>(heap), queue);
    68   }
    58   }
    69 }
    59 }
    70 
    60 
    71 void ShenandoahSATBMarkQueue::handle_completed_buffer() {
    61 void ShenandoahSATBMarkQueue::handle_completed_buffer() {
    72   SATBMarkQueue::handle_completed_buffer();
    62   SATBMarkQueue::handle_completed_buffer();