< prev index next >

src/hotspot/share/runtime/safepoint.cpp

Print this page




 597   if (event.should_commit()) {
 598     post_safepoint_end_event(&event);
 599   }
 600 }
 601 
 602 bool SafepointSynchronize::is_cleanup_needed() {
 603   // Need a safepoint if there are many monitors to deflate.
 604   if (ObjectSynchronizer::is_cleanup_needed()) return true;
 605   // Need a safepoint if some inline cache buffers is non-empty
 606   if (!InlineCacheBuffer::is_empty()) return true;
 607   return false;
 608 }
 609 
 610 class ParallelSPCleanupThreadClosure : public ThreadClosure {
 611 private:
 612   CodeBlobClosure* _nmethod_cl;
 613   DeflateMonitorCounters* _counters;
 614 
 615 public:
 616   ParallelSPCleanupThreadClosure(DeflateMonitorCounters* counters) :
 617     _counters(counters),
 618     _nmethod_cl(NMethodSweeper::prepare_mark_active_nmethods()) {}
 619 
 620   void do_thread(Thread* thread) {
 621     ObjectSynchronizer::deflate_thread_local_monitors(thread, _counters);
 622     if (_nmethod_cl != NULL && thread->is_Java_thread() &&
 623         ! thread->is_Code_cache_sweeper_thread()) {
 624       JavaThread* jt = (JavaThread*) thread;
 625       jt->nmethods_do(_nmethod_cl);
 626     }
 627   }
 628 };
 629 
 630 class ParallelSPCleanupTask : public AbstractGangTask {
 631 private:
 632   SubTasksDone _subtasks;
 633   ParallelSPCleanupThreadClosure _cleanup_threads_cl;
 634   uint _num_workers;
 635   DeflateMonitorCounters* _counters;
 636 public:
 637   ParallelSPCleanupTask(uint num_workers, DeflateMonitorCounters* counters) :
 638     AbstractGangTask("Parallel Safepoint Cleanup"),




 597   if (event.should_commit()) {
 598     post_safepoint_end_event(&event);
 599   }
 600 }
 601 
 602 bool SafepointSynchronize::is_cleanup_needed() {
 603   // Need a safepoint if there are many monitors to deflate.
 604   if (ObjectSynchronizer::is_cleanup_needed()) return true;
 605   // Need a safepoint if some inline cache buffers is non-empty
 606   if (!InlineCacheBuffer::is_empty()) return true;
 607   return false;
 608 }
 609 
 610 class ParallelSPCleanupThreadClosure : public ThreadClosure {
 611 private:
 612   CodeBlobClosure* _nmethod_cl;
 613   DeflateMonitorCounters* _counters;
 614 
 615 public:
 616   ParallelSPCleanupThreadClosure(DeflateMonitorCounters* counters) :
 617     _nmethod_cl(NMethodSweeper::prepare_mark_active_nmethods()), _counters(counters) {}

 618 
 619   void do_thread(Thread* thread) {
 620     ObjectSynchronizer::deflate_thread_local_monitors(thread, _counters);
 621     if (_nmethod_cl != NULL && thread->is_Java_thread() &&
 622         ! thread->is_Code_cache_sweeper_thread()) {
 623       JavaThread* jt = (JavaThread*) thread;
 624       jt->nmethods_do(_nmethod_cl);
 625     }
 626   }
 627 };
 628 
 629 class ParallelSPCleanupTask : public AbstractGangTask {
 630 private:
 631   SubTasksDone _subtasks;
 632   ParallelSPCleanupThreadClosure _cleanup_threads_cl;
 633   uint _num_workers;
 634   DeflateMonitorCounters* _counters;
 635 public:
 636   ParallelSPCleanupTask(uint num_workers, DeflateMonitorCounters* counters) :
 637     AbstractGangTask("Parallel Safepoint Cleanup"),


< prev index next >