< prev index next >

src/hotspot/share/runtime/vmOperations.cpp

Print this page
rev 55493 : imported patch dcubed.monitor_deflate_conc.v2.04
rev 55494 : imported patch dcubed.monitor_deflate_conc.v2.05


 456         }
 457       }
 458     }
 459 
 460     if (num_active == 0) {
 461        return 0;
 462     } else if (attempts > max_wait) {
 463        return num_active;
 464     } else if (num_active_compiler_thread == 0 && attempts > max_wait_user_thread) {
 465        return num_active;
 466     }
 467 
 468     attempts++;
 469 
 470     MonitorLocker ml(&timer, Mutex::_no_safepoint_check_flag);
 471     ml.wait(10);
 472   }
 473 }
 474 
 475 bool VM_Exit::doit_prologue() {
 476   if (AsyncDeflateIdleMonitors) {
 477     // AsyncDeflateIdleMonitors does a special deflation at the VM_Exit
 478     // safepoint in order to reduce the in-use monitor population that
 479     // is reported ObjectSynchronizer::log_in_use_monitor_details() at
 480     // VM exit.
 481     ObjectSynchronizer::set_is_special_deflation_requested(true);
 482   }
 483   return true;
 484 }
 485 
 486 void VM_Exit::doit() {
 487 
 488   if (VerifyBeforeExit) {
 489     HandleMark hm(VMThread::vm_thread());
 490     // Among other things, this ensures that Eden top is correct.
 491     Universe::heap()->prepare_for_verify();
 492     // Silent verification so as not to pollute normal output,
 493     // unless we really asked for it.
 494     Universe::verify();
 495   }
 496 
 497   CompileBroker::set_should_block();
 498 
 499   // Wait for a short period for threads in native to block. Any thread
 500   // still executing native code after the wait will be stopped at




 456         }
 457       }
 458     }
 459 
 460     if (num_active == 0) {
 461        return 0;
 462     } else if (attempts > max_wait) {
 463        return num_active;
 464     } else if (num_active_compiler_thread == 0 && attempts > max_wait_user_thread) {
 465        return num_active;
 466     }
 467 
 468     attempts++;
 469 
 470     MonitorLocker ml(&timer, Mutex::_no_safepoint_check_flag);
 471     ml.wait(10);
 472   }
 473 }
 474 
 475 bool VM_Exit::doit_prologue() {
 476   if (AsyncDeflateIdleMonitors && log_is_enabled(Info, monitorinflation)) {
 477     // AsyncDeflateIdleMonitors does a special deflation at the VM_Exit
 478     // safepoint in order to reduce the in-use monitor population that
 479     // is reported by ObjectSynchronizer::log_in_use_monitor_details()
 480     // at VM exit.
 481     ObjectSynchronizer::set_is_special_deflation_requested(true);
 482   }
 483   return true;
 484 }
 485 
 486 void VM_Exit::doit() {
 487 
 488   if (VerifyBeforeExit) {
 489     HandleMark hm(VMThread::vm_thread());
 490     // Among other things, this ensures that Eden top is correct.
 491     Universe::heap()->prepare_for_verify();
 492     // Silent verification so as not to pollute normal output,
 493     // unless we really asked for it.
 494     Universe::verify();
 495   }
 496 
 497   CompileBroker::set_should_block();
 498 
 499   // Wait for a short period for threads in native to block. Any thread
 500   // still executing native code after the wait will be stopped at


< prev index next >