comparison src/share/vm/runtime/safepoint.cpp @ 18041:52b4284cb496

Merge with jdk8u20-b26
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 15 Oct 2014 16:02:50 +0200
parents 66e3af78ea96 78bbf4d43a14
children 8f2fb6bec986
comparison
equal deleted inserted replaced
17606:45d7b2c7029d 18041:52b4284cb496
1 /* 1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
80 #endif // INCLUDE_ALL_GCS 80 #endif // INCLUDE_ALL_GCS
81 #ifdef COMPILER1 81 #ifdef COMPILER1
82 #include "c1/c1_globals.hpp" 82 #include "c1/c1_globals.hpp"
83 #endif 83 #endif
84 84
85 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
86
85 // -------------------------------------------------------------------------------------------------- 87 // --------------------------------------------------------------------------------------------------
86 // Implementation of Safepoint begin/end 88 // Implementation of Safepoint begin/end
87 89
88 SafepointSynchronize::SynchronizeState volatile SafepointSynchronize::_state = SafepointSynchronize::_not_synchronized; 90 SafepointSynchronize::SynchronizeState volatile SafepointSynchronize::_state = SafepointSynchronize::_not_synchronized;
89 volatile int SafepointSynchronize::_waiting_to_block = 0; 91 volatile int SafepointSynchronize::_waiting_to_block = 0;
546 StringTable::rehash_table(); 548 StringTable::rehash_table();
547 } 549 }
548 550
549 // rotate log files? 551 // rotate log files?
550 if (UseGCLogFileRotation) { 552 if (UseGCLogFileRotation) {
551 gclog_or_tty->rotate_log(); 553 gclog_or_tty->rotate_log(false);
554 }
555
556 {
557 // CMS delays purging the CLDG until the beginning of the next safepoint and to
558 // make sure concurrent sweep is done
559 TraceTime t7("purging class loader data graph", TraceSafepointCleanupTime);
560 ClassLoaderDataGraph::purge_if_needed();
552 } 561 }
553 562
554 if (MemTracker::is_on()) { 563 if (MemTracker::is_on()) {
555 MemTracker::sync(); 564 MemTracker::sync();
556 } 565 }
797 tty->print_cr("--Float-|"PTR_FORMAT,new_sp); 806 tty->print_cr("--Float-|"PTR_FORMAT,new_sp);
798 tty->print_cr("---FP---|"); 807 tty->print_cr("---FP---|");
799 old_sp += incr*32; new_sp += incr*32; was_oops += incr*32; 808 old_sp += incr*32; new_sp += incr*32; was_oops += incr*32;
800 for( int i2=0; i2<16; i2++ ) { 809 for( int i2=0; i2<16; i2++ ) {
801 tty->print("call %c%d |"PTR_FORMAT" ","LI"[i2>>3],i2&7,new_sp); print_ptrs(*old_sp++,*new_sp++,*was_oops++); } 810 tty->print("call %c%d |"PTR_FORMAT" ","LI"[i2>>3],i2&7,new_sp); print_ptrs(*old_sp++,*new_sp++,*was_oops++); }
802 tty->print_cr(""); 811 tty->cr();
803 } 812 }
804 #endif // SPARC 813 #endif // SPARC
805 #endif // PRODUCT 814 #endif // PRODUCT
806 815
807 816
839 void SafepointSynchronize::print_safepoint_timeout(SafepointTimeoutReason reason) { 848 void SafepointSynchronize::print_safepoint_timeout(SafepointTimeoutReason reason) {
840 if (!timeout_error_printed) { 849 if (!timeout_error_printed) {
841 timeout_error_printed = true; 850 timeout_error_printed = true;
842 // Print out the thread infor which didn't reach the safepoint for debugging 851 // Print out the thread infor which didn't reach the safepoint for debugging
843 // purposes (useful when there are lots of threads in the debugger). 852 // purposes (useful when there are lots of threads in the debugger).
844 tty->print_cr(""); 853 tty->cr();
845 tty->print_cr("# SafepointSynchronize::begin: Timeout detected:"); 854 tty->print_cr("# SafepointSynchronize::begin: Timeout detected:");
846 if (reason == _spinning_timeout) { 855 if (reason == _spinning_timeout) {
847 tty->print_cr("# SafepointSynchronize::begin: Timed out while spinning to reach a safepoint."); 856 tty->print_cr("# SafepointSynchronize::begin: Timed out while spinning to reach a safepoint.");
848 } else if (reason == _blocking_timeout) { 857 } else if (reason == _blocking_timeout) {
849 tty->print_cr("# SafepointSynchronize::begin: Timed out while waiting for threads to stop."); 858 tty->print_cr("# SafepointSynchronize::begin: Timed out while waiting for threads to stop.");
859 if (cur_thread->thread_state() != _thread_blocked && 868 if (cur_thread->thread_state() != _thread_blocked &&
860 ((reason == _spinning_timeout && cur_state->is_running()) || 869 ((reason == _spinning_timeout && cur_state->is_running()) ||
861 (reason == _blocking_timeout && !cur_state->has_called_back()))) { 870 (reason == _blocking_timeout && !cur_state->has_called_back()))) {
862 tty->print("# "); 871 tty->print("# ");
863 cur_thread->print(); 872 cur_thread->print();
864 tty->print_cr(""); 873 tty->cr();
865 } 874 }
866 } 875 }
867 tty->print_cr("# SafepointSynchronize::begin: (End of list)"); 876 tty->print_cr("# SafepointSynchronize::begin: (End of list)");
868 } 877 }
869 878
1332 1341
1333 if ( PrintSafepointStatisticsTimeout < 0 || 1342 if ( PrintSafepointStatisticsTimeout < 0 ||
1334 spstat->_time_to_sync > PrintSafepointStatisticsTimeout * MICROUNITS) { 1343 spstat->_time_to_sync > PrintSafepointStatisticsTimeout * MICROUNITS) {
1335 print_statistics(); 1344 print_statistics();
1336 } 1345 }
1337 tty->print_cr(""); 1346 tty->cr();
1338 1347
1339 // Print out polling page sampling status. 1348 // Print out polling page sampling status.
1340 if (!need_to_track_page_armed_status) { 1349 if (!need_to_track_page_armed_status) {
1341 if (UseCompilerSafepoints) { 1350 if (UseCompilerSafepoints) {
1342 tty->print_cr("Polling page always armed"); 1351 tty->print_cr("Polling page always armed");