< prev index next >

src/hotspot/share/runtime/safepoint.cpp

Print this page




 564     }
 565   }
 566 };
 567 
 568 class ParallelSPCleanupTask : public AbstractGangTask {
 569 private:
 570   SubTasksDone _subtasks;
 571   ParallelSPCleanupThreadClosure _cleanup_threads_cl;
 572   uint _num_workers;
 573   DeflateMonitorCounters* _counters;
 574 public:
 575   ParallelSPCleanupTask(uint num_workers, DeflateMonitorCounters* counters) :
 576     AbstractGangTask("Parallel Safepoint Cleanup"),
 577     _cleanup_threads_cl(ParallelSPCleanupThreadClosure(counters)),
 578     _num_workers(num_workers),
 579     _subtasks(SubTasksDone(SafepointSynchronize::SAFEPOINT_CLEANUP_NUM_TASKS)),
 580     _counters(counters) {}
 581 
 582   void work(uint worker_id) {
 583     // All threads deflate monitors and mark nmethods (if necessary).
 584     Threads::parallel_threads_do(true, &_cleanup_threads_cl);
 585 
 586     if (!_subtasks.is_task_claimed(SafepointSynchronize::SAFEPOINT_CLEANUP_DEFLATE_MONITORS)) {
 587       const char* name = "deflating idle monitors";
 588       EventSafepointCleanupTask event;
 589       TraceTime timer(name, TRACETIME_LOG(Info, safepoint, cleanup));
 590       ObjectSynchronizer::deflate_idle_monitors(_counters);
 591       event_safepoint_cleanup_task_commit(event, name);
 592     }
 593 
 594     if (!_subtasks.is_task_claimed(SafepointSynchronize::SAFEPOINT_CLEANUP_UPDATE_INLINE_CACHES)) {
 595       const char* name = "updating inline caches";
 596       EventSafepointCleanupTask event;
 597       TraceTime timer(name, TRACETIME_LOG(Info, safepoint, cleanup));
 598       InlineCacheBuffer::update_inline_caches();
 599       event_safepoint_cleanup_task_commit(event, name);
 600     }
 601 
 602     if (!_subtasks.is_task_claimed(SafepointSynchronize::SAFEPOINT_CLEANUP_COMPILATION_POLICY)) {
 603       const char* name = "compilation policy safepoint handler";
 604       EventSafepointCleanupTask event;




 564     }
 565   }
 566 };
 567 
 568 class ParallelSPCleanupTask : public AbstractGangTask {
 569 private:
 570   SubTasksDone _subtasks;
 571   ParallelSPCleanupThreadClosure _cleanup_threads_cl;
 572   uint _num_workers;
 573   DeflateMonitorCounters* _counters;
 574 public:
 575   ParallelSPCleanupTask(uint num_workers, DeflateMonitorCounters* counters) :
 576     AbstractGangTask("Parallel Safepoint Cleanup"),
 577     _cleanup_threads_cl(ParallelSPCleanupThreadClosure(counters)),
 578     _num_workers(num_workers),
 579     _subtasks(SubTasksDone(SafepointSynchronize::SAFEPOINT_CLEANUP_NUM_TASKS)),
 580     _counters(counters) {}
 581 
 582   void work(uint worker_id) {
 583     // All threads deflate monitors and mark nmethods (if necessary).
 584     Threads::possibly_parallel_threads_do(true, &_cleanup_threads_cl);
 585 
 586     if (!_subtasks.is_task_claimed(SafepointSynchronize::SAFEPOINT_CLEANUP_DEFLATE_MONITORS)) {
 587       const char* name = "deflating idle monitors";
 588       EventSafepointCleanupTask event;
 589       TraceTime timer(name, TRACETIME_LOG(Info, safepoint, cleanup));
 590       ObjectSynchronizer::deflate_idle_monitors(_counters);
 591       event_safepoint_cleanup_task_commit(event, name);
 592     }
 593 
 594     if (!_subtasks.is_task_claimed(SafepointSynchronize::SAFEPOINT_CLEANUP_UPDATE_INLINE_CACHES)) {
 595       const char* name = "updating inline caches";
 596       EventSafepointCleanupTask event;
 597       TraceTime timer(name, TRACETIME_LOG(Info, safepoint, cleanup));
 598       InlineCacheBuffer::update_inline_caches();
 599       event_safepoint_cleanup_task_commit(event, name);
 600     }
 601 
 602     if (!_subtasks.is_task_claimed(SafepointSynchronize::SAFEPOINT_CLEANUP_COMPILATION_POLICY)) {
 603       const char* name = "compilation policy safepoint handler";
 604       EventSafepointCleanupTask event;


< prev index next >