--- old/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp 2015-03-26 13:32:02.506076396 +0100 +++ new/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp 2015-03-26 13:32:02.299068568 +0100 @@ -65,8 +65,6 @@ #include "services/memoryService.hpp" #include "services/runtimeService.hpp" -PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC - // statics CMSCollector* ConcurrentMarkSweepGeneration::_collector = NULL; bool CMSCollector::_full_gc_requested = false; @@ -1593,7 +1591,7 @@ bitMapLock()->lock_without_safepoint_check(); if (TraceCMSState) { gclog_or_tty->print_cr("CMS foreground collector has asked for control " - INTPTR_FORMAT " with first state %d", Thread::current(), first_state); + INTPTR_FORMAT " with first state %d", p2i(Thread::current()), first_state); gclog_or_tty->print_cr(" gets control with state %d", _collectorState); } @@ -1763,27 +1761,27 @@ // Eden if (_eden_chunk_array != NULL) { gclog_or_tty->print_cr("eden " PTR_FORMAT "-" PTR_FORMAT "-" PTR_FORMAT "(" SIZE_FORMAT ")", - eden_space->bottom(), eden_space->top(), - eden_space->end(), eden_space->capacity()); + p2i(eden_space->bottom()), p2i(eden_space->top()), + p2i(eden_space->end()), eden_space->capacity()); gclog_or_tty->print_cr("_eden_chunk_index=" SIZE_FORMAT ", " "_eden_chunk_capacity=" SIZE_FORMAT, _eden_chunk_index, _eden_chunk_capacity); for (size_t i = 0; i < _eden_chunk_index; i++) { gclog_or_tty->print_cr("_eden_chunk_array[" SIZE_FORMAT "]=" PTR_FORMAT, - i, _eden_chunk_array[i]); + i, p2i(_eden_chunk_array[i])); } } // Survivor if (_survivor_chunk_array != NULL) { gclog_or_tty->print_cr("survivor " PTR_FORMAT "-" PTR_FORMAT "-" PTR_FORMAT "(" SIZE_FORMAT ")", - from_space->bottom(), from_space->top(), - from_space->end(), from_space->capacity()); + p2i(from_space->bottom()), p2i(from_space->top()), + p2i(from_space->end()), from_space->capacity()); gclog_or_tty->print_cr("_survivor_chunk_index=" SIZE_FORMAT ", " "_survivor_chunk_capacity=" SIZE_FORMAT, _survivor_chunk_index, _survivor_chunk_capacity); for (size_t i = 0; i < _survivor_chunk_index; i++) { gclog_or_tty->print_cr("_survivor_chunk_array[" SIZE_FORMAT "]=" PTR_FORMAT, - i, _survivor_chunk_array[i]); + i, p2i(_survivor_chunk_array[i])); } } } @@ -1890,7 +1888,7 @@ while (_collectorState != Idling) { if (TraceCMSState) { gclog_or_tty->print_cr("Thread " INTPTR_FORMAT " in CMS state %d", - Thread::current(), _collectorState); + p2i(Thread::current()), _collectorState); } // The foreground collector // holds the Heap_lock throughout its collection. @@ -1924,7 +1922,7 @@ if (TraceCMSState) { gclog_or_tty->print_cr("CMS Thread " INTPTR_FORMAT " exiting collection CMS state %d", - Thread::current(), _collectorState); + p2i(Thread::current()), _collectorState); } return; } else { @@ -2031,7 +2029,7 @@ } if (TraceCMSState) { gclog_or_tty->print_cr(" Thread " INTPTR_FORMAT " done - next CMS state %d", - Thread::current(), _collectorState); + p2i(Thread::current()), _collectorState); } assert(_foregroundGCShouldWait, "block post-condition"); } @@ -2054,7 +2052,7 @@ if (TraceCMSState) { gclog_or_tty->print_cr("CMS Thread " INTPTR_FORMAT " exiting collection CMS state %d", - Thread::current(), _collectorState); + p2i(Thread::current()), _collectorState); } if (PrintGC && Verbose) { _cmsGen->print_heap_change(prev_used); @@ -2112,7 +2110,7 @@ CGC_lock->notify(); if (TraceCMSState) { gclog_or_tty->print_cr("CMS Thread " INTPTR_FORMAT " waiting at CMS state %d", - Thread::current(), _collectorState); + p2i(Thread::current()), _collectorState); } while (_foregroundGCIsActive) { CGC_lock->wait(Mutex::_no_safepoint_check_flag); @@ -2124,7 +2122,7 @@ } if (TraceCMSState) { gclog_or_tty->print_cr("CMS Thread " INTPTR_FORMAT " continuing at CMS state %d", - Thread::current(), _collectorState); + p2i(Thread::current()), _collectorState); } return res; } @@ -2356,13 +2354,13 @@ // Clear the marking bit map array before starting, but, just // for kicks, first report if the given address is already marked - gclog_or_tty->print_cr("Start: Address " PTR_FORMAT " is%s marked", addr, + gclog_or_tty->print_cr("Start: Address " PTR_FORMAT " is%s marked", p2i(addr), _markBitMap.isMarked(addr) ? "" : " not"); if (verify_after_remark()) { MutexLockerEx x(verification_mark_bm()->lock(), Mutex::_no_safepoint_check_flag); bool result = verification_mark_bm()->isMarked(addr); - gclog_or_tty->print_cr("TransitiveMark: Address " PTR_FORMAT " %s marked", addr, + gclog_or_tty->print_cr("TransitiveMark: Address " PTR_FORMAT " %s marked", p2i(addr), result ? "IS" : "is NOT"); return result; } else { @@ -2377,13 +2375,13 @@ CMSCollector* collector = ConcurrentMarkSweepGeneration::_collector; if (collector != NULL) { CMSBitMap* bitmap = &collector->_markBitMap; - st->print_cr("Marking Bits: (CMSBitMap*) " PTR_FORMAT, bitmap); + st->print_cr("Marking Bits: (CMSBitMap*) " PTR_FORMAT, p2i(bitmap)); bitmap->print_on_error(st, " Bits: "); st->cr(); CMSBitMap* mut_bitmap = &collector->_modUnionTable; - st->print_cr("Mod Union Table: (CMSBitMap*) " PTR_FORMAT, mut_bitmap); + st->print_cr("Mod Union Table: (CMSBitMap*) " PTR_FORMAT, p2i(mut_bitmap)); mut_bitmap->print_on_error(st, " Bits: "); } } @@ -2406,7 +2404,7 @@ HeapWord* addr = _marks->offsetToHeapWord(offset); if (!_marks->isMarked(addr)) { oop(addr)->print_on(gclog_or_tty); - gclog_or_tty->print_cr(" ("INTPTR_FORMAT" should have been marked)", addr); + gclog_or_tty->print_cr(" ("INTPTR_FORMAT" should have been marked)", p2i(addr)); _failed = true; } return true; @@ -2474,7 +2472,7 @@ // presumably, a mutation to A failed to be picked up by preclean/remark? verify_after_remark_work_2(); } else { - warning("Unrecognized value %d for CMSRemarkVerifyVariant", + warning("Unrecognized value " UINTX_FORMAT " for CMSRemarkVerifyVariant", CMSRemarkVerifyVariant); } if (!silent) gclog_or_tty->print(" done] "); @@ -5056,7 +5054,7 @@ for (size_t i = 0; i < total - 1; i++) { if (PrintCMSStatistics > 0) { gclog_or_tty->print(" (chunk" SIZE_FORMAT ":" INTPTR_FORMAT ") ", - i, _survivor_chunk_array[i]); + i, p2i(_survivor_chunk_array[i])); } assert(_survivor_chunk_array[i] < _survivor_chunk_array[i+1], "Not sorted"); @@ -5700,8 +5698,8 @@ gclog_or_tty->print_cr( "CMS: Large Block: " PTR_FORMAT ";" " Proximity: " PTR_FORMAT " -> " PTR_FORMAT, - largestAddr, - _cmsSpace->nearLargestChunk(), minAddr + nearLargestOffset); + p2i(largestAddr), + p2i(_cmsSpace->nearLargestChunk()), p2i(minAddr + nearLargestOffset)); } _cmsSpace->set_nearLargestChunk(minAddr + nearLargestOffset); } @@ -6184,7 +6182,7 @@ _verification_bm->mark(addr); if (!_cms_bm->isMarked(addr)) { oop(addr)->print(); - gclog_or_tty->print_cr(" (" INTPTR_FORMAT " should have been marked)", addr); + gclog_or_tty->print_cr(" (" INTPTR_FORMAT " should have been marked)", p2i(addr)); fatal("... aborting"); } } @@ -6979,7 +6977,7 @@ if (!_cms_bm->isMarked(addr)) { oop(addr)->print(); gclog_or_tty->print_cr(" (" INTPTR_FORMAT " should have been marked)", - addr); + p2i(addr)); fatal("... aborting"); } @@ -7375,16 +7373,16 @@ "sweep _limit out of bounds"); if (CMSTraceSweeper) { gclog_or_tty->print_cr("\n====================\nStarting new sweep with limit " PTR_FORMAT, - _limit); + p2i(_limit)); } } void SweepClosure::print_on(outputStream* st) const { tty->print_cr("_sp = [" PTR_FORMAT "," PTR_FORMAT ")", - _sp->bottom(), _sp->end()); - tty->print_cr("_limit = " PTR_FORMAT, _limit); - tty->print_cr("_freeFinger = " PTR_FORMAT, _freeFinger); - NOT_PRODUCT(tty->print_cr("_last_fc = " PTR_FORMAT, _last_fc);) + p2i(_sp->bottom()), p2i(_sp->end())); + tty->print_cr("_limit = " PTR_FORMAT, p2i(_limit)); + tty->print_cr("_freeFinger = " PTR_FORMAT, p2i(_freeFinger)); + NOT_PRODUCT(tty->print_cr("_last_fc = " PTR_FORMAT, p2i(_last_fc));) tty->print_cr("_inFreeRange = %d, _freeRangeInFreeLists = %d, _lastFreeRangeCoalesced = %d", _inFreeRange, _freeRangeInFreeLists, _lastFreeRangeCoalesced); } @@ -7428,7 +7426,7 @@ } if (CMSTraceSweeper) { gclog_or_tty->print_cr("end of sweep with _limit = " PTR_FORMAT "\n================", - _limit); + p2i(_limit)); } } #endif // PRODUCT @@ -7437,7 +7435,7 @@ bool freeRangeInFreeLists) { if (CMSTraceSweeper) { gclog_or_tty->print("---- Start free range at " PTR_FORMAT " with free block (%d)\n", - freeFinger, freeRangeInFreeLists); + p2i(freeFinger), freeRangeInFreeLists); } assert(!inFreeRange(), "Trampling existing free range"); set_inFreeRange(true); @@ -7501,14 +7499,14 @@ // coalesced chunk to the appropriate free list. if (inFreeRange()) { assert(freeFinger() >= _sp->bottom() && freeFinger() < _limit, - err_msg("freeFinger() " PTR_FORMAT" is out-of-bounds", freeFinger())); + err_msg("freeFinger() " PTR_FORMAT" is out-of-bounds", p2i(freeFinger()))); flush_cur_free_chunk(freeFinger(), pointer_delta(addr, freeFinger())); if (CMSTraceSweeper) { gclog_or_tty->print("Sweep: last chunk: "); gclog_or_tty->print("put_free_blk " PTR_FORMAT " ("SIZE_FORMAT") " "[coalesced:%d]\n", - freeFinger(), pointer_delta(addr, freeFinger()), + p2i(freeFinger()), pointer_delta(addr, freeFinger()), lastFreeRangeCoalesced() ? 1 : 0); } } @@ -7652,7 +7650,7 @@ // the midst of a free range, we are coalescing print_free_block_coalesced(fc); if (CMSTraceSweeper) { - gclog_or_tty->print(" -- pick up free block " PTR_FORMAT " (" SIZE_FORMAT ")\n", fc, size); + gclog_or_tty->print(" -- pick up free block " PTR_FORMAT " (" SIZE_FORMAT ")\n", p2i(fc), size); } // remove it from the free lists _sp->removeFreeChunkFromFreeLists(fc); @@ -7714,7 +7712,7 @@ // this will be swept up when we hit the end of the // free range if (CMSTraceSweeper) { - gclog_or_tty->print(" -- pick up garbage " PTR_FORMAT " (" SIZE_FORMAT ")\n", fc, size); + gclog_or_tty->print(" -- pick up garbage " PTR_FORMAT " (" SIZE_FORMAT ")\n", p2i(fc), size); } // If the chunk is being coalesced and the current free range is // in the free lists, remove the current free range so that it @@ -7807,7 +7805,7 @@ } if (CMSTraceSweeper) { - gclog_or_tty->print_cr(" -- pick up another chunk at " PTR_FORMAT " (" SIZE_FORMAT ")", fc, chunkSize); + gclog_or_tty->print_cr(" -- pick up another chunk at " PTR_FORMAT " (" SIZE_FORMAT ")", p2i(fc), chunkSize); } HeapWord* const fc_addr = (HeapWord*) fc; @@ -7906,14 +7904,14 @@ err_msg("eob = " PTR_FORMAT " eob-1 = " PTR_FORMAT " _limit = " PTR_FORMAT " out of bounds wrt _sp = [" PTR_FORMAT "," PTR_FORMAT ")" " when examining fc = " PTR_FORMAT "(" SIZE_FORMAT ")", - eob, eob-1, _limit, _sp->bottom(), _sp->end(), fc, chunk_size)); + p2i(eob), p2i(eob-1), p2i(_limit), p2i(_sp->bottom()), p2i(_sp->end()), p2i(fc), chunk_size)); if (eob >= _limit) { assert(eob == _limit || fc->is_free(), "Only a free chunk should allow us to cross over the limit"); if (CMSTraceSweeper) { gclog_or_tty->print_cr("_limit " PTR_FORMAT " reached or crossed by block " "[" PTR_FORMAT "," PTR_FORMAT ") in space " "[" PTR_FORMAT "," PTR_FORMAT ")", - _limit, fc, eob, _sp->bottom(), _sp->end()); + p2i(_limit), p2i(fc), p2i(eob), p2i(_sp->bottom()), p2i(_sp->end())); } // Return the storage we are tracking back into the free lists. if (CMSTraceSweeper) { @@ -7937,7 +7935,7 @@ } if (CMSTraceSweeper) { gclog_or_tty->print_cr(" -- add free block " PTR_FORMAT " (" SIZE_FORMAT ") to free lists", - chunk, size); + p2i(chunk), size); } // A new free range is going to be starting. The current // free range has not been added to the free lists yet or @@ -8010,7 +8008,7 @@ void SweepClosure::print_free_block_coalesced(FreeChunk* fc) const { if (CMSTraceSweeper) { gclog_or_tty->print_cr("Sweep:coal_free_blk " PTR_FORMAT " (" SIZE_FORMAT ")", - fc, fc->size()); + p2i(fc), fc->size()); } }