comparison src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.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 55fb97c4c58d
children 52b4284cb496
comparison
equal deleted inserted replaced
17935:7384f6a12fc1 17937:78bbf4d43a14
1 /* 1 /*
2 * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2003, 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.
110 // for reasons the "increment" fraction is used. 110 // for reasons the "increment" fraction is used.
111 PSAdaptiveSizePolicy* policy = heap->size_policy(); 111 PSAdaptiveSizePolicy* policy = heap->size_policy();
112 size_t result = policy->eden_increment_aligned_down(max_contraction); 112 size_t result = policy->eden_increment_aligned_down(max_contraction);
113 size_t result_aligned = align_size_down(result, gen_alignment); 113 size_t result_aligned = align_size_down(result, gen_alignment);
114 if (PrintAdaptiveSizePolicy && Verbose) { 114 if (PrintAdaptiveSizePolicy && Verbose) {
115 gclog_or_tty->print_cr("ASPSYoungGen::available_for_contraction: %d K", 115 gclog_or_tty->print_cr("ASPSYoungGen::available_for_contraction: " SIZE_FORMAT " K",
116 result_aligned/K); 116 result_aligned/K);
117 gclog_or_tty->print_cr(" max_contraction %d K", max_contraction/K); 117 gclog_or_tty->print_cr(" max_contraction " SIZE_FORMAT " K", max_contraction/K);
118 gclog_or_tty->print_cr(" eden_avail %d K", eden_avail/K); 118 gclog_or_tty->print_cr(" eden_avail " SIZE_FORMAT " K", eden_avail/K);
119 gclog_or_tty->print_cr(" gen_avail %d K", gen_avail/K); 119 gclog_or_tty->print_cr(" gen_avail " SIZE_FORMAT " K", gen_avail/K);
120 } 120 }
121 return result_aligned; 121 return result_aligned;
122 } 122 }
123 123
124 return 0; 124 return 0;
250 SIZE_FORMAT 250 SIZE_FORMAT
251 ", requested_survivor_size: " SIZE_FORMAT ")", 251 ", requested_survivor_size: " SIZE_FORMAT ")",
252 requested_eden_size, requested_survivor_size); 252 requested_eden_size, requested_survivor_size);
253 gclog_or_tty->print_cr(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") " 253 gclog_or_tty->print_cr(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") "
254 SIZE_FORMAT, 254 SIZE_FORMAT,
255 eden_space()->bottom(), 255 p2i(eden_space()->bottom()),
256 eden_space()->end(), 256 p2i(eden_space()->end()),
257 pointer_delta(eden_space()->end(), 257 pointer_delta(eden_space()->end(),
258 eden_space()->bottom(), 258 eden_space()->bottom(),
259 sizeof(char))); 259 sizeof(char)));
260 gclog_or_tty->print_cr(" from: [" PTR_FORMAT ".." PTR_FORMAT ") " 260 gclog_or_tty->print_cr(" from: [" PTR_FORMAT ".." PTR_FORMAT ") "
261 SIZE_FORMAT, 261 SIZE_FORMAT,
262 from_space()->bottom(), 262 p2i(from_space()->bottom()),
263 from_space()->end(), 263 p2i(from_space()->end()),
264 pointer_delta(from_space()->end(), 264 pointer_delta(from_space()->end(),
265 from_space()->bottom(), 265 from_space()->bottom(),
266 sizeof(char))); 266 sizeof(char)));
267 gclog_or_tty->print_cr(" to: [" PTR_FORMAT ".." PTR_FORMAT ") " 267 gclog_or_tty->print_cr(" to: [" PTR_FORMAT ".." PTR_FORMAT ") "
268 SIZE_FORMAT, 268 SIZE_FORMAT,
269 to_space()->bottom(), 269 p2i(to_space()->bottom()),
270 to_space()->end(), 270 p2i(to_space()->end()),
271 pointer_delta( to_space()->end(), 271 pointer_delta( to_space()->end(),
272 to_space()->bottom(), 272 to_space()->bottom(),
273 sizeof(char))); 273 sizeof(char)));
274 } 274 }
275 275
371 guarantee(to_start != to_end, "to space is zero sized"); 371 guarantee(to_start != to_end, "to space is zero sized");
372 372
373 if (PrintAdaptiveSizePolicy && Verbose) { 373 if (PrintAdaptiveSizePolicy && Verbose) {
374 gclog_or_tty->print_cr(" [eden_start .. eden_end): " 374 gclog_or_tty->print_cr(" [eden_start .. eden_end): "
375 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, 375 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
376 eden_start, 376 p2i(eden_start),
377 eden_end, 377 p2i(eden_end),
378 pointer_delta(eden_end, eden_start, sizeof(char))); 378 pointer_delta(eden_end, eden_start, sizeof(char)));
379 gclog_or_tty->print_cr(" [from_start .. from_end): " 379 gclog_or_tty->print_cr(" [from_start .. from_end): "
380 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, 380 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
381 from_start, 381 p2i(from_start),
382 from_end, 382 p2i(from_end),
383 pointer_delta(from_end, from_start, sizeof(char))); 383 pointer_delta(from_end, from_start, sizeof(char)));
384 gclog_or_tty->print_cr(" [ to_start .. to_end): " 384 gclog_or_tty->print_cr(" [ to_start .. to_end): "
385 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, 385 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
386 to_start, 386 p2i(to_start),
387 to_end, 387 p2i(to_end),
388 pointer_delta( to_end, to_start, sizeof(char))); 388 pointer_delta( to_end, to_start, sizeof(char)));
389 } 389 }
390 } else { 390 } else {
391 // Eden, to, from 391 // Eden, to, from
392 if (PrintAdaptiveSizePolicy && Verbose) { 392 if (PrintAdaptiveSizePolicy && Verbose) {
425 to_start = MAX2(to_start, eden_end); 425 to_start = MAX2(to_start, eden_end);
426 426
427 if (PrintAdaptiveSizePolicy && Verbose) { 427 if (PrintAdaptiveSizePolicy && Verbose) {
428 gclog_or_tty->print_cr(" [eden_start .. eden_end): " 428 gclog_or_tty->print_cr(" [eden_start .. eden_end): "
429 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, 429 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
430 eden_start, 430 p2i(eden_start),
431 eden_end, 431 p2i(eden_end),
432 pointer_delta(eden_end, eden_start, sizeof(char))); 432 pointer_delta(eden_end, eden_start, sizeof(char)));
433 gclog_or_tty->print_cr(" [ to_start .. to_end): " 433 gclog_or_tty->print_cr(" [ to_start .. to_end): "
434 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, 434 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
435 to_start, 435 p2i(to_start),
436 to_end, 436 p2i(to_end),
437 pointer_delta( to_end, to_start, sizeof(char))); 437 pointer_delta( to_end, to_start, sizeof(char)));
438 gclog_or_tty->print_cr(" [from_start .. from_end): " 438 gclog_or_tty->print_cr(" [from_start .. from_end): "
439 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, 439 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
440 from_start, 440 p2i(from_start),
441 from_end, 441 p2i(from_end),
442 pointer_delta(from_end, from_start, sizeof(char))); 442 pointer_delta(from_end, from_start, sizeof(char)));
443 } 443 }
444 } 444 }
445 445
446 446