< prev index next >

src/hotspot/share/gc/g1/satbMarkQueue.cpp

Print this page

        

*** 23,32 **** --- 23,33 ---- */ #include "precompiled.hpp" #include "jvm.h" #include "gc/g1/g1CollectedHeap.inline.hpp" + #include "gc/g1/g1ThreadLocalData.hpp" #include "gc/g1/satbMarkQueue.hpp" #include "gc/shared/collectedHeap.hpp" #include "memory/allocation.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/mutexLocker.hpp"
*** 205,224 **** PtrQueueSet::initialize(cbl_mon, fl_lock, process_completed_threshold, -1); _shared_satb_queue.set_lock(lock); } void SATBMarkQueueSet::handle_zero_index_for_thread(JavaThread* t) { ! t->satb_mark_queue().handle_zero_index(); } #ifdef ASSERT void SATBMarkQueueSet::dump_active_states(bool expected_active) { log_error(gc, verify)("Expected SATB active state: %s", expected_active ? "ACTIVE" : "INACTIVE"); log_error(gc, verify)("Actual SATB active states:"); log_error(gc, verify)(" Queue set: %s", is_active() ? "ACTIVE" : "INACTIVE"); for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) { ! log_error(gc, verify)(" Thread \"%s\" queue: %s", t->name(), t->satb_mark_queue().is_active() ? "ACTIVE" : "INACTIVE"); } log_error(gc, verify)(" Shared queue: %s", shared_satb_queue()->is_active() ? "ACTIVE" : "INACTIVE"); } void SATBMarkQueueSet::verify_active_states(bool expected_active) { --- 206,225 ---- PtrQueueSet::initialize(cbl_mon, fl_lock, process_completed_threshold, -1); _shared_satb_queue.set_lock(lock); } void SATBMarkQueueSet::handle_zero_index_for_thread(JavaThread* t) { ! G1ThreadLocalData::satb_mark_queue(t).handle_zero_index(); } #ifdef ASSERT void SATBMarkQueueSet::dump_active_states(bool expected_active) { log_error(gc, verify)("Expected SATB active state: %s", expected_active ? "ACTIVE" : "INACTIVE"); log_error(gc, verify)("Actual SATB active states:"); log_error(gc, verify)(" Queue set: %s", is_active() ? "ACTIVE" : "INACTIVE"); for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) { ! log_error(gc, verify)(" Thread \"%s\" queue: %s", t->name(), G1ThreadLocalData::satb_mark_queue(t).is_active() ? "ACTIVE" : "INACTIVE"); } log_error(gc, verify)(" Shared queue: %s", shared_satb_queue()->is_active() ? "ACTIVE" : "INACTIVE"); } void SATBMarkQueueSet::verify_active_states(bool expected_active) {
*** 228,238 **** guarantee(false, "SATB queue set has an unexpected active state"); } // Verify thread queue states for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) { ! if (t->satb_mark_queue().is_active() != expected_active) { dump_active_states(expected_active); guarantee(false, "Thread SATB queue has an unexpected active state"); } } --- 229,239 ---- guarantee(false, "SATB queue set has an unexpected active state"); } // Verify thread queue states for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) { ! if (G1ThreadLocalData::satb_mark_queue(t).is_active() != expected_active) { dump_active_states(expected_active); guarantee(false, "Thread SATB queue has an unexpected active state"); } }
*** 249,266 **** #ifdef ASSERT verify_active_states(expected_active); #endif // ASSERT _all_active = active; for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) { ! t->satb_mark_queue().set_active(active); } shared_satb_queue()->set_active(active); } void SATBMarkQueueSet::filter_thread_buffers() { for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) { ! t->satb_mark_queue().filter(); } shared_satb_queue()->filter(); } bool SATBMarkQueueSet::apply_closure_to_completed_buffer(SATBBufferClosure* cl) { --- 250,267 ---- #ifdef ASSERT verify_active_states(expected_active); #endif // ASSERT _all_active = active; for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) { ! G1ThreadLocalData::satb_mark_queue(t).set_active(active); } shared_satb_queue()->set_active(active); } void SATBMarkQueueSet::filter_thread_buffers() { for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) { ! G1ThreadLocalData::satb_mark_queue(t).filter(); } shared_satb_queue()->filter(); } bool SATBMarkQueueSet::apply_closure_to_completed_buffer(SATBBufferClosure* cl) {
*** 310,320 **** i += 1; } for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) { jio_snprintf(buffer, SATB_PRINTER_BUFFER_SIZE, "Thread: %s", t->name()); ! t->satb_mark_queue().print(buffer); } shared_satb_queue()->print("Shared"); tty->cr(); --- 311,321 ---- i += 1; } for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) { jio_snprintf(buffer, SATB_PRINTER_BUFFER_SIZE, "Thread: %s", t->name()); ! G1ThreadLocalData::satb_mark_queue(t).print(buffer); } shared_satb_queue()->print("Shared"); tty->cr();
*** 341,349 **** deallocate_buffer(nd); } assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint."); // So we can safely manipulate these queues. for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) { ! t->satb_mark_queue().reset(); } shared_satb_queue()->reset(); } --- 342,350 ---- deallocate_buffer(nd); } assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint."); // So we can safely manipulate these queues. for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) { ! G1ThreadLocalData::satb_mark_queue(t).reset(); } shared_satb_queue()->reset(); }
< prev index next >