Mercurial > hg > truffle
diff src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.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 | bbfbe9b06038 |
children | 52b4284cb496 ce8f6bb717c9 6e56d7f1634f |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Thu May 15 18:23:26 2014 -0400 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Thu May 22 15:52:41 2014 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -427,7 +427,7 @@ void LinearAllocBlock::print_on(outputStream* st) const { st->print_cr(" LinearAllocBlock: ptr = " PTR_FORMAT ", word_size = " SIZE_FORMAT ", refillsize = " SIZE_FORMAT ", allocation_size_limit = " SIZE_FORMAT, - _ptr, _word_size, _refillSize, _allocation_size_limit); + p2i(_ptr), _word_size, _refillSize, _allocation_size_limit); } void CompactibleFreeListSpace::print_on(outputStream* st) const { @@ -458,7 +458,7 @@ for (FreeChunk* fc = _indexedFreeList[i].head(); fc != NULL; fc = fc->next()) { gclog_or_tty->print_cr("\t[" PTR_FORMAT "," PTR_FORMAT ") %s", - fc, (HeapWord*)fc + i, + p2i(fc), p2i((HeapWord*)fc + i), fc->cantCoalesce() ? "\t CC" : ""); } } @@ -502,7 +502,7 @@ if (_sp->block_is_obj(addr)) { const bool dead = _post_remark && !_live_bit_map->isMarked(addr); _st->print_cr(PTR_FORMAT ": %s object of size " SIZE_FORMAT "%s", - addr, + p2i(addr), dead ? "dead" : "live", sz, (!dead && CMSPrintObjectsInDump) ? ":" : "."); @@ -512,7 +512,7 @@ } } else { // free block _st->print_cr(PTR_FORMAT ": free block of size " SIZE_FORMAT "%s", - addr, sz, CMSPrintChunksInDump ? ":" : "."); + p2i(addr), sz, CMSPrintChunksInDump ? ":" : "."); if (CMSPrintChunksInDump) { ((FreeChunk*)addr)->print_on(_st); _st->print_cr("--------------------------------------"); @@ -564,11 +564,11 @@ "--------------------------------\n"); size_t total_size = totalSizeInIndexedFreeLists(); size_t free_blocks = numFreeBlocksInIndexedFreeLists(); - gclog_or_tty->print("Total Free Space: %d\n", total_size); - gclog_or_tty->print("Max Chunk Size: %d\n", maxChunkSizeInIndexedFreeLists()); - gclog_or_tty->print("Number of Blocks: %d\n", free_blocks); + gclog_or_tty->print("Total Free Space: " SIZE_FORMAT "\n", total_size); + gclog_or_tty->print("Max Chunk Size: " SIZE_FORMAT "\n", maxChunkSizeInIndexedFreeLists()); + gclog_or_tty->print("Number of Blocks: " SIZE_FORMAT "\n", free_blocks); if (free_blocks != 0) { - gclog_or_tty->print("Av. Block Size: %d\n", total_size/free_blocks); + gclog_or_tty->print("Av. Block Size: " SIZE_FORMAT "\n", total_size/free_blocks); } } @@ -2011,7 +2011,7 @@ assert(ur.contains(urasm), err_msg(" Error at save_marks(): [" PTR_FORMAT "," PTR_FORMAT ")" " should contain [" PTR_FORMAT "," PTR_FORMAT ")", - ur.start(), ur.end(), urasm.start(), urasm.end())); + p2i(ur.start()), p2i(ur.end()), p2i(urasm.start()), p2i(urasm.end()))); #endif // inform allocator that promotions should be tracked. assert(_promoInfo.noPromotions(), "_promoInfo inconsistency"); @@ -2181,7 +2181,7 @@ for (i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) { AdaptiveFreeList<FreeChunk>* fl = &_indexedFreeList[i]; if (PrintFLSStatistics > 1) { - gclog_or_tty->print("size[%d] : ", i); + gclog_or_tty->print("size[" SIZE_FORMAT "] : ", i); } fl->compute_desired(inter_sweep_current, inter_sweep_estimate, intra_sweep_estimate); fl->set_coal_desired((ssize_t)((double)fl->desired() * CMSSmallCoalSurplusPercent)); @@ -2234,7 +2234,7 @@ if (PrintFLSStatistics > 0) { HeapWord* largestAddr = (HeapWord*) dictionary()->find_largest_dict(); gclog_or_tty->print_cr("CMS: Large block " PTR_FORMAT, - largestAddr); + p2i(largestAddr)); } setFLSurplus(); setFLHints(); @@ -2383,8 +2383,8 @@ gclog_or_tty->print_cr( " Current: addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n" " Previous: addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n", - addr, res, was_obj ?"true":"false", was_live ?"true":"false", - _last_addr, _last_size, _last_was_obj?"true":"false", _last_was_live?"true":"false"); + p2i(addr), res, was_obj ?"true":"false", was_live ?"true":"false", + p2i(_last_addr), _last_size, _last_was_obj?"true":"false", _last_was_live?"true":"false"); _sp->print_on(gclog_or_tty); guarantee(false, "Seppuku!"); } @@ -2712,7 +2712,7 @@ _global_num_workers[i] = 0; _global_num_blocks[i] = 0; if (PrintOldPLAB) { - gclog_or_tty->print_cr("[%d]: %d", i, (size_t)_blocks_to_claim[i].average()); + gclog_or_tty->print_cr("[" SIZE_FORMAT "]: " SIZE_FORMAT, i, (size_t)_blocks_to_claim[i].average()); } } } @@ -2751,7 +2751,7 @@ } } if (PrintOldPLAB) { - gclog_or_tty->print_cr("%d[%d]: %d/%d/%d", + gclog_or_tty->print_cr("%d[" SIZE_FORMAT "]: " SIZE_FORMAT "/" SIZE_FORMAT "/" SIZE_FORMAT, tid, i, num_retire, _num_blocks[i], (size_t)_blocks_to_claim[i].average()); } // Reset stats for next round