508 }
509 #if INCLUDE_ALL_GCS
510 // If there are any concurrent GC threads resume them.
511 if (UseConcMarkSweepGC) {
512 ConcurrentMarkSweepThread::desynchronize(false);
513 } else if (UseG1GC) {
514 SuspendibleThreadSet::desynchronize();
515 }
516 #endif // INCLUDE_ALL_GCS
517 // record this time so VMThread can keep track how much time has elapsed
518 // since last safepoint.
519 _end_of_last_safepoint = os::javaTimeMillis();
520
521 if (event.should_commit()) {
522 event.set_safepointId(safepoint_id);
523 event.commit();
524 }
525 }
526
527 bool SafepointSynchronize::is_cleanup_needed() {
528 // Need a safepoint if some inline cache buffers is non-empty
529 if (!InlineCacheBuffer::is_empty()) return true;
530 return false;
531 }
532
533 static void event_safepoint_cleanup_task_commit(EventSafepointCleanupTask& event, const char* name) {
534 if (event.should_commit()) {
535 event.set_safepointId(SafepointSynchronize::safepoint_counter());
536 event.set_name(name);
537 event.commit();
538 }
539 }
540
541 // Various cleaning tasks that should be done periodically at safepoints
542 void SafepointSynchronize::do_cleanup_tasks() {
543 {
544 const char* name = "deflating idle monitors";
545 EventSafepointCleanupTask event;
546 TraceTime timer(name, TRACETIME_LOG(Info, safepoint, cleanup));
547 ObjectSynchronizer::deflate_idle_monitors();
|
508 }
509 #if INCLUDE_ALL_GCS
510 // If there are any concurrent GC threads resume them.
511 if (UseConcMarkSweepGC) {
512 ConcurrentMarkSweepThread::desynchronize(false);
513 } else if (UseG1GC) {
514 SuspendibleThreadSet::desynchronize();
515 }
516 #endif // INCLUDE_ALL_GCS
517 // record this time so VMThread can keep track how much time has elapsed
518 // since last safepoint.
519 _end_of_last_safepoint = os::javaTimeMillis();
520
521 if (event.should_commit()) {
522 event.set_safepointId(safepoint_id);
523 event.commit();
524 }
525 }
526
527 bool SafepointSynchronize::is_cleanup_needed() {
528 // Need a safepoint if there many monitor to deflate
529 if (ObjectSynchronizer::is_cleanup_needed()) return true;
530 // Need a safepoint if some inline cache buffers is non-empty
531 if (!InlineCacheBuffer::is_empty()) return true;
532 return false;
533 }
534
535 static void event_safepoint_cleanup_task_commit(EventSafepointCleanupTask& event, const char* name) {
536 if (event.should_commit()) {
537 event.set_safepointId(SafepointSynchronize::safepoint_counter());
538 event.set_name(name);
539 event.commit();
540 }
541 }
542
543 // Various cleaning tasks that should be done periodically at safepoints
544 void SafepointSynchronize::do_cleanup_tasks() {
545 {
546 const char* name = "deflating idle monitors";
547 EventSafepointCleanupTask event;
548 TraceTime timer(name, TRACETIME_LOG(Info, safepoint, cleanup));
549 ObjectSynchronizer::deflate_idle_monitors();
|