comparison src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.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 8e20ef014b08
comparison
equal deleted inserted replaced
17935:7384f6a12fc1 17937:78bbf4d43a14
1 /* 1 /*
2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2001, 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.
60 #include "runtime/handles.inline.hpp" 60 #include "runtime/handles.inline.hpp"
61 #include "runtime/java.hpp" 61 #include "runtime/java.hpp"
62 #include "runtime/vmThread.hpp" 62 #include "runtime/vmThread.hpp"
63 #include "services/memoryService.hpp" 63 #include "services/memoryService.hpp"
64 #include "services/runtimeService.hpp" 64 #include "services/runtimeService.hpp"
65
66 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
65 67
66 // statics 68 // statics
67 CMSCollector* ConcurrentMarkSweepGeneration::_collector = NULL; 69 CMSCollector* ConcurrentMarkSweepGeneration::_collector = NULL;
68 bool CMSCollector::_full_gc_requested = false; 70 bool CMSCollector::_full_gc_requested = false;
69 GCCause::Cause CMSCollector::_full_gc_cause = GCCause::_no_gc; 71 GCCause::Cause CMSCollector::_full_gc_cause = GCCause::_no_gc;
1179 1181
1180 if (CMSTraceIncrementalMode) { 1182 if (CMSTraceIncrementalMode) {
1181 gclog_or_tty->print(" icms alloc limits: " 1183 gclog_or_tty->print(" icms alloc limits: "
1182 PTR_FORMAT "," PTR_FORMAT 1184 PTR_FORMAT "," PTR_FORMAT
1183 " (" SIZE_FORMAT "%%," SIZE_FORMAT "%%) ", 1185 " (" SIZE_FORMAT "%%," SIZE_FORMAT "%%) ",
1184 _icms_start_limit, _icms_stop_limit, 1186 p2i(_icms_start_limit), p2i(_icms_stop_limit),
1185 percent_of_space(eden, _icms_start_limit), 1187 percent_of_space(eden, _icms_start_limit),
1186 percent_of_space(eden, _icms_stop_limit)); 1188 percent_of_space(eden, _icms_stop_limit));
1187 if (Verbose) { 1189 if (Verbose) {
1188 gclog_or_tty->print("eden: "); 1190 gclog_or_tty->print("eden: ");
1189 eden->print_on(gclog_or_tty); 1191 eden->print_on(gclog_or_tty);
1207 space->print_on(gclog_or_tty); 1209 space->print_on(gclog_or_tty);
1208 gclog_or_tty->stamp(); 1210 gclog_or_tty->stamp();
1209 gclog_or_tty->print_cr(" start limit top=" PTR_FORMAT 1211 gclog_or_tty->print_cr(" start limit top=" PTR_FORMAT
1210 ", new limit=" PTR_FORMAT 1212 ", new limit=" PTR_FORMAT
1211 " (" SIZE_FORMAT "%%)", 1213 " (" SIZE_FORMAT "%%)",
1212 top, _icms_stop_limit, 1214 p2i(top), p2i(_icms_stop_limit),
1213 percent_of_space(space, _icms_stop_limit)); 1215 percent_of_space(space, _icms_stop_limit));
1214 } 1216 }
1215 ConcurrentMarkSweepThread::start_icms(); 1217 ConcurrentMarkSweepThread::start_icms();
1216 assert(top < _icms_stop_limit, "Tautology"); 1218 assert(top < _icms_stop_limit, "Tautology");
1217 if (word_size < pointer_delta(_icms_stop_limit, top)) { 1219 if (word_size < pointer_delta(_icms_stop_limit, top)) {
1224 space->print_on(gclog_or_tty); 1226 space->print_on(gclog_or_tty);
1225 gclog_or_tty->stamp(); 1227 gclog_or_tty->stamp();
1226 gclog_or_tty->print_cr(" +stop limit top=" PTR_FORMAT 1228 gclog_or_tty->print_cr(" +stop limit top=" PTR_FORMAT
1227 ", new limit=" PTR_FORMAT 1229 ", new limit=" PTR_FORMAT
1228 " (" SIZE_FORMAT "%%)", 1230 " (" SIZE_FORMAT "%%)",
1229 top, space->end(), 1231 p2i(top), p2i(space->end()),
1230 percent_of_space(space, space->end())); 1232 percent_of_space(space, space->end()));
1231 } 1233 }
1232 ConcurrentMarkSweepThread::stop_icms(); 1234 ConcurrentMarkSweepThread::stop_icms();
1233 return space->end(); 1235 return space->end();
1234 } 1236 }
1499 // Print out lots of information which affects the initiation of 1501 // Print out lots of information which affects the initiation of
1500 // a collection. 1502 // a collection.
1501 if (PrintCMSInitiationStatistics && stats().valid()) { 1503 if (PrintCMSInitiationStatistics && stats().valid()) {
1502 gclog_or_tty->print("CMSCollector shouldConcurrentCollect: "); 1504 gclog_or_tty->print("CMSCollector shouldConcurrentCollect: ");
1503 gclog_or_tty->stamp(); 1505 gclog_or_tty->stamp();
1504 gclog_or_tty->print_cr(""); 1506 gclog_or_tty->cr();
1505 stats().print_on(gclog_or_tty); 1507 stats().print_on(gclog_or_tty);
1506 gclog_or_tty->print_cr("time_until_cms_gen_full %3.7f", 1508 gclog_or_tty->print_cr("time_until_cms_gen_full %3.7f",
1507 stats().time_until_cms_gen_full()); 1509 stats().time_until_cms_gen_full());
1508 gclog_or_tty->print_cr("free="SIZE_FORMAT, _cmsGen->free()); 1510 gclog_or_tty->print_cr("free="SIZE_FORMAT, _cmsGen->free());
1509 gclog_or_tty->print_cr("contiguous_available="SIZE_FORMAT, 1511 gclog_or_tty->print_cr("contiguous_available="SIZE_FORMAT,
3575 gclog_or_tty->stamp(PrintGCTimeStamps); 3577 gclog_or_tty->stamp(PrintGCTimeStamps);
3576 gclog_or_tty->print("[%s-concurrent-%s: %3.3f/%3.3f secs]", 3578 gclog_or_tty->print("[%s-concurrent-%s: %3.3f/%3.3f secs]",
3577 _collector->cmsGen()->short_name(), 3579 _collector->cmsGen()->short_name(),
3578 _phase, _collector->timerValue(), _wallclock.seconds()); 3580 _phase, _collector->timerValue(), _wallclock.seconds());
3579 if (_print_cr) { 3581 if (_print_cr) {
3580 gclog_or_tty->print_cr(""); 3582 gclog_or_tty->cr();
3581 } 3583 }
3582 if (PrintCMSStatistics != 0) { 3584 if (PrintCMSStatistics != 0) {
3583 gclog_or_tty->print_cr(" (CMS-concurrent-%s yielded %d times)", _phase, 3585 gclog_or_tty->print_cr(" (CMS-concurrent-%s yielded %d times)", _phase,
3584 _collector->yields()); 3586 _collector->yields());
3585 } 3587 }