< prev index next >

src/hotspot/share/runtime/java.cpp

Print this page
rev 47819 : imported patch 10.07.open.rebase_20171110.dcubed


 339     alloc_stats.print();
 340     tty->cr();
 341   }
 342 
 343   if (PrintSystemDictionaryAtExit) {
 344     SystemDictionary::print();
 345   }
 346 
 347   if (LogTouchedMethods && PrintTouchedMethodsAtExit) {
 348     Method::print_touched_methods(tty);
 349   }
 350 
 351   if (PrintBiasedLockingStatistics) {
 352     BiasedLocking::print_counters();
 353   }
 354 
 355   // Native memory tracking data
 356   if (PrintNMTStatistics) {
 357     MemTracker::final_report(tty);
 358   }


 359 }
 360 
 361 #else // PRODUCT MODE STATISTICS
 362 
 363 void print_statistics() {
 364 
 365   if (PrintMethodData) {
 366     print_method_profiling_data();
 367   }
 368 
 369   if (CITime) {
 370     CompileBroker::print_times();
 371   }
 372 
 373   if (PrintCodeCache) {
 374     MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
 375     CodeCache::print();
 376   }
 377 
 378   if (PrintMethodFlushingStatistics) {
 379     NMethodSweeper::print();
 380   }
 381 
 382 #ifdef COMPILER2
 383   if (PrintPreciseBiasedLockingStatistics || PrintPreciseRTMLockingStatistics) {
 384     OptoRuntime::print_named_counters();
 385   }
 386 #endif
 387   if (PrintBiasedLockingStatistics) {
 388     BiasedLocking::print_counters();
 389   }
 390 
 391   // Native memory tracking data
 392   if (PrintNMTStatistics) {
 393     MemTracker::final_report(tty);
 394   }
 395 
 396   if (LogTouchedMethods && PrintTouchedMethodsAtExit) {
 397     Method::print_touched_methods(tty);
 398   }


 399 }
 400 
 401 #endif
 402 
 403 // Note: before_exit() can be executed only once, if more than one threads
 404 //       are trying to shutdown the VM at the same time, only one thread
 405 //       can run before_exit() and all other threads must wait.
 406 void before_exit(JavaThread* thread) {
 407   #define BEFORE_EXIT_NOT_RUN 0
 408   #define BEFORE_EXIT_RUNNING 1
 409   #define BEFORE_EXIT_DONE    2
 410   static jint volatile _before_exit_status = BEFORE_EXIT_NOT_RUN;
 411 
 412   // Note: don't use a Mutex to guard the entire before_exit(), as
 413   // JVMTI post_thread_end_event and post_vm_death_event will run native code.
 414   // A CAS or OSMutex would work just fine but then we need to manipulate
 415   // thread state for Safepoint. Here we use Monitor wait() and notify_all()
 416   // for synchronization.
 417   { MutexLocker ml(BeforeExit_lock);
 418     switch (_before_exit_status) {




 339     alloc_stats.print();
 340     tty->cr();
 341   }
 342 
 343   if (PrintSystemDictionaryAtExit) {
 344     SystemDictionary::print();
 345   }
 346 
 347   if (LogTouchedMethods && PrintTouchedMethodsAtExit) {
 348     Method::print_touched_methods(tty);
 349   }
 350 
 351   if (PrintBiasedLockingStatistics) {
 352     BiasedLocking::print_counters();
 353   }
 354 
 355   // Native memory tracking data
 356   if (PrintNMTStatistics) {
 357     MemTracker::final_report(tty);
 358   }
 359 
 360   Threads::log_smr_statistics();
 361 }
 362 
 363 #else // PRODUCT MODE STATISTICS
 364 
 365 void print_statistics() {
 366 
 367   if (PrintMethodData) {
 368     print_method_profiling_data();
 369   }
 370 
 371   if (CITime) {
 372     CompileBroker::print_times();
 373   }
 374 
 375   if (PrintCodeCache) {
 376     MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
 377     CodeCache::print();
 378   }
 379 
 380   if (PrintMethodFlushingStatistics) {
 381     NMethodSweeper::print();
 382   }
 383 
 384 #ifdef COMPILER2
 385   if (PrintPreciseBiasedLockingStatistics || PrintPreciseRTMLockingStatistics) {
 386     OptoRuntime::print_named_counters();
 387   }
 388 #endif
 389   if (PrintBiasedLockingStatistics) {
 390     BiasedLocking::print_counters();
 391   }
 392 
 393   // Native memory tracking data
 394   if (PrintNMTStatistics) {
 395     MemTracker::final_report(tty);
 396   }
 397 
 398   if (LogTouchedMethods && PrintTouchedMethodsAtExit) {
 399     Method::print_touched_methods(tty);
 400   }
 401 
 402   Threads::log_smr_statistics();
 403 }
 404 
 405 #endif
 406 
 407 // Note: before_exit() can be executed only once, if more than one threads
 408 //       are trying to shutdown the VM at the same time, only one thread
 409 //       can run before_exit() and all other threads must wait.
 410 void before_exit(JavaThread* thread) {
 411   #define BEFORE_EXIT_NOT_RUN 0
 412   #define BEFORE_EXIT_RUNNING 1
 413   #define BEFORE_EXIT_DONE    2
 414   static jint volatile _before_exit_status = BEFORE_EXIT_NOT_RUN;
 415 
 416   // Note: don't use a Mutex to guard the entire before_exit(), as
 417   // JVMTI post_thread_end_event and post_vm_death_event will run native code.
 418   // A CAS or OSMutex would work just fine but then we need to manipulate
 419   // thread state for Safepoint. Here we use Monitor wait() and notify_all()
 420   // for synchronization.
 421   { MutexLocker ml(BeforeExit_lock);
 422     switch (_before_exit_status) {


< prev index next >