< prev index next >

src/share/vm/gc/g1/g1ConcurrentMark.cpp

Print this page
rev 12906 : [mq]: gc_interface

*** 25,34 **** --- 25,35 ---- #include "precompiled.hpp" #include "classfile/metadataOnStackMark.hpp" #include "classfile/symbolTable.hpp" #include "code/codeCache.hpp" #include "gc/g1/concurrentMarkThread.inline.hpp" + #include "gc/g1/g1BarrierSet.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorState.hpp" #include "gc/g1/g1ConcurrentMark.inline.hpp" #include "gc/g1/g1HeapVerifier.hpp" #include "gc/g1/g1OopClosures.inline.hpp"
*** 444,454 **** assert(CGC_lock != NULL, "Where's the CGC_lock?"); assert(_markBitMap1.covers(g1h->reserved_region()), "_markBitMap1 inconsistency"); assert(_markBitMap2.covers(g1h->reserved_region()), "_markBitMap2 inconsistency"); ! SATBMarkQueueSet& satb_qs = JavaThread::satb_mark_queue_set(); satb_qs.set_buffer_size(G1SATBBufferSize); _root_regions.init(_g1h->survivor(), this); if (ConcGCThreads > ParallelGCThreads) { --- 445,455 ---- assert(CGC_lock != NULL, "Where's the CGC_lock?"); assert(_markBitMap1.covers(g1h->reserved_region()), "_markBitMap1 inconsistency"); assert(_markBitMap2.covers(g1h->reserved_region()), "_markBitMap2 inconsistency"); ! SATBMarkQueueSet& satb_qs = G1BarrierSet::satb_mark_queue_set(); satb_qs.set_buffer_size(G1SATBBufferSize); _root_regions.init(_g1h->survivor(), this); if (ConcGCThreads > ParallelGCThreads) {
*** 809,819 **** ReferenceProcessor* rp = g1h->ref_processor_cm(); // enable ("weak") refs discovery rp->enable_discovery(); rp->setup_policy(false); // snapshot the soft ref policy to be used in this cycle ! SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set(); // This is the start of the marking cycle, we're expected all // threads to have SATB queues with active set to false. satb_mq_set.set_active_all_threads(true, /* new active value */ false /* expected_active */); --- 810,820 ---- ReferenceProcessor* rp = g1h->ref_processor_cm(); // enable ("weak") refs discovery rp->enable_discovery(); rp->setup_policy(false); // snapshot the soft ref policy to be used in this cycle ! SATBMarkQueueSet& satb_mq_set = G1BarrierSet::satb_mark_queue_set(); // This is the start of the marking cycle, we're expected all // threads to have SATB queues with active set to false. satb_mq_set.set_active_all_threads(true, /* new active value */ false /* expected_active */);
*** 1138,1148 **** // Clear the marking state because we will be restarting // marking due to overflowing the global mark stack. reset_marking_state(); } else { ! SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set(); // We're done with marking. // This is the end of the marking cycle, we're expected all // threads to have SATB queues with active set to true. satb_mq_set.set_active_all_threads(false, /* new active value */ true /* expected_active */); --- 1139,1149 ---- // Clear the marking state because we will be restarting // marking due to overflowing the global mark stack. reset_marking_state(); } else { ! SATBMarkQueueSet& satb_mq_set = G1BarrierSet::satb_mark_queue_set(); // We're done with marking. // This is the end of the marking cycle, we're expected all // threads to have SATB queues with active set to true. satb_mq_set.set_active_all_threads(false, /* new active value */ true /* expected_active */);
*** 1837,1847 **** jt->satb_mark_queue().apply_closure_and_empty(&_cm_satb_cl); } } else if (thread->is_VM_thread()) { if (thread->claim_oops_do(true, _thread_parity)) { ! JavaThread::satb_mark_queue_set().shared_satb_queue()->apply_closure_and_empty(&_cm_satb_cl); } } } }; --- 1838,1848 ---- jt->satb_mark_queue().apply_closure_and_empty(&_cm_satb_cl); } } else if (thread->is_VM_thread()) { if (thread->claim_oops_do(true, _thread_parity)) { ! G1BarrierSet::satb_mark_queue_set().shared_satb_queue()->apply_closure_and_empty(&_cm_satb_cl); } } } };
*** 1905,1915 **** // active_workers will be fewer. The extra ones will just bail out // immediately. g1h->workers()->run_task(&remarkTask); } ! SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set(); guarantee(has_overflown() || satb_mq_set.completed_buffers_num() == 0, "Invariant: has_overflown = %s, num buffers = " SIZE_FORMAT, BOOL_TO_STR(has_overflown()), satb_mq_set.completed_buffers_num()); --- 1906,1916 ---- // active_workers will be fewer. The extra ones will just bail out // immediately. g1h->workers()->run_task(&remarkTask); } ! SATBMarkQueueSet& satb_mq_set = G1BarrierSet::satb_mark_queue_set(); guarantee(has_overflown() || satb_mq_set.completed_buffers_num() == 0, "Invariant: has_overflown = %s, num buffers = " SIZE_FORMAT, BOOL_TO_STR(has_overflown()), satb_mq_set.completed_buffers_num());
*** 2104,2114 **** } _first_overflow_barrier_sync.abort(); _second_overflow_barrier_sync.abort(); _has_aborted = true; ! SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set(); satb_mq_set.abandon_partial_marking(); // This can be called either during or outside marking, we'll read // the expected_active value from the SATB queue set. satb_mq_set.set_active_all_threads( false, /* new active value */ --- 2105,2115 ---- } _first_overflow_barrier_sync.abort(); _second_overflow_barrier_sync.abort(); _has_aborted = true; ! SATBMarkQueueSet& satb_mq_set = G1BarrierSet::satb_mark_queue_set(); satb_mq_set.abandon_partial_marking(); // This can be called either during or outside marking, we'll read // the expected_active value from the SATB queue set. satb_mq_set.set_active_all_threads( false, /* new active value */
*** 2345,2355 **** return; } // (6) Finally, we check whether there are enough completed STAB // buffers available for processing. If there are, we abort. ! SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set(); if (!_draining_satb_buffers && satb_mq_set.process_completed_buffers()) { // we do need to process SATB buffers, we'll abort and restart // the marking task to do so set_has_aborted(); return; --- 2346,2356 ---- return; } // (6) Finally, we check whether there are enough completed STAB // buffers available for processing. If there are, we abort. ! SATBMarkQueueSet& satb_mq_set = G1BarrierSet::satb_mark_queue_set(); if (!_draining_satb_buffers && satb_mq_set.process_completed_buffers()) { // we do need to process SATB buffers, we'll abort and restart // the marking task to do so set_has_aborted(); return;
*** 2498,2508 **** // notices that SATB buffers are available for draining. It'd be // very counter productive if it did that. :-) _draining_satb_buffers = true; G1CMSATBBufferClosure satb_cl(this, _g1h); ! SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set(); // This keeps claiming and applying the closure to completed buffers // until we run out of buffers or we need to abort. while (!has_aborted() && satb_mq_set.apply_closure_to_completed_buffer(&satb_cl)) { --- 2499,2509 ---- // notices that SATB buffers are available for draining. It'd be // very counter productive if it did that. :-) _draining_satb_buffers = true; G1CMSATBBufferClosure satb_cl(this, _g1h); ! SATBMarkQueueSet& satb_mq_set = G1BarrierSet::satb_mark_queue_set(); // This keeps claiming and applying the closure to completed buffers // until we run out of buffers or we need to abort. while (!has_aborted() && satb_mq_set.apply_closure_to_completed_buffer(&satb_cl)) {
< prev index next >