comparison src/share/vm/runtime/safepoint.cpp @ 17937:78bbf4d43a14

8037816: Fix for 8036122 breaks build with Xcode5/clang 8043029: Change 8037816 breaks HS build with older GCC versions which don't support diagnostic pragmas 8043164: Format warning in traceStream.hpp Summary: Backport of main fix + two corrections, enables clang compilation, turns on format attributes, corrects/mutes warnings Reviewed-by: kvn, coleenp, iveresov, twisti
author drchase
date Thu, 22 May 2014 15:52:41 -0400
parents 7384f6a12fc1
children 52b4284cb496 581e70386ec9
comparison
equal deleted inserted replaced
17935:7384f6a12fc1 17937:78bbf4d43a14
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.
79 #endif // INCLUDE_ALL_GCS 79 #endif // INCLUDE_ALL_GCS
80 #ifdef COMPILER1 80 #ifdef COMPILER1
81 #include "c1/c1_globals.hpp" 81 #include "c1/c1_globals.hpp"
82 #endif 82 #endif
83 83
84 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
85
84 // -------------------------------------------------------------------------------------------------- 86 // --------------------------------------------------------------------------------------------------
85 // Implementation of Safepoint begin/end 87 // Implementation of Safepoint begin/end
86 88
87 SafepointSynchronize::SynchronizeState volatile SafepointSynchronize::_state = SafepointSynchronize::_not_synchronized; 89 SafepointSynchronize::SynchronizeState volatile SafepointSynchronize::_state = SafepointSynchronize::_not_synchronized;
88 volatile int SafepointSynchronize::_waiting_to_block = 0; 90 volatile int SafepointSynchronize::_waiting_to_block = 0;
791 tty->print_cr("--Float-|"PTR_FORMAT,new_sp); 793 tty->print_cr("--Float-|"PTR_FORMAT,new_sp);
792 tty->print_cr("---FP---|"); 794 tty->print_cr("---FP---|");
793 old_sp += incr*32; new_sp += incr*32; was_oops += incr*32; 795 old_sp += incr*32; new_sp += incr*32; was_oops += incr*32;
794 for( int i2=0; i2<16; i2++ ) { 796 for( int i2=0; i2<16; i2++ ) {
795 tty->print("call %c%d |"PTR_FORMAT" ","LI"[i2>>3],i2&7,new_sp); print_ptrs(*old_sp++,*new_sp++,*was_oops++); } 797 tty->print("call %c%d |"PTR_FORMAT" ","LI"[i2>>3],i2&7,new_sp); print_ptrs(*old_sp++,*new_sp++,*was_oops++); }
796 tty->print_cr(""); 798 tty->cr();
797 } 799 }
798 #endif // SPARC 800 #endif // SPARC
799 #endif // PRODUCT 801 #endif // PRODUCT
800 802
801 803
833 void SafepointSynchronize::print_safepoint_timeout(SafepointTimeoutReason reason) { 835 void SafepointSynchronize::print_safepoint_timeout(SafepointTimeoutReason reason) {
834 if (!timeout_error_printed) { 836 if (!timeout_error_printed) {
835 timeout_error_printed = true; 837 timeout_error_printed = true;
836 // Print out the thread infor which didn't reach the safepoint for debugging 838 // Print out the thread infor which didn't reach the safepoint for debugging
837 // purposes (useful when there are lots of threads in the debugger). 839 // purposes (useful when there are lots of threads in the debugger).
838 tty->print_cr(""); 840 tty->cr();
839 tty->print_cr("# SafepointSynchronize::begin: Timeout detected:"); 841 tty->print_cr("# SafepointSynchronize::begin: Timeout detected:");
840 if (reason == _spinning_timeout) { 842 if (reason == _spinning_timeout) {
841 tty->print_cr("# SafepointSynchronize::begin: Timed out while spinning to reach a safepoint."); 843 tty->print_cr("# SafepointSynchronize::begin: Timed out while spinning to reach a safepoint.");
842 } else if (reason == _blocking_timeout) { 844 } else if (reason == _blocking_timeout) {
843 tty->print_cr("# SafepointSynchronize::begin: Timed out while waiting for threads to stop."); 845 tty->print_cr("# SafepointSynchronize::begin: Timed out while waiting for threads to stop.");
853 if (cur_thread->thread_state() != _thread_blocked && 855 if (cur_thread->thread_state() != _thread_blocked &&
854 ((reason == _spinning_timeout && cur_state->is_running()) || 856 ((reason == _spinning_timeout && cur_state->is_running()) ||
855 (reason == _blocking_timeout && !cur_state->has_called_back()))) { 857 (reason == _blocking_timeout && !cur_state->has_called_back()))) {
856 tty->print("# "); 858 tty->print("# ");
857 cur_thread->print(); 859 cur_thread->print();
858 tty->print_cr(""); 860 tty->cr();
859 } 861 }
860 } 862 }
861 tty->print_cr("# SafepointSynchronize::begin: (End of list)"); 863 tty->print_cr("# SafepointSynchronize::begin: (End of list)");
862 } 864 }
863 865
1326 1328
1327 if ( PrintSafepointStatisticsTimeout < 0 || 1329 if ( PrintSafepointStatisticsTimeout < 0 ||
1328 spstat->_time_to_sync > PrintSafepointStatisticsTimeout * MICROUNITS) { 1330 spstat->_time_to_sync > PrintSafepointStatisticsTimeout * MICROUNITS) {
1329 print_statistics(); 1331 print_statistics();
1330 } 1332 }
1331 tty->print_cr(""); 1333 tty->cr();
1332 1334
1333 // Print out polling page sampling status. 1335 // Print out polling page sampling status.
1334 if (!need_to_track_page_armed_status) { 1336 if (!need_to_track_page_armed_status) {
1335 if (UseCompilerSafepoints) { 1337 if (UseCompilerSafepoints) {
1336 tty->print_cr("Polling page always armed"); 1338 tty->print_cr("Polling page always armed");