< prev index next >

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

Print this page
rev 8789 : imported patch 8073052-Rename-and-clean-up-the-allocation-manager-hierarchy-in-g1Allocator
rev 8793 : 8133043: Clean up code related to termination stats printing
Summary: Reformat termination stats related code to make it look more similar to existing code.
Reviewed-by:

*** 4447,4468 **** RefToScanQueueSet *_queues; G1RootProcessor* _root_processor; ParallelTaskTerminator _terminator; uint _n_workers; - Mutex _stats_lock; - Mutex* stats_lock() { return &_stats_lock; } - public: G1ParTask(G1CollectedHeap* g1h, RefToScanQueueSet *task_queues, G1RootProcessor* root_processor, uint n_workers) : AbstractGangTask("G1 collection"), _g1h(g1h), _queues(task_queues), _root_processor(root_processor), _terminator(n_workers, _queues), ! _n_workers(n_workers), ! _stats_lock(Mutex::leaf, "parallel G1 stats lock", true) {} RefToScanQueueSet* queues() { return _queues; } RefToScanQueue *work_queue(int i) { --- 4447,4464 ---- RefToScanQueueSet *_queues; G1RootProcessor* _root_processor; ParallelTaskTerminator _terminator; uint _n_workers; public: G1ParTask(G1CollectedHeap* g1h, RefToScanQueueSet *task_queues, G1RootProcessor* root_processor, uint n_workers) : AbstractGangTask("G1 collection"), _g1h(g1h), _queues(task_queues), _root_processor(root_processor), _terminator(n_workers, _queues), ! _n_workers(n_workers) {} RefToScanQueueSet* queues() { return _queues; } RefToScanQueue *work_queue(int i) {
*** 4585,4596 **** } _g1h->g1_policy()->record_thread_age_table(pss.age_table()); _g1h->update_surviving_young_words(pss.surviving_young_words()+1); if (PrintTerminationStats) { ! MutexLocker x(stats_lock()); ! pss.print_termination_stats(worker_id); } assert(pss.queue_is_empty(), "should be empty"); // Close the inner scope so that the ResourceMark and HandleMark --- 4581,4592 ---- } _g1h->g1_policy()->record_thread_age_table(pss.age_table()); _g1h->update_surviving_young_words(pss.surviving_young_words()+1); if (PrintTerminationStats) { ! MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); ! pss.print_termination_stats(); } assert(pss.queue_is_empty(), "should be empty"); // Close the inner scope so that the ResourceMark and HandleMark
*** 5502,5512 **** if (collector_state()->during_initial_mark_pause()) { ClassLoaderDataGraph::clear_claimed_marks(); } // The individual threads will set their evac-failure closures. ! if (PrintTerminationStats) G1ParScanThreadState::print_termination_stats_hdr(); workers()->run_task(&g1_par_task); end_par_time_sec = os::elapsedTime(); // Closing the inner scope will execute the destructor --- 5498,5510 ---- if (collector_state()->during_initial_mark_pause()) { ClassLoaderDataGraph::clear_claimed_marks(); } // The individual threads will set their evac-failure closures. ! if (PrintTerminationStats) { ! G1ParScanThreadState::print_termination_stats_hdr(); ! } workers()->run_task(&g1_par_task); end_par_time_sec = os::elapsedTime(); // Closing the inner scope will execute the destructor
< prev index next >