This commit is contained in:
Jesper Wilhelmsson 2015-03-30 17:21:54 +02:00
commit 0efa369ffb
74 changed files with 461 additions and 551 deletions

View File

@ -37,7 +37,9 @@ public class GenCollectedHeap extends SharedHeap {
private static CIntegerField nGensField; private static CIntegerField nGensField;
private static AddressField youngGenField; private static AddressField youngGenField;
private static AddressField oldGenField; private static AddressField oldGenField;
private static AddressField genSpecsField;
private static AddressField youngGenSpecField;
private static AddressField oldGenSpecField;
private static GenerationFactory genFactory; private static GenerationFactory genFactory;
@ -55,9 +57,12 @@ public class GenCollectedHeap extends SharedHeap {
nGensField = type.getCIntegerField("_n_gens"); nGensField = type.getCIntegerField("_n_gens");
youngGenField = type.getAddressField("_young_gen"); youngGenField = type.getAddressField("_young_gen");
oldGenField = type.getAddressField("_old_gen"); oldGenField = type.getAddressField("_old_gen");
genSpecsField = type.getAddressField("_gen_specs");
genFactory = new GenerationFactory(); genFactory = new GenerationFactory();
Type collectorPolicyType = db.lookupType("GenCollectorPolicy");
youngGenSpecField = collectorPolicyType.getAddressField("_young_gen_spec");
oldGenSpecField = collectorPolicyType.getAddressField("_old_gen_spec");
} }
public GenCollectedHeap(Address addr) { public GenCollectedHeap(Address addr) {
@ -115,21 +120,23 @@ public class GenCollectedHeap extends SharedHeap {
/** Package-private access to GenerationSpecs */ /** Package-private access to GenerationSpecs */
GenerationSpec spec(int level) { GenerationSpec spec(int level) {
if (Assert.ASSERTS_ENABLED) { if (Assert.ASSERTS_ENABLED) {
Assert.that((level >= 0) && (level < nGens()), "Index " + level + Assert.that((level == 0) || (level == 1), "Index " + level +
" out of range (should be between 0 and " + nGens() + ")"); " out of range (should be 0 or 1)");
} }
if ((level < 0) || (level >= nGens())) { if ((level != 0) && (level != 1)) {
return null; return null;
} }
Address ptrList = genSpecsField.getValue(addr); if (level == 0) {
if (ptrList == null) { return (GenerationSpec)
return null; VMObjectFactory.newObject(GenerationSpec.class,
youngGenSpecField.getAddress());
} else {
return (GenerationSpec)
VMObjectFactory.newObject(GenerationSpec.class,
oldGenSpecField.getAddress());
} }
return (GenerationSpec)
VMObjectFactory.newObject(GenerationSpec.class,
ptrList.getAddressAt(level * VM.getVM().getAddressSize()));
} }
public CollectedHeapName kind() { public CollectedHeapName kind() {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -52,9 +52,10 @@ void ConcurrentMarkSweepPolicy::initialize_alignments() {
} }
void ConcurrentMarkSweepPolicy::initialize_generations() { void ConcurrentMarkSweepPolicy::initialize_generations() {
_generations = NEW_C_HEAP_ARRAY(GenerationSpecPtr, number_of_generations(), mtGC); _young_gen_spec = new GenerationSpec(Generation::ParNew, _initial_young_size,
_generations[0] = new GenerationSpec(Generation::ParNew, _initial_young_size, _max_young_size); _max_young_size, _gen_alignment);
_generations[1] = new GenerationSpec(Generation::ConcurrentMarkSweep, _initial_old_size, _max_old_size); _old_gen_spec = new GenerationSpec(Generation::ConcurrentMarkSweep,
_initial_old_size, _max_old_size, _gen_alignment);
} }
void ConcurrentMarkSweepPolicy::initialize_size_policy(size_t init_eden_size, void ConcurrentMarkSweepPolicy::initialize_size_policy(size_t init_eden_size,

View File

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

View File

@ -27,8 +27,6 @@
#include "memory/freeBlockDictionary.hpp" #include "memory/freeBlockDictionary.hpp"
#include "utilities/copy.hpp" #include "utilities/copy.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
#ifndef PRODUCT #ifndef PRODUCT
#define baadbabeHeapWord badHeapWordVal #define baadbabeHeapWord badHeapWordVal
@ -74,5 +72,5 @@ void FreeChunk::verifyList() const {
void FreeChunk::print_on(outputStream* st) { void FreeChunk::print_on(outputStream* st) {
st->print_cr("Next: " PTR_FORMAT " Prev: " PTR_FORMAT " %s", st->print_cr("Next: " PTR_FORMAT " Prev: " PTR_FORMAT " %s",
next(), prev(), cantCoalesce() ? "[can't coalesce]" : ""); p2i(next()), p2i(prev()), cantCoalesce() ? "[can't coalesce]" : "");
} }

View File

@ -28,8 +28,6 @@
#include "oops/markOop.inline.hpp" #include "oops/markOop.inline.hpp"
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
//// PromotionInfo //// PromotionInfo
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
@ -360,6 +358,6 @@ void PromotionInfo::print_on(outputStream* st) const {
void SpoolBlock::print_on(outputStream* st) const { void SpoolBlock::print_on(outputStream* st) const {
st->print("[" PTR_FORMAT "," PTR_FORMAT "), " SIZE_FORMAT " HeapWords -> " PTR_FORMAT, st->print("[" PTR_FORMAT "," PTR_FORMAT "), " SIZE_FORMAT " HeapWords -> " PTR_FORMAT,
this, (HeapWord*)displacedHdr + bufferSize, p2i(this), p2i((HeapWord*)displacedHdr + bufferSize),
bufferSize, nextSpoolBlock); bufferSize, p2i(nextSpoolBlock));
} }

View File

@ -34,8 +34,6 @@
#include "runtime/os.hpp" #include "runtime/os.hpp"
#include "utilities/dtrace.hpp" #include "utilities/dtrace.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
// Methods in abstract class VM_CMS_Operation // Methods in abstract class VM_CMS_Operation
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////

View File

@ -2088,10 +2088,7 @@ void ConcurrentMark::cleanup() {
_cleanup_times.add((end - start) * 1000.0); _cleanup_times.add((end - start) * 1000.0);
if (G1Log::fine()) { if (G1Log::fine()) {
g1h->print_size_transition(gclog_or_tty, g1h->g1_policy()->print_heap_transition(start_used_bytes);
start_used_bytes,
g1h->used(),
g1h->capacity());
} }
// Clean up will have freed any regions completely full of garbage. // Clean up will have freed any regions completely full of garbage.

View File

@ -31,8 +31,6 @@
#include "services/memTracker.hpp" #include "services/memTracker.hpp"
#include "utilities/copy.hpp" #include "utilities/copy.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
void G1CardCountsMappingChangedListener::on_commit(uint start_idx, size_t num_regions, bool zero_filled) { void G1CardCountsMappingChangedListener::on_commit(uint start_idx, size_t num_regions, bool zero_filled) {
if (zero_filled) { if (zero_filled) {
return; return;

View File

@ -33,8 +33,6 @@
#include "utilities/hashtable.inline.hpp" #include "utilities/hashtable.inline.hpp"
#include "utilities/stack.inline.hpp" #include "utilities/stack.inline.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
class CodeRootSetTable : public Hashtable<nmethod*, mtGC> { class CodeRootSetTable : public Hashtable<nmethod*, mtGC> {
friend class G1CodeRootSetTest; friend class G1CodeRootSetTest;
typedef HashtableEntry<nmethod*, mtGC> Entry; typedef HashtableEntry<nmethod*, mtGC> Entry;

View File

@ -66,7 +66,6 @@
#include "memory/iterator.hpp" #include "memory/iterator.hpp"
#include "memory/referenceProcessor.hpp" #include "memory/referenceProcessor.hpp"
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
#include "oops/oop.pcgc.inline.hpp"
#include "runtime/atomic.inline.hpp" #include "runtime/atomic.inline.hpp"
#include "runtime/orderAccess.inline.hpp" #include "runtime/orderAccess.inline.hpp"
#include "runtime/vmThread.hpp" #include "runtime/vmThread.hpp"

View File

@ -1201,11 +1201,21 @@ void G1CollectorPolicy::record_heap_size_info_at_start(bool full) {
} }
} }
void G1CollectorPolicy::print_heap_transition(size_t bytes_before) {
size_t bytes_after = _g1->used();
size_t capacity = _g1->capacity();
gclog_or_tty->print(" " SIZE_FORMAT "%s->" SIZE_FORMAT "%s(" SIZE_FORMAT "%s)",
byte_size_in_proper_unit(bytes_before),
proper_unit_for_byte_size(bytes_before),
byte_size_in_proper_unit(bytes_after),
proper_unit_for_byte_size(bytes_after),
byte_size_in_proper_unit(capacity),
proper_unit_for_byte_size(capacity));
}
void G1CollectorPolicy::print_heap_transition() { void G1CollectorPolicy::print_heap_transition() {
_g1->print_size_transition(gclog_or_tty, print_heap_transition(_heap_used_bytes_before_gc);
_heap_used_bytes_before_gc,
_g1->used(),
_g1->capacity());
} }
void G1CollectorPolicy::print_detailed_heap_transition(bool full) { void G1CollectorPolicy::print_detailed_heap_transition(bool full) {

View File

@ -700,6 +700,8 @@ public:
void record_heap_size_info_at_start(bool full); void record_heap_size_info_at_start(bool full);
// Print heap sizing transition (with less and more detail). // Print heap sizing transition (with less and more detail).
void print_heap_transition(size_t bytes_before);
void print_heap_transition(); void print_heap_transition();
void print_detailed_heap_transition(bool full = false); void print_detailed_heap_transition(bool full = false);

View File

@ -27,8 +27,6 @@
#include "gc_implementation/g1/heapRegion.hpp" #include "gc_implementation/g1/heapRegion.hpp"
#include "utilities/ostream.hpp" #include "utilities/ostream.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
const char* G1HRPrinter::action_name(ActionType action) { const char* G1HRPrinter::action_name(ActionType action) {
switch(action) { switch(action) {
case Alloc: return "ALLOC"; case Alloc: return "ALLOC";
@ -85,18 +83,18 @@ void G1HRPrinter::print(ActionType action, RegionType type,
if (type_str != NULL) { if (type_str != NULL) {
if (top != NULL) { if (top != NULL) {
gclog_or_tty->print_cr(G1HR_PREFIX" %s(%s) "PTR_FORMAT" "PTR_FORMAT, gclog_or_tty->print_cr(G1HR_PREFIX" %s(%s) "PTR_FORMAT" "PTR_FORMAT,
action_str, type_str, bottom, top); action_str, type_str, p2i(bottom), p2i(top));
} else { } else {
gclog_or_tty->print_cr(G1HR_PREFIX" %s(%s) "PTR_FORMAT, gclog_or_tty->print_cr(G1HR_PREFIX" %s(%s) "PTR_FORMAT,
action_str, type_str, bottom); action_str, type_str, p2i(bottom));
} }
} else { } else {
if (top != NULL) { if (top != NULL) {
gclog_or_tty->print_cr(G1HR_PREFIX" %s "PTR_FORMAT" "PTR_FORMAT, gclog_or_tty->print_cr(G1HR_PREFIX" %s "PTR_FORMAT" "PTR_FORMAT,
action_str, bottom, top); action_str, p2i(bottom), p2i(top));
} else { } else {
gclog_or_tty->print_cr(G1HR_PREFIX" %s "PTR_FORMAT, gclog_or_tty->print_cr(G1HR_PREFIX" %s "PTR_FORMAT,
action_str, bottom); action_str, p2i(bottom));
} }
} }
} }
@ -105,7 +103,7 @@ void G1HRPrinter::print(ActionType action, HeapWord* bottom, HeapWord* end) {
const char* action_str = action_name(action); const char* action_str = action_name(action);
gclog_or_tty->print_cr(G1HR_PREFIX" %s ["PTR_FORMAT","PTR_FORMAT"]", gclog_or_tty->print_cr(G1HR_PREFIX" %s ["PTR_FORMAT","PTR_FORMAT"]",
action_str, bottom, end); action_str, p2i(bottom), p2i(end));
} }
void G1HRPrinter::print(PhaseType phase, size_t phase_num) { void G1HRPrinter::print(PhaseType phase, size_t phase_num) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -33,6 +33,7 @@
#include "gc_implementation/g1/g1MarkSweep.hpp" #include "gc_implementation/g1/g1MarkSweep.hpp"
#include "gc_implementation/g1/g1RootProcessor.hpp" #include "gc_implementation/g1/g1RootProcessor.hpp"
#include "gc_implementation/g1/g1StringDedup.hpp" #include "gc_implementation/g1/g1StringDedup.hpp"
#include "gc_implementation/shared/markSweep.inline.hpp"
#include "gc_implementation/shared/gcHeapSummary.hpp" #include "gc_implementation/shared/gcHeapSummary.hpp"
#include "gc_implementation/shared/gcTimer.hpp" #include "gc_implementation/shared/gcTimer.hpp"
#include "gc_implementation/shared/gcTrace.hpp" #include "gc_implementation/shared/gcTrace.hpp"
@ -217,7 +218,7 @@ class G1AdjustPointersClosure: public HeapRegionClosure {
// We must adjust the pointers on the single H object. // We must adjust the pointers on the single H object.
oop obj = oop(r->bottom()); oop obj = oop(r->bottom());
// point all the oops to the new location // point all the oops to the new location
obj->adjust_pointers(); MarkSweep::adjust_pointers(obj);
} }
} else { } else {
// This really ought to be "as_CompactibleSpace"... // This really ought to be "as_CompactibleSpace"...

View File

@ -27,7 +27,6 @@
#include "gc_implementation/g1/g1OopClosures.inline.hpp" #include "gc_implementation/g1/g1OopClosures.inline.hpp"
#include "gc_implementation/g1/g1ParScanThreadState.inline.hpp" #include "gc_implementation/g1/g1ParScanThreadState.inline.hpp"
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
#include "oops/oop.pcgc.inline.hpp"
#include "runtime/prefetch.inline.hpp" #include "runtime/prefetch.inline.hpp"
G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num, ReferenceProcessor* rp) G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, uint queue_num, ReferenceProcessor* rp)

View File

@ -39,8 +39,6 @@
#include "utilities/globalDefinitions.hpp" #include "utilities/globalDefinitions.hpp"
#include "utilities/intHisto.hpp" #include "utilities/intHisto.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
#define CARD_REPEAT_HISTO 0 #define CARD_REPEAT_HISTO 0
#if CARD_REPEAT_HISTO #if CARD_REPEAT_HISTO
@ -156,9 +154,9 @@ public:
"RS names card " SIZE_FORMAT_HEX ": " "RS names card " SIZE_FORMAT_HEX ": "
"[" PTR_FORMAT ", " PTR_FORMAT ")", "[" PTR_FORMAT ", " PTR_FORMAT ")",
_worker_i, _worker_i,
card_region->bottom(), card_region->end(), p2i(card_region->bottom()), p2i(card_region->end()),
card_index, card_index,
card_start, card_start + G1BlockOffsetSharedArray::N_words); p2i(card_start), p2i(card_start + G1BlockOffsetSharedArray::N_words));
} }
void scan_strong_code_roots(HeapRegion* r) { void scan_strong_code_roots(HeapRegion* r) {
@ -428,7 +426,7 @@ bool G1RemSet::refine_card(jbyte* card_ptr, uint worker_i,
err_msg("Card at "PTR_FORMAT" index "SIZE_FORMAT" representing heap at "PTR_FORMAT" (%u) must be in committed heap", err_msg("Card at "PTR_FORMAT" index "SIZE_FORMAT" representing heap at "PTR_FORMAT" (%u) must be in committed heap",
p2i(card_ptr), p2i(card_ptr),
_ct_bs->index_for(_ct_bs->addr_for(card_ptr)), _ct_bs->index_for(_ct_bs->addr_for(card_ptr)),
_ct_bs->addr_for(card_ptr), p2i(_ct_bs->addr_for(card_ptr)),
_g1->addr_to_region(_ct_bs->addr_for(card_ptr)))); _g1->addr_to_region(_ct_bs->addr_for(card_ptr))));
// If the card is no longer dirty, nothing to do. // If the card is no longer dirty, nothing to do.

View File

@ -39,8 +39,6 @@
#include "runtime/atomic.inline.hpp" #include "runtime/atomic.inline.hpp"
#include "runtime/orderAccess.inline.hpp" #include "runtime/orderAccess.inline.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
int HeapRegion::LogOfHRGrainBytes = 0; int HeapRegion::LogOfHRGrainBytes = 0;
int HeapRegion::LogOfHRGrainWords = 0; int HeapRegion::LogOfHRGrainWords = 0;
size_t HeapRegion::GrainBytes = 0; size_t HeapRegion::GrainBytes = 0;
@ -505,7 +503,7 @@ class VerifyStrongCodeRootOopClosure: public OopClosure {
gclog_or_tty->print_cr("Object "PTR_FORMAT" in region " gclog_or_tty->print_cr("Object "PTR_FORMAT" in region "
"["PTR_FORMAT", "PTR_FORMAT") is above " "["PTR_FORMAT", "PTR_FORMAT") is above "
"top "PTR_FORMAT, "top "PTR_FORMAT,
(void *)obj, _hr->bottom(), _hr->end(), _hr->top()); p2i(obj), p2i(_hr->bottom()), p2i(_hr->end()), p2i(_hr->top()));
_failures = true; _failures = true;
return; return;
} }
@ -540,7 +538,7 @@ public:
if (!nm->is_alive()) { if (!nm->is_alive()) {
gclog_or_tty->print_cr("region ["PTR_FORMAT","PTR_FORMAT"] has dead nmethod " gclog_or_tty->print_cr("region ["PTR_FORMAT","PTR_FORMAT"] has dead nmethod "
PTR_FORMAT" in its strong code roots", PTR_FORMAT" in its strong code roots",
_hr->bottom(), _hr->end(), nm); p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm));
_failures = true; _failures = true;
} else { } else {
VerifyStrongCodeRootOopClosure oop_cl(_hr, nm); VerifyStrongCodeRootOopClosure oop_cl(_hr, nm);
@ -549,12 +547,12 @@ public:
gclog_or_tty->print_cr("region ["PTR_FORMAT","PTR_FORMAT"] has nmethod " gclog_or_tty->print_cr("region ["PTR_FORMAT","PTR_FORMAT"] has nmethod "
PTR_FORMAT" in its strong code roots " PTR_FORMAT" in its strong code roots "
"with no pointers into region", "with no pointers into region",
_hr->bottom(), _hr->end(), nm); p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm));
_failures = true; _failures = true;
} else if (oop_cl.failures()) { } else if (oop_cl.failures()) {
gclog_or_tty->print_cr("region ["PTR_FORMAT","PTR_FORMAT"] has other " gclog_or_tty->print_cr("region ["PTR_FORMAT","PTR_FORMAT"] has other "
"failures for nmethod "PTR_FORMAT, "failures for nmethod "PTR_FORMAT,
_hr->bottom(), _hr->end(), nm); p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm));
_failures = true; _failures = true;
} }
} }
@ -589,7 +587,7 @@ void HeapRegion::verify_strong_code_roots(VerifyOption vo, bool* failures) const
if (strong_code_roots_length > 0) { if (strong_code_roots_length > 0) {
gclog_or_tty->print_cr("region ["PTR_FORMAT","PTR_FORMAT"] is empty " gclog_or_tty->print_cr("region ["PTR_FORMAT","PTR_FORMAT"] is empty "
"but has "SIZE_FORMAT" code root entries", "but has "SIZE_FORMAT" code root entries",
bottom(), end(), strong_code_roots_length); p2i(bottom()), p2i(end()), strong_code_roots_length);
*failures = true; *failures = true;
} }
return; return;
@ -624,7 +622,7 @@ void HeapRegion::print_on(outputStream* st) const {
st->print(" "); st->print(" ");
st->print(" TS %5d", _gc_time_stamp); st->print(" TS %5d", _gc_time_stamp);
st->print(" PTAMS "PTR_FORMAT" NTAMS "PTR_FORMAT, st->print(" PTAMS "PTR_FORMAT" NTAMS "PTR_FORMAT,
prev_top_at_mark_start(), next_top_at_mark_start()); p2i(prev_top_at_mark_start()), p2i(next_top_at_mark_start()));
G1OffsetTableContigSpace::print_on(st); G1OffsetTableContigSpace::print_on(st);
} }
@ -687,23 +685,23 @@ public:
gclog_or_tty->print_cr("Field "PTR_FORMAT gclog_or_tty->print_cr("Field "PTR_FORMAT
" of live obj "PTR_FORMAT" in region " " of live obj "PTR_FORMAT" in region "
"["PTR_FORMAT", "PTR_FORMAT")", "["PTR_FORMAT", "PTR_FORMAT")",
p, (void*) _containing_obj, p2i(p), p2i(_containing_obj),
from->bottom(), from->end()); p2i(from->bottom()), p2i(from->end()));
print_object(gclog_or_tty, _containing_obj); print_object(gclog_or_tty, _containing_obj);
gclog_or_tty->print_cr("points to obj "PTR_FORMAT" not in the heap", gclog_or_tty->print_cr("points to obj "PTR_FORMAT" not in the heap",
(void*) obj); p2i(obj));
} else { } else {
HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p); HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
HeapRegion* to = _g1h->heap_region_containing((HeapWord*)obj); HeapRegion* to = _g1h->heap_region_containing((HeapWord*)obj);
gclog_or_tty->print_cr("Field "PTR_FORMAT gclog_or_tty->print_cr("Field "PTR_FORMAT
" of live obj "PTR_FORMAT" in region " " of live obj "PTR_FORMAT" in region "
"["PTR_FORMAT", "PTR_FORMAT")", "["PTR_FORMAT", "PTR_FORMAT")",
p, (void*) _containing_obj, p2i(p), p2i(_containing_obj),
from->bottom(), from->end()); p2i(from->bottom()), p2i(from->end()));
print_object(gclog_or_tty, _containing_obj); print_object(gclog_or_tty, _containing_obj);
gclog_or_tty->print_cr("points to dead obj "PTR_FORMAT" in region " gclog_or_tty->print_cr("points to dead obj "PTR_FORMAT" in region "
"["PTR_FORMAT", "PTR_FORMAT")", "["PTR_FORMAT", "PTR_FORMAT")",
(void*) obj, to->bottom(), to->end()); p2i(obj), p2i(to->bottom()), p2i(to->end()));
print_object(gclog_or_tty, obj); print_object(gclog_or_tty, obj);
} }
gclog_or_tty->print_cr("----------"); gclog_or_tty->print_cr("----------");
@ -741,12 +739,12 @@ public:
gclog_or_tty->print_cr("Field "PTR_FORMAT" " gclog_or_tty->print_cr("Field "PTR_FORMAT" "
"of obj "PTR_FORMAT", " "of obj "PTR_FORMAT", "
"in region "HR_FORMAT, "in region "HR_FORMAT,
p, (void*) _containing_obj, p2i(p), p2i(_containing_obj),
HR_FORMAT_PARAMS(from)); HR_FORMAT_PARAMS(from));
_containing_obj->print_on(gclog_or_tty); _containing_obj->print_on(gclog_or_tty);
gclog_or_tty->print_cr("points to obj "PTR_FORMAT" " gclog_or_tty->print_cr("points to obj "PTR_FORMAT" "
"in region "HR_FORMAT, "in region "HR_FORMAT,
(void*) obj, p2i(obj),
HR_FORMAT_PARAMS(to)); HR_FORMAT_PARAMS(to));
obj->print_on(gclog_or_tty); obj->print_on(gclog_or_tty);
gclog_or_tty->print_cr("Obj head CTE = %d, field CTE = %d.", gclog_or_tty->print_cr("Obj head CTE = %d, field CTE = %d.",
@ -783,7 +781,7 @@ void HeapRegion::verify(VerifyOption vo,
!g1->is_obj_dead(obj, this)) { // Dead objects may have bigger block_size since they span several objects. !g1->is_obj_dead(obj, this)) { // Dead objects may have bigger block_size since they span several objects.
gclog_or_tty->print_cr("obj "PTR_FORMAT" is of %shumongous size (" gclog_or_tty->print_cr("obj "PTR_FORMAT" is of %shumongous size ("
SIZE_FORMAT" words) in a %shumongous region", SIZE_FORMAT" words) in a %shumongous region",
p, g1->is_humongous(obj_size) ? "" : "non-", p2i(p), g1->is_humongous(obj_size) ? "" : "non-",
obj_size, is_region_humongous ? "" : "non-"); obj_size, is_region_humongous ? "" : "non-");
*failures = true; *failures = true;
return; return;
@ -797,12 +795,12 @@ void HeapRegion::verify(VerifyOption vo,
ClassLoaderDataGraph::unload_list_contains(klass)); ClassLoaderDataGraph::unload_list_contains(klass));
if (!is_metaspace_object) { if (!is_metaspace_object) {
gclog_or_tty->print_cr("klass "PTR_FORMAT" of object "PTR_FORMAT" " gclog_or_tty->print_cr("klass "PTR_FORMAT" of object "PTR_FORMAT" "
"not metadata", klass, (void *)obj); "not metadata", p2i(klass), p2i(obj));
*failures = true; *failures = true;
return; return;
} else if (!klass->is_klass()) { } else if (!klass->is_klass()) {
gclog_or_tty->print_cr("klass "PTR_FORMAT" of object "PTR_FORMAT" " gclog_or_tty->print_cr("klass "PTR_FORMAT" of object "PTR_FORMAT" "
"not a klass", klass, (void *)obj); "not a klass", p2i(klass), p2i(obj));
*failures = true; *failures = true;
return; return;
} else { } else {
@ -817,7 +815,7 @@ void HeapRegion::verify(VerifyOption vo,
} }
} }
} else { } else {
gclog_or_tty->print_cr(PTR_FORMAT" no an oop", (void *)obj); gclog_or_tty->print_cr(PTR_FORMAT" no an oop", p2i(obj));
*failures = true; *failures = true;
return; return;
} }
@ -832,7 +830,7 @@ void HeapRegion::verify(VerifyOption vo,
if (p != top()) { if (p != top()) {
gclog_or_tty->print_cr("end of last object "PTR_FORMAT" " gclog_or_tty->print_cr("end of last object "PTR_FORMAT" "
"does not match top "PTR_FORMAT, p, top()); "does not match top "PTR_FORMAT, p2i(p), p2i(top()));
*failures = true; *failures = true;
return; return;
} }
@ -849,7 +847,7 @@ void HeapRegion::verify(VerifyOption vo,
if (b_start_1 != p) { if (b_start_1 != p) {
gclog_or_tty->print_cr("BOT look up for top: "PTR_FORMAT" " gclog_or_tty->print_cr("BOT look up for top: "PTR_FORMAT" "
" yielded "PTR_FORMAT", expecting "PTR_FORMAT, " yielded "PTR_FORMAT", expecting "PTR_FORMAT,
addr_1, b_start_1, p); p2i(addr_1), p2i(b_start_1), p2i(p));
*failures = true; *failures = true;
return; return;
} }
@ -861,7 +859,7 @@ void HeapRegion::verify(VerifyOption vo,
if (b_start_2 != p) { if (b_start_2 != p) {
gclog_or_tty->print_cr("BOT look up for top + 1: "PTR_FORMAT" " gclog_or_tty->print_cr("BOT look up for top + 1: "PTR_FORMAT" "
" yielded "PTR_FORMAT", expecting "PTR_FORMAT, " yielded "PTR_FORMAT", expecting "PTR_FORMAT,
addr_2, b_start_2, p); p2i(addr_2), p2i(b_start_2), p2i(p));
*failures = true; *failures = true;
return; return;
} }
@ -875,7 +873,7 @@ void HeapRegion::verify(VerifyOption vo,
if (b_start_3 != p) { if (b_start_3 != p) {
gclog_or_tty->print_cr("BOT look up for top + diff: "PTR_FORMAT" " gclog_or_tty->print_cr("BOT look up for top + diff: "PTR_FORMAT" "
" yielded "PTR_FORMAT", expecting "PTR_FORMAT, " yielded "PTR_FORMAT", expecting "PTR_FORMAT,
addr_3, b_start_3, p); p2i(addr_3), p2i(b_start_3), p2i(p));
*failures = true; *failures = true;
return; return;
} }
@ -887,7 +885,7 @@ void HeapRegion::verify(VerifyOption vo,
if (b_start_4 != p) { if (b_start_4 != p) {
gclog_or_tty->print_cr("BOT look up for end - 1: "PTR_FORMAT" " gclog_or_tty->print_cr("BOT look up for end - 1: "PTR_FORMAT" "
" yielded "PTR_FORMAT", expecting "PTR_FORMAT, " yielded "PTR_FORMAT", expecting "PTR_FORMAT,
addr_4, b_start_4, p); p2i(addr_4), p2i(b_start_4), p2i(p));
*failures = true; *failures = true;
return; return;
} }
@ -896,7 +894,7 @@ void HeapRegion::verify(VerifyOption vo,
if (is_region_humongous && object_num > 1) { if (is_region_humongous && object_num > 1) {
gclog_or_tty->print_cr("region ["PTR_FORMAT","PTR_FORMAT"] is humongous " gclog_or_tty->print_cr("region ["PTR_FORMAT","PTR_FORMAT"] is humongous "
"but has "SIZE_FORMAT", objects", "but has "SIZE_FORMAT", objects",
bottom(), end(), object_num); p2i(bottom()), p2i(end()), object_num);
*failures = true; *failures = true;
return; return;
} }
@ -947,7 +945,7 @@ void G1OffsetTableContigSpace::print() const {
print_short(); print_short();
gclog_or_tty->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " gclog_or_tty->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", "
INTPTR_FORMAT ", " INTPTR_FORMAT ")", INTPTR_FORMAT ", " INTPTR_FORMAT ")",
bottom(), top(), _offsets.threshold(), end()); p2i(bottom()), p2i(top()), p2i(_offsets.threshold()), p2i(end()));
} }
HeapWord* G1OffsetTableContigSpace::initialize_threshold() { HeapWord* G1OffsetTableContigSpace::initialize_threshold() {

View File

@ -37,8 +37,6 @@
#include "utilities/globalDefinitions.hpp" #include "utilities/globalDefinitions.hpp"
#include "utilities/growableArray.hpp" #include "utilities/growableArray.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
class PerRegionTable: public CHeapObj<mtGC> { class PerRegionTable: public CHeapObj<mtGC> {
friend class OtherRegionsTable; friend class OtherRegionsTable;
friend class HeapRegionRemSetIterator; friend class HeapRegionRemSetIterator;
@ -93,10 +91,10 @@ protected:
if (G1TraceHeapRegionRememberedSet) { if (G1TraceHeapRegionRememberedSet) {
gclog_or_tty->print_cr(" PRT::Add_reference_work(" PTR_FORMAT "->" PTR_FORMAT").", gclog_or_tty->print_cr(" PRT::Add_reference_work(" PTR_FORMAT "->" PTR_FORMAT").",
from, p2i(from),
UseCompressedOops UseCompressedOops
? (void *)oopDesc::load_decode_heap_oop((narrowOop*)from) ? p2i(oopDesc::load_decode_heap_oop((narrowOop*)from))
: (void *)oopDesc::load_decode_heap_oop((oop*)from)); : p2i(oopDesc::load_decode_heap_oop((oop*)from)));
} }
HeapRegion* loc_hr = hr(); HeapRegion* loc_hr = hr();
@ -412,17 +410,17 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, uint tid) {
if (G1TraceHeapRegionRememberedSet) { if (G1TraceHeapRegionRememberedSet) {
gclog_or_tty->print_cr("ORT::add_reference_work(" PTR_FORMAT "->" PTR_FORMAT ").", gclog_or_tty->print_cr("ORT::add_reference_work(" PTR_FORMAT "->" PTR_FORMAT ").",
from, p2i(from),
UseCompressedOops UseCompressedOops
? (void *)oopDesc::load_decode_heap_oop((narrowOop*)from) ? p2i(oopDesc::load_decode_heap_oop((narrowOop*)from))
: (void *)oopDesc::load_decode_heap_oop((oop*)from)); : p2i(oopDesc::load_decode_heap_oop((oop*)from)));
} }
int from_card = (int)(uintptr_t(from) >> CardTableModRefBS::card_shift); int from_card = (int)(uintptr_t(from) >> CardTableModRefBS::card_shift);
if (G1TraceHeapRegionRememberedSet) { if (G1TraceHeapRegionRememberedSet) {
gclog_or_tty->print_cr("Table for [" PTR_FORMAT "...): card %d (cache = %d)", gclog_or_tty->print_cr("Table for [" PTR_FORMAT "...): card %d (cache = %d)",
_hr->bottom(), from_card, p2i(_hr->bottom()), from_card,
FromCardCache::at(tid, cur_hrm_ind)); FromCardCache::at(tid, cur_hrm_ind));
} }
@ -471,7 +469,7 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, uint tid) {
"[" PTR_FORMAT "...) for ref " PTR_FORMAT ".\n", "[" PTR_FORMAT "...) for ref " PTR_FORMAT ".\n",
align_size_down(uintptr_t(from), align_size_down(uintptr_t(from),
CardTableModRefBS::card_size), CardTableModRefBS::card_size),
_hr->bottom(), from); p2i(_hr->bottom()), p2i(from));
} }
} }
if (G1TraceHeapRegionRememberedSet) { if (G1TraceHeapRegionRememberedSet) {
@ -533,7 +531,7 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, uint tid) {
"[" PTR_FORMAT "...) for ref " PTR_FORMAT ".\n", "[" PTR_FORMAT "...) for ref " PTR_FORMAT ".\n",
align_size_down(uintptr_t(from), align_size_down(uintptr_t(from),
CardTableModRefBS::card_size), CardTableModRefBS::card_size),
_hr->bottom(), from); p2i(_hr->bottom()), p2i(from));
} }
} }
assert(contains_reference(from), "We just added it!"); assert(contains_reference(from), "We just added it!");
@ -602,8 +600,8 @@ PerRegionTable* OtherRegionsTable::delete_region_table() {
if (G1TraceHeapRegionRememberedSet) { if (G1TraceHeapRegionRememberedSet) {
gclog_or_tty->print("Coarsened entry in region [" PTR_FORMAT "...] " gclog_or_tty->print("Coarsened entry in region [" PTR_FORMAT "...] "
"for region [" PTR_FORMAT "...] (" SIZE_FORMAT " coarse entries).\n", "for region [" PTR_FORMAT "...] (" SIZE_FORMAT " coarse entries).\n",
_hr->bottom(), p2i(_hr->bottom()),
max->hr()->bottom(), p2i(max->hr()->bottom()),
_n_coarse_entries); _n_coarse_entries);
} }
} }
@ -857,7 +855,7 @@ void HeapRegionRemSet::print() {
while (iter.has_next(card_index)) { while (iter.has_next(card_index)) {
HeapWord* card_start = HeapWord* card_start =
G1CollectedHeap::heap()->bot_shared()->address_for_index(card_index); G1CollectedHeap::heap()->bot_shared()->address_for_index(card_index);
gclog_or_tty->print_cr(" Card " PTR_FORMAT, card_start); gclog_or_tty->print_cr(" Card " PTR_FORMAT, p2i(card_start));
} }
if (iter.n_yielded() != occupied()) { if (iter.n_yielded() != occupied()) {
gclog_or_tty->print_cr("Yielded disagrees with occupied:"); gclog_or_tty->print_cr("Yielded disagrees with occupied:");
@ -1152,8 +1150,8 @@ void HeapRegionRemSet::print_recorded() {
} }
gclog_or_tty->print("Added card " PTR_FORMAT " to region [" PTR_FORMAT "...]" gclog_or_tty->print("Added card " PTR_FORMAT " to region [" PTR_FORMAT "...]"
" for ref " PTR_FORMAT ".\n", " for ref " PTR_FORMAT ".\n",
_recorded_cards[i], _recorded_regions[i]->bottom(), p2i(_recorded_cards[i]), p2i(_recorded_regions[i]->bottom()),
_recorded_oops[i]); p2i(_recorded_oops[i]));
} }
} }
@ -1240,7 +1238,7 @@ void HeapRegionRemSet::test() {
while (iter.has_next(card_index)) { while (iter.has_next(card_index)) {
HeapWord* card_start = HeapWord* card_start =
G1CollectedHeap::heap()->bot_shared()->address_for_index(card_index); G1CollectedHeap::heap()->bot_shared()->address_for_index(card_index);
gclog_or_tty->print_cr(" Card " PTR_FORMAT ".", card_start); gclog_or_tty->print_cr(" Card " PTR_FORMAT ".", p2i(card_start));
sum++; sum++;
} }
guarantee(sum == 11 - 3 + 2048, "Failure"); guarantee(sum == 11 - 3 + 2048, "Failure");

View File

@ -27,8 +27,6 @@
#include "gc_implementation/g1/heapRegionRemSet.hpp" #include "gc_implementation/g1/heapRegionRemSet.hpp"
#include "gc_implementation/g1/heapRegionSet.inline.hpp" #include "gc_implementation/g1/heapRegionSet.inline.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
uint FreeRegionList::_unrealistically_long_length = 0; uint FreeRegionList::_unrealistically_long_length = 0;
void HeapRegionSetBase::fill_in_ext_msg(hrs_ext_msg* msg, const char* message) { void HeapRegionSetBase::fill_in_ext_msg(hrs_ext_msg* msg, const char* message) {
@ -84,7 +82,7 @@ void HeapRegionSetBase::verify_end() {
void HeapRegionSetBase::print_on(outputStream* out, bool print_contents) { void HeapRegionSetBase::print_on(outputStream* out, bool print_contents) {
out->cr(); out->cr();
out->print_cr("Set: %s ("PTR_FORMAT")", name(), this); out->print_cr("Set: %s ("PTR_FORMAT")", name(), p2i(this));
out->print_cr(" Region Assumptions"); out->print_cr(" Region Assumptions");
out->print_cr(" humongous : %s", BOOL_TO_STR(regions_humongous())); out->print_cr(" humongous : %s", BOOL_TO_STR(regions_humongous()));
out->print_cr(" free : %s", BOOL_TO_STR(regions_free())); out->print_cr(" free : %s", BOOL_TO_STR(regions_free()));
@ -106,7 +104,7 @@ void FreeRegionList::set_unrealistically_long_length(uint len) {
} }
void FreeRegionList::fill_in_ext_msg_extra(hrs_ext_msg* msg) { void FreeRegionList::fill_in_ext_msg_extra(hrs_ext_msg* msg) {
msg->append(" hd: "PTR_FORMAT" tl: "PTR_FORMAT, _head, _tail); msg->append(" hd: "PTR_FORMAT" tl: "PTR_FORMAT, p2i(_head), p2i(_tail));
} }
void FreeRegionList::remove_all() { void FreeRegionList::remove_all() {
@ -277,8 +275,8 @@ void FreeRegionList::clear() {
void FreeRegionList::print_on(outputStream* out, bool print_contents) { void FreeRegionList::print_on(outputStream* out, bool print_contents) {
HeapRegionSetBase::print_on(out, print_contents); HeapRegionSetBase::print_on(out, print_contents);
out->print_cr(" Linking"); out->print_cr(" Linking");
out->print_cr(" head : "PTR_FORMAT, _head); out->print_cr(" head : "PTR_FORMAT, p2i(_head));
out->print_cr(" tail : "PTR_FORMAT, _tail); out->print_cr(" tail : "PTR_FORMAT, p2i(_tail));
if (print_contents) { if (print_contents) {
out->print_cr(" Contents"); out->print_cr(" Contents");
@ -306,7 +304,8 @@ void FreeRegionList::verify_list() {
count++; count++;
guarantee(count < _unrealistically_long_length, guarantee(count < _unrealistically_long_length,
hrs_err_msg("[%s] the calculated length: %u seems very long, is there maybe a cycle? curr: "PTR_FORMAT" prev0: "PTR_FORMAT" " "prev1: "PTR_FORMAT" length: %u", name(), count, curr, prev0, prev1, length())); hrs_err_msg("[%s] the calculated length: %u seems very long, is there maybe a cycle? curr: "PTR_FORMAT" prev0: "PTR_FORMAT" " "prev1: "PTR_FORMAT" length: %u",
name(), count, p2i(curr), p2i(prev0), p2i(prev1), length()));
if (curr->next() != NULL) { if (curr->next() != NULL) {
guarantee(curr->next()->prev() == curr, "Next or prev pointers messed up"); guarantee(curr->next()->prev() == curr, "Next or prev pointers messed up");

View File

@ -32,8 +32,6 @@
#include "runtime/thread.hpp" #include "runtime/thread.hpp"
#include "runtime/vmThread.hpp" #include "runtime/vmThread.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
void ObjPtrQueue::flush() { void ObjPtrQueue::flush() {
// The buffer might contain refs into the CSet. We have to filter it // The buffer might contain refs into the CSet. We have to filter it
// first before we flush it, otherwise we might end up with an // first before we flush it, otherwise we might end up with an
@ -182,7 +180,7 @@ void ObjPtrQueue::print(const char* name,
void** buf, size_t index, size_t sz) { void** buf, size_t index, size_t sz) {
gclog_or_tty->print_cr(" SATB BUFFER [%s] buf: "PTR_FORMAT" " gclog_or_tty->print_cr(" SATB BUFFER [%s] buf: "PTR_FORMAT" "
"index: "SIZE_FORMAT" sz: "SIZE_FORMAT, "index: "SIZE_FORMAT" sz: "SIZE_FORMAT,
name, buf, index, sz); name, p2i(buf), index, sz);
} }
#endif // PRODUCT #endif // PRODUCT

View File

@ -29,8 +29,6 @@
#include "gc_implementation/g1/survRateGroup.hpp" #include "gc_implementation/g1/survRateGroup.hpp"
#include "memory/allocation.hpp" #include "memory/allocation.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
SurvRateGroup::SurvRateGroup(G1CollectorPolicy* g1p, SurvRateGroup::SurvRateGroup(G1CollectorPolicy* g1p,
const char* name, const char* name,
size_t summary_surv_rates_len) : size_t summary_surv_rates_len) :

View File

@ -36,8 +36,6 @@
#include "runtime/virtualspace.hpp" #include "runtime/virtualspace.hpp"
#include "runtime/vmThread.hpp" #include "runtime/vmThread.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
void CardTableModRefBS::non_clean_card_iterate_parallel_work(Space* sp, MemRegion mr, void CardTableModRefBS::non_clean_card_iterate_parallel_work(Space* sp, MemRegion mr,
OopsInGenClosure* cl, OopsInGenClosure* cl,
CardTableRS* ct, CardTableRS* ct,
@ -376,13 +374,14 @@ process_chunk_boundaries(Space* sp,
" does not exceed used.end() = " PTR_FORMAT "," " does not exceed used.end() = " PTR_FORMAT ","
" yet last_chunk_index_to_check " INTPTR_FORMAT " yet last_chunk_index_to_check " INTPTR_FORMAT
" exceeds last_chunk_index " INTPTR_FORMAT, " exceeds last_chunk_index " INTPTR_FORMAT,
last_block, last_block + last_block_size, p2i(last_block), p2i(last_block + last_block_size),
used.end(), p2i(used.end()),
last_chunk_index_to_check, last_chunk_index)); last_chunk_index_to_check, last_chunk_index));
assert(sp->used_region().end() > used.end(), assert(sp->used_region().end() > used.end(),
err_msg("Expansion did not happen: " err_msg("Expansion did not happen: "
"[" PTR_FORMAT "," PTR_FORMAT ") -> [" PTR_FORMAT "," PTR_FORMAT ")", "[" PTR_FORMAT "," PTR_FORMAT ") -> [" PTR_FORMAT "," PTR_FORMAT ")",
sp->used_region().start(), sp->used_region().end(), used.start(), used.end())); p2i(sp->used_region().start()), p2i(sp->used_region().end()),
p2i(used.start()), p2i(used.end())));
NOISY(tty->print_cr(" process_chunk_boundary: heap expanded; explicitly bounding last_chunk");) NOISY(tty->print_cr(" process_chunk_boundary: heap expanded; explicitly bounding last_chunk");)
last_chunk_index_to_check = last_chunk_index; last_chunk_index_to_check = last_chunk_index;
} }

View File

@ -46,7 +46,6 @@
#include "memory/space.hpp" #include "memory/space.hpp"
#include "oops/objArrayOop.hpp" #include "oops/objArrayOop.hpp"
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
#include "oops/oop.pcgc.inline.hpp"
#include "runtime/atomic.inline.hpp" #include "runtime/atomic.inline.hpp"
#include "runtime/handles.hpp" #include "runtime/handles.hpp"
#include "runtime/handles.inline.hpp" #include "runtime/handles.inline.hpp"
@ -56,8 +55,6 @@
#include "utilities/globalDefinitions.hpp" #include "utilities/globalDefinitions.hpp"
#include "utilities/workgroup.hpp" #include "utilities/workgroup.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning( push ) #pragma warning( push )
#pragma warning( disable:4355 ) // 'this' : used in base member initializer list #pragma warning( disable:4355 ) // 'this' : used in base member initializer list
@ -1213,7 +1210,7 @@ oop ParNewGeneration::copy_to_survivor_space(
if (TraceScavenge) { if (TraceScavenge) {
gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}",
is_in_reserved(new_obj) ? "copying" : "tenuring", is_in_reserved(new_obj) ? "copying" : "tenuring",
new_obj->klass()->internal_name(), (void *)old, (void *)new_obj, new_obj->size()); new_obj->klass()->internal_name(), p2i(old), p2i(new_obj), new_obj->size());
} }
#endif #endif

View File

@ -26,12 +26,11 @@
#include "gc_implementation/parallelScavenge/cardTableExtension.hpp" #include "gc_implementation/parallelScavenge/cardTableExtension.hpp"
#include "gc_implementation/parallelScavenge/gcTaskManager.hpp" #include "gc_implementation/parallelScavenge/gcTaskManager.hpp"
#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
#include "gc_implementation/parallelScavenge/psPromotionManager.hpp" #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
#include "gc_implementation/parallelScavenge/psScavenge.hpp" #include "gc_implementation/parallelScavenge/psScavenge.hpp"
#include "gc_implementation/parallelScavenge/psTasks.hpp" #include "gc_implementation/parallelScavenge/psTasks.hpp"
#include "gc_implementation/parallelScavenge/psYoungGen.hpp" #include "gc_implementation/parallelScavenge/psYoungGen.hpp"
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
#include "oops/oop.psgc.inline.hpp"
#include "runtime/prefetch.inline.hpp" #include "runtime/prefetch.inline.hpp"
// Checks an individual oop for missing precise marks. Mark // Checks an individual oop for missing precise marks. Mark
@ -291,7 +290,7 @@ void CardTableExtension::scavenge_contents_parallel(ObjectStartArray* start_arra
Prefetch::write(p, interval); Prefetch::write(p, interval);
oop m = oop(p); oop m = oop(p);
assert(m->is_oop_or_null(), err_msg("Expected an oop or NULL for header field at " PTR_FORMAT, p2i(m))); assert(m->is_oop_or_null(), err_msg("Expected an oop or NULL for header field at " PTR_FORMAT, p2i(m)));
m->push_contents(pm); pm->push_contents(m);
p += m->size(); p += m->size();
} }
pm->drain_stacks_cond_depth(); pm->drain_stacks_cond_depth();
@ -299,7 +298,7 @@ void CardTableExtension::scavenge_contents_parallel(ObjectStartArray* start_arra
while (p < to) { while (p < to) {
oop m = oop(p); oop m = oop(p);
assert(m->is_oop_or_null(), err_msg("Expected an oop or NULL for header field at " PTR_FORMAT, p2i(m))); assert(m->is_oop_or_null(), err_msg("Expected an oop or NULL for header field at " PTR_FORMAT, p2i(m)));
m->push_contents(pm); pm->push_contents(m);
p += m->size(); p += m->size();
} }
pm->drain_stacks_cond_depth(); pm->drain_stacks_cond_depth();

View File

@ -32,8 +32,6 @@
#include "runtime/mutexLocker.hpp" #include "runtime/mutexLocker.hpp"
#include "runtime/orderAccess.inline.hpp" #include "runtime/orderAccess.inline.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// //
// GCTask // GCTask
// //
@ -101,7 +99,7 @@ void GCTask::destruct() {
NOT_PRODUCT( NOT_PRODUCT(
void GCTask::print(const char* message) const { void GCTask::print(const char* message) const {
tty->print(INTPTR_FORMAT " <- " INTPTR_FORMAT "(%u) -> " INTPTR_FORMAT, tty->print(INTPTR_FORMAT " <- " INTPTR_FORMAT "(%u) -> " INTPTR_FORMAT,
newer(), this, affinity(), older()); p2i(newer()), p2i(this), affinity(), p2i(older()));
} }
) )
@ -113,7 +111,7 @@ GCTaskQueue* GCTaskQueue::create() {
GCTaskQueue* result = new GCTaskQueue(false); GCTaskQueue* result = new GCTaskQueue(false);
if (TraceGCTaskQueue) { if (TraceGCTaskQueue) {
tty->print_cr("GCTaskQueue::create()" tty->print_cr("GCTaskQueue::create()"
" returns " INTPTR_FORMAT, result); " returns " INTPTR_FORMAT, p2i(result));
} }
return result; return result;
} }
@ -123,7 +121,7 @@ GCTaskQueue* GCTaskQueue::create_on_c_heap() {
if (TraceGCTaskQueue) { if (TraceGCTaskQueue) {
tty->print_cr("GCTaskQueue::create_on_c_heap()" tty->print_cr("GCTaskQueue::create_on_c_heap()"
" returns " INTPTR_FORMAT, " returns " INTPTR_FORMAT,
result); p2i(result));
} }
return result; return result;
} }
@ -134,7 +132,7 @@ GCTaskQueue::GCTaskQueue(bool on_c_heap) :
if (TraceGCTaskQueue) { if (TraceGCTaskQueue) {
tty->print_cr("[" INTPTR_FORMAT "]" tty->print_cr("[" INTPTR_FORMAT "]"
" GCTaskQueue::GCTaskQueue() constructor", " GCTaskQueue::GCTaskQueue() constructor",
this); p2i(this));
} }
} }
@ -147,7 +145,7 @@ void GCTaskQueue::destroy(GCTaskQueue* that) {
tty->print_cr("[" INTPTR_FORMAT "]" tty->print_cr("[" INTPTR_FORMAT "]"
" GCTaskQueue::destroy()" " GCTaskQueue::destroy()"
" is_c_heap_obj: %s", " is_c_heap_obj: %s",
that, p2i(that),
that->is_c_heap_obj() ? "true" : "false"); that->is_c_heap_obj() ? "true" : "false");
} }
// That instance may have been allocated as a CHeapObj, // That instance may have been allocated as a CHeapObj,
@ -173,7 +171,7 @@ void GCTaskQueue::enqueue(GCTask* task) {
tty->print_cr("[" INTPTR_FORMAT "]" tty->print_cr("[" INTPTR_FORMAT "]"
" GCTaskQueue::enqueue(task: " " GCTaskQueue::enqueue(task: "
INTPTR_FORMAT ")", INTPTR_FORMAT ")",
this, task); p2i(this), p2i(task));
print("before:"); print("before:");
} }
assert(task != NULL, "shouldn't have null task"); assert(task != NULL, "shouldn't have null task");
@ -200,7 +198,7 @@ void GCTaskQueue::enqueue(GCTaskQueue* list) {
tty->print_cr("[" INTPTR_FORMAT "]" tty->print_cr("[" INTPTR_FORMAT "]"
" GCTaskQueue::enqueue(list: " " GCTaskQueue::enqueue(list: "
INTPTR_FORMAT ")", INTPTR_FORMAT ")",
this, list); p2i(this), p2i(list));
print("before:"); print("before:");
list->print("list:"); list->print("list:");
} }
@ -234,14 +232,14 @@ void GCTaskQueue::enqueue(GCTaskQueue* list) {
GCTask* GCTaskQueue::dequeue() { GCTask* GCTaskQueue::dequeue() {
if (TraceGCTaskQueue) { if (TraceGCTaskQueue) {
tty->print_cr("[" INTPTR_FORMAT "]" tty->print_cr("[" INTPTR_FORMAT "]"
" GCTaskQueue::dequeue()", this); " GCTaskQueue::dequeue()", p2i(this));
print("before:"); print("before:");
} }
assert(!is_empty(), "shouldn't dequeue from empty list"); assert(!is_empty(), "shouldn't dequeue from empty list");
GCTask* result = remove(); GCTask* result = remove();
assert(result != NULL, "shouldn't have NULL task"); assert(result != NULL, "shouldn't have NULL task");
if (TraceGCTaskQueue) { if (TraceGCTaskQueue) {
tty->print_cr(" return: " INTPTR_FORMAT, result); tty->print_cr(" return: " INTPTR_FORMAT, p2i(result));
print("after:"); print("after:");
} }
return result; return result;
@ -251,7 +249,7 @@ GCTask* GCTaskQueue::dequeue() {
GCTask* GCTaskQueue::dequeue(uint affinity) { GCTask* GCTaskQueue::dequeue(uint affinity) {
if (TraceGCTaskQueue) { if (TraceGCTaskQueue) {
tty->print_cr("[" INTPTR_FORMAT "]" tty->print_cr("[" INTPTR_FORMAT "]"
" GCTaskQueue::dequeue(%u)", this, affinity); " GCTaskQueue::dequeue(%u)", p2i(this), affinity);
print("before:"); print("before:");
} }
assert(!is_empty(), "shouldn't dequeue from empty list"); assert(!is_empty(), "shouldn't dequeue from empty list");
@ -275,7 +273,7 @@ GCTask* GCTaskQueue::dequeue(uint affinity) {
result = remove(); result = remove();
} }
if (TraceGCTaskQueue) { if (TraceGCTaskQueue) {
tty->print_cr(" return: " INTPTR_FORMAT, result); tty->print_cr(" return: " INTPTR_FORMAT, p2i(result));
print("after:"); print("after:");
} }
return result; return result;
@ -345,7 +343,7 @@ void GCTaskQueue::print(const char* message) const {
" remove_end: " INTPTR_FORMAT " remove_end: " INTPTR_FORMAT
" length: %d" " length: %d"
" %s", " %s",
this, insert_end(), remove_end(), length(), message); p2i(this), p2i(insert_end()), p2i(remove_end()), length(), message);
uint count = 0; uint count = 0;
for (GCTask* element = insert_end(); for (GCTask* element = insert_end();
element != NULL; element != NULL;
@ -486,7 +484,7 @@ void GCTaskManager::set_active_gang() {
assert(!all_workers_active() || active_workers() == ParallelGCThreads, assert(!all_workers_active() || active_workers() == ParallelGCThreads,
err_msg("all_workers_active() is incorrect: " err_msg("all_workers_active() is incorrect: "
"active %d ParallelGCThreads %d", active_workers(), "active %d ParallelGCThreads " UINTX_FORMAT, active_workers(),
ParallelGCThreads)); ParallelGCThreads));
if (TraceDynamicGCThreads) { if (TraceDynamicGCThreads) {
gclog_or_tty->print_cr("GCTaskManager::set_active_gang(): " gclog_or_tty->print_cr("GCTaskManager::set_active_gang(): "
@ -598,7 +596,7 @@ void GCTaskManager::add_task(GCTask* task) {
MutexLockerEx ml(monitor(), Mutex::_no_safepoint_check_flag); MutexLockerEx ml(monitor(), Mutex::_no_safepoint_check_flag);
if (TraceGCTaskManager) { if (TraceGCTaskManager) {
tty->print_cr("GCTaskManager::add_task(" INTPTR_FORMAT " [%s])", tty->print_cr("GCTaskManager::add_task(" INTPTR_FORMAT " [%s])",
task, GCTask::Kind::to_string(task->kind())); p2i(task), GCTask::Kind::to_string(task->kind()));
} }
queue()->enqueue(task); queue()->enqueue(task);
// Notify with the lock held to avoid missed notifies. // Notify with the lock held to avoid missed notifies.
@ -678,7 +676,7 @@ GCTask* GCTaskManager::get_task(uint which) {
assert(result != NULL, "shouldn't have null task"); assert(result != NULL, "shouldn't have null task");
if (TraceGCTaskManager) { if (TraceGCTaskManager) {
tty->print_cr("GCTaskManager::get_task(%u) => " INTPTR_FORMAT " [%s]", tty->print_cr("GCTaskManager::get_task(%u) => " INTPTR_FORMAT " [%s]",
which, result, GCTask::Kind::to_string(result->kind())); which, p2i(result), GCTask::Kind::to_string(result->kind()));
tty->print_cr(" %s", result->name()); tty->print_cr(" %s", result->name());
} }
if (!result->is_idle_task()) { if (!result->is_idle_task()) {
@ -864,7 +862,7 @@ void IdleGCTask::do_it(GCTaskManager* manager, uint which) {
tty->print_cr("[" INTPTR_FORMAT "]" tty->print_cr("[" INTPTR_FORMAT "]"
" IdleGCTask:::do_it()" " IdleGCTask:::do_it()"
" should_wait: %s", " should_wait: %s",
this, wait_for_task->should_wait() ? "true" : "false"); p2i(this), wait_for_task->should_wait() ? "true" : "false");
} }
MutexLockerEx ml(manager->monitor(), Mutex::_no_safepoint_check_flag); MutexLockerEx ml(manager->monitor(), Mutex::_no_safepoint_check_flag);
if (TraceDynamicGCThreads) { if (TraceDynamicGCThreads) {
@ -878,7 +876,7 @@ void IdleGCTask::do_it(GCTaskManager* manager, uint which) {
tty->print_cr("[" INTPTR_FORMAT "]" tty->print_cr("[" INTPTR_FORMAT "]"
" IdleGCTask::do_it()" " IdleGCTask::do_it()"
" [" INTPTR_FORMAT "] (%s)->wait()", " [" INTPTR_FORMAT "] (%s)->wait()",
this, manager->monitor(), manager->monitor()->name()); p2i(this), p2i(manager->monitor()), manager->monitor()->name());
} }
manager->monitor()->wait(Mutex::_no_safepoint_check_flag, 0); manager->monitor()->wait(Mutex::_no_safepoint_check_flag, 0);
} }
@ -890,7 +888,7 @@ void IdleGCTask::do_it(GCTaskManager* manager, uint which) {
tty->print_cr("[" INTPTR_FORMAT "]" tty->print_cr("[" INTPTR_FORMAT "]"
" IdleGCTask::do_it() returns" " IdleGCTask::do_it() returns"
" should_wait: %s", " should_wait: %s",
this, wait_for_task->should_wait() ? "true" : "false"); p2i(this), wait_for_task->should_wait() ? "true" : "false");
} }
// Release monitor(). // Release monitor().
} }
@ -1000,7 +998,7 @@ WaitForBarrierGCTask::WaitForBarrierGCTask(bool on_c_heap) :
tty->print_cr("[" INTPTR_FORMAT "]" tty->print_cr("[" INTPTR_FORMAT "]"
" WaitForBarrierGCTask::WaitForBarrierGCTask()" " WaitForBarrierGCTask::WaitForBarrierGCTask()"
" monitor: " INTPTR_FORMAT, " monitor: " INTPTR_FORMAT,
this, monitor()); p2i(this), p2i(monitor()));
} }
} }
@ -1011,9 +1009,9 @@ void WaitForBarrierGCTask::destroy(WaitForBarrierGCTask* that) {
" WaitForBarrierGCTask::destroy()" " WaitForBarrierGCTask::destroy()"
" is_c_heap_obj: %s" " is_c_heap_obj: %s"
" monitor: " INTPTR_FORMAT, " monitor: " INTPTR_FORMAT,
that, p2i(that),
that->is_c_heap_obj() ? "true" : "false", that->is_c_heap_obj() ? "true" : "false",
that->monitor()); p2i(that->monitor()));
} }
that->destruct(); that->destruct();
if (that->is_c_heap_obj()) { if (that->is_c_heap_obj()) {
@ -1028,7 +1026,7 @@ void WaitForBarrierGCTask::destruct() {
tty->print_cr("[" INTPTR_FORMAT "]" tty->print_cr("[" INTPTR_FORMAT "]"
" WaitForBarrierGCTask::destruct()" " WaitForBarrierGCTask::destruct()"
" monitor: " INTPTR_FORMAT, " monitor: " INTPTR_FORMAT,
this, monitor()); p2i(this), p2i(monitor()));
} }
this->BarrierGCTask::destruct(); this->BarrierGCTask::destruct();
// Clean up that should be in the destructor, // Clean up that should be in the destructor,
@ -1044,7 +1042,7 @@ void WaitForBarrierGCTask::do_it(GCTaskManager* manager, uint which) {
tty->print_cr("[" INTPTR_FORMAT "]" tty->print_cr("[" INTPTR_FORMAT "]"
" WaitForBarrierGCTask::do_it() waiting for idle" " WaitForBarrierGCTask::do_it() waiting for idle"
" monitor: " INTPTR_FORMAT, " monitor: " INTPTR_FORMAT,
this, monitor()); p2i(this), p2i(monitor()));
} }
{ {
// First, wait for the barrier to arrive. // First, wait for the barrier to arrive.
@ -1062,7 +1060,7 @@ void WaitForBarrierGCTask::do_it(GCTaskManager* manager, uint which) {
tty->print_cr("[" INTPTR_FORMAT "]" tty->print_cr("[" INTPTR_FORMAT "]"
" WaitForBarrierGCTask::do_it()" " WaitForBarrierGCTask::do_it()"
" [" INTPTR_FORMAT "] (%s)->notify_all()", " [" INTPTR_FORMAT "] (%s)->notify_all()",
this, monitor(), monitor()->name()); p2i(this), p2i(monitor()), monitor()->name());
} }
monitor()->notify_all(); monitor()->notify_all();
// Release monitor(). // Release monitor().
@ -1074,7 +1072,7 @@ void WaitForBarrierGCTask::wait_for(bool reset) {
tty->print_cr("[" INTPTR_FORMAT "]" tty->print_cr("[" INTPTR_FORMAT "]"
" WaitForBarrierGCTask::wait_for()" " WaitForBarrierGCTask::wait_for()"
" should_wait: %s", " should_wait: %s",
this, should_wait() ? "true" : "false"); p2i(this), should_wait() ? "true" : "false");
} }
{ {
// Grab the lock and check again. // Grab the lock and check again.
@ -1084,7 +1082,7 @@ void WaitForBarrierGCTask::wait_for(bool reset) {
tty->print_cr("[" INTPTR_FORMAT "]" tty->print_cr("[" INTPTR_FORMAT "]"
" WaitForBarrierGCTask::wait_for()" " WaitForBarrierGCTask::wait_for()"
" [" INTPTR_FORMAT "] (%s)->wait()", " [" INTPTR_FORMAT "] (%s)->wait()",
this, monitor(), monitor()->name()); p2i(this), p2i(monitor()), monitor()->name());
} }
monitor()->wait(Mutex::_no_safepoint_check_flag, 0); monitor()->wait(Mutex::_no_safepoint_check_flag, 0);
} }
@ -1096,7 +1094,7 @@ void WaitForBarrierGCTask::wait_for(bool reset) {
tty->print_cr("[" INTPTR_FORMAT "]" tty->print_cr("[" INTPTR_FORMAT "]"
" WaitForBarrierGCTask::wait_for() returns" " WaitForBarrierGCTask::wait_for() returns"
" should_wait: %s", " should_wait: %s",
this, should_wait() ? "true" : "false"); p2i(this), should_wait() ? "true" : "false");
} }
// Release monitor(). // Release monitor().
} }

View File

@ -34,8 +34,6 @@
#include "runtime/os.hpp" #include "runtime/os.hpp"
#include "runtime/thread.hpp" #include "runtime/thread.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
GCTaskThread::GCTaskThread(GCTaskManager* manager, GCTaskThread::GCTaskThread(GCTaskManager* manager,
uint which, uint which,
uint processor_id) : uint processor_id) :
@ -79,7 +77,7 @@ void GCTaskThread::print_task_time_stamps() {
tty->print_cr("GC-Thread %u entries: %d", id(), _time_stamp_index); tty->print_cr("GC-Thread %u entries: %d", id(), _time_stamp_index);
for(uint i=0; i<_time_stamp_index; i++) { for(uint i=0; i<_time_stamp_index; i++) {
GCTaskTimeStamp* time_stamp = time_stamp_at(i); GCTaskTimeStamp* time_stamp = time_stamp_at(i);
tty->print_cr("\t[ %s " INT64_FORMAT " " INT64_FORMAT " ]", tty->print_cr("\t[ %s " JLONG_FORMAT " " JLONG_FORMAT " ]",
time_stamp->name(), time_stamp->name(),
time_stamp->entry_time(), time_stamp->entry_time(),
time_stamp->exit_time()); time_stamp->exit_time());

View File

@ -27,6 +27,7 @@
#include "code/codeCache.hpp" #include "code/codeCache.hpp"
#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
#include "gc_implementation/parallelScavenge/pcTasks.hpp" #include "gc_implementation/parallelScavenge/pcTasks.hpp"
#include "gc_implementation/parallelScavenge/psCompactionManager.inline.hpp"
#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
#include "gc_implementation/shared/gcTimer.hpp" #include "gc_implementation/shared/gcTimer.hpp"
#include "gc_implementation/shared/gcTraceTime.hpp" #include "gc_implementation/shared/gcTraceTime.hpp"
@ -34,7 +35,6 @@
#include "memory/universe.hpp" #include "memory/universe.hpp"
#include "oops/objArrayKlass.inline.hpp" #include "oops/objArrayKlass.inline.hpp"
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
#include "oops/oop.pcgc.inline.hpp"
#include "prims/jvmtiExport.hpp" #include "prims/jvmtiExport.hpp"
#include "runtime/fprofiler.hpp" #include "runtime/fprofiler.hpp"
#include "runtime/jniHandles.hpp" #include "runtime/jniHandles.hpp"
@ -42,8 +42,6 @@
#include "runtime/vmThread.hpp" #include "runtime/vmThread.hpp"
#include "services/management.hpp" #include "services/management.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// //
// ThreadRootsMarkingTask // ThreadRootsMarkingTask
// //
@ -221,12 +219,11 @@ void StealMarkingTask::do_it(GCTaskManager* manager, uint which) {
int random_seed = 17; int random_seed = 17;
do { do {
while (ParCompactionManager::steal_objarray(which, &random_seed, task)) { while (ParCompactionManager::steal_objarray(which, &random_seed, task)) {
ObjArrayKlass* k = (ObjArrayKlass*)task.obj()->klass(); cm->follow_contents((objArrayOop)task.obj(), task.index());
k->oop_follow_contents(cm, task.obj(), task.index());
cm->follow_marking_stacks(); cm->follow_marking_stacks();
} }
while (ParCompactionManager::steal(which, &random_seed, obj)) { while (ParCompactionManager::steal(which, &random_seed, obj)) {
obj->follow_contents(cm); cm->follow_contents(obj);
cm->follow_marking_stacks(); cm->follow_marking_stacks();
} }
} while (!terminator()->offer_termination()); } while (!terminator()->offer_termination());
@ -257,7 +254,7 @@ void StealRegionCompactionTask::do_it(GCTaskManager* manager, uint which) {
which_stack_index = which; which_stack_index = which;
assert(manager->active_workers() == ParallelGCThreads, assert(manager->active_workers() == ParallelGCThreads,
err_msg("all_workers_active has been incorrectly set: " err_msg("all_workers_active has been incorrectly set: "
" active %d ParallelGCThreads %d", manager->active_workers(), " active %d ParallelGCThreads " UINTX_FORMAT, manager->active_workers(),
ParallelGCThreads)); ParallelGCThreads));
} else { } else {
which_stack_index = ParCompactionManager::pop_recycled_stack_index(); which_stack_index = ParCompactionManager::pop_recycled_stack_index();
@ -269,7 +266,7 @@ void StealRegionCompactionTask::do_it(GCTaskManager* manager, uint which) {
gclog_or_tty->print_cr("StealRegionCompactionTask::do_it " gclog_or_tty->print_cr("StealRegionCompactionTask::do_it "
"region_stack_index %d region_stack = " PTR_FORMAT " " "region_stack_index %d region_stack = " PTR_FORMAT " "
" empty (%d) use all workers %d", " empty (%d) use all workers %d",
which_stack_index, ParCompactionManager::region_list(which_stack_index), which_stack_index, p2i(ParCompactionManager::region_list(which_stack_index)),
cm->region_stack()->is_empty(), cm->region_stack()->is_empty(),
use_all_workers); use_all_workers);
} }
@ -336,7 +333,7 @@ void DrainStacksCompactionTask::do_it(GCTaskManager* manager, uint which) {
which_stack_index = which; which_stack_index = which;
assert(manager->active_workers() == ParallelGCThreads, assert(manager->active_workers() == ParallelGCThreads,
err_msg("all_workers_active has been incorrectly set: " err_msg("all_workers_active has been incorrectly set: "
" active %d ParallelGCThreads %d", manager->active_workers(), " active %d ParallelGCThreads " UINTX_FORMAT, manager->active_workers(),
ParallelGCThreads)); ParallelGCThreads));
} else { } else {
which_stack_index = stack_index(); which_stack_index = stack_index();
@ -370,7 +367,7 @@ void DrainStacksCompactionTask::do_it(GCTaskManager* manager, uint which) {
void* old_region_stack = (void*) cm->region_stack(); void* old_region_stack = (void*) cm->region_stack();
int old_region_stack_index = cm->region_stack_index(); int old_region_stack_index = cm->region_stack_index();
gclog_or_tty->print_cr("Pushing region stack " PTR_FORMAT "/%d", gclog_or_tty->print_cr("Pushing region stack " PTR_FORMAT "/%d",
old_region_stack, old_region_stack_index); p2i(old_region_stack), old_region_stack_index);
} }
cm->set_region_stack(NULL); cm->set_region_stack(NULL);

View File

@ -35,8 +35,6 @@
#include <math.h> #include <math.h>
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
PSAdaptiveSizePolicy::PSAdaptiveSizePolicy(size_t init_eden_size, PSAdaptiveSizePolicy::PSAdaptiveSizePolicy(size_t init_eden_size,
size_t init_promo_size, size_t init_promo_size,
size_t init_survivor_size, size_t init_survivor_size,

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -28,12 +28,11 @@
#include "gc_implementation/parallelScavenge/objectStartArray.hpp" #include "gc_implementation/parallelScavenge/objectStartArray.hpp"
#include "gc_implementation/parallelScavenge/parMarkBitMap.hpp" #include "gc_implementation/parallelScavenge/parMarkBitMap.hpp"
#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
#include "gc_implementation/parallelScavenge/psCompactionManager.hpp" #include "gc_implementation/parallelScavenge/psCompactionManager.inline.hpp"
#include "gc_implementation/parallelScavenge/psOldGen.hpp" #include "gc_implementation/parallelScavenge/psOldGen.hpp"
#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
#include "oops/objArrayKlass.inline.hpp" #include "oops/objArrayKlass.inline.hpp"
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
#include "oops/oop.pcgc.inline.hpp"
#include "runtime/atomic.inline.hpp" #include "runtime/atomic.inline.hpp"
#include "utilities/stack.inline.hpp" #include "utilities/stack.inline.hpp"
@ -180,17 +179,16 @@ void ParCompactionManager::follow_marking_stacks() {
// Drain the overflow stack first, to allow stealing from the marking stack. // Drain the overflow stack first, to allow stealing from the marking stack.
oop obj; oop obj;
while (marking_stack()->pop_overflow(obj)) { while (marking_stack()->pop_overflow(obj)) {
obj->follow_contents(this); follow_contents(obj);
} }
while (marking_stack()->pop_local(obj)) { while (marking_stack()->pop_local(obj)) {
obj->follow_contents(this); follow_contents(obj);
} }
// Process ObjArrays one at a time to avoid marking stack bloat. // Process ObjArrays one at a time to avoid marking stack bloat.
ObjArrayTask task; ObjArrayTask task;
if (_objarray_stack.pop_overflow(task) || _objarray_stack.pop_local(task)) { if (_objarray_stack.pop_overflow(task) || _objarray_stack.pop_local(task)) {
ObjArrayKlass* k = (ObjArrayKlass*)task.obj()->klass(); follow_contents((objArrayOop)task.obj(), task.index());
k->oop_follow_contents(this, task.obj(), task.index());
} }
} while (!marking_stacks_empty()); } while (!marking_stacks_empty());

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -196,6 +196,10 @@ private:
// Process tasks remaining on any stack // Process tasks remaining on any stack
void drain_region_stacks(); void drain_region_stacks();
void follow_contents(oop obj);
void follow_contents(objArrayOop array, int index);
void update_contents(oop obj);
}; };
inline ParCompactionManager* ParCompactionManager::manager_array(int index) { inline ParCompactionManager* ParCompactionManager::manager_array(int index) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2015 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -27,6 +27,8 @@
#include "gc_implementation/parallelScavenge/psCompactionManager.hpp" #include "gc_implementation/parallelScavenge/psCompactionManager.hpp"
#include "gc_implementation/parallelScavenge/psParallelCompact.hpp" #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
#include "oops/objArrayKlass.inline.hpp"
#include "oops/oop.pcgc.inline.hpp"
void ParCompactionManager::push_objarray(oop obj, size_t index) void ParCompactionManager::push_objarray(oop obj, size_t index)
{ {
@ -46,4 +48,17 @@ void ParCompactionManager::push_region(size_t index)
region_stack()->push(index); region_stack()->push(index);
} }
inline void ParCompactionManager::follow_contents(oop obj) {
obj->follow_contents(this);
}
inline void ParCompactionManager::follow_contents(objArrayOop obj, int index) {
ObjArrayKlass* k = (ObjArrayKlass*)obj->klass();
k->oop_follow_contents(this, obj, index);
}
inline void ParCompactionManager::update_contents(oop obj) {
obj->update_contents(this);
}
#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSCOMPACTIONMANAGER_INLINE_HPP #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSCOMPACTIONMANAGER_INLINE_HPP

View File

@ -54,8 +54,6 @@
#include "utilities/events.hpp" #include "utilities/events.hpp"
#include "utilities/stack.inline.hpp" #include "utilities/stack.inline.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
elapsedTimer PSMarkSweep::_accumulated_time; elapsedTimer PSMarkSweep::_accumulated_time;
jlong PSMarkSweep::_time_of_last_gc = 0; jlong PSMarkSweep::_time_of_last_gc = 0;
CollectorCounters* PSMarkSweep::_counters = NULL; CollectorCounters* PSMarkSweep::_counters = NULL;
@ -670,7 +668,7 @@ jlong PSMarkSweep::millis_since_last_gc() {
jlong ret_val = now - _time_of_last_gc; jlong ret_val = now - _time_of_last_gc;
// XXX See note in genCollectedHeap::millis_since_last_gc(). // XXX See note in genCollectedHeap::millis_since_last_gc().
if (ret_val < 0) { if (ret_val < 0) {
NOT_PRODUCT(warning("time warp: "INT64_FORMAT, ret_val);) NOT_PRODUCT(warning("time warp: " JLONG_FORMAT, ret_val);)
return 0; return 0;
} }
return ret_val; return ret_val;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -303,7 +303,7 @@ void PSMarkSweepDecorator::adjust_pointers() {
while (q < end) { while (q < end) {
// point all the oops to the new location // point all the oops to the new location
size_t size = oop(q)->adjust_pointers(); size_t size = MarkSweep::adjust_pointers(oop(q));
q += size; q += size;
} }
@ -324,7 +324,7 @@ void PSMarkSweepDecorator::adjust_pointers() {
if (oop(q)->is_gc_marked()) { if (oop(q)->is_gc_marked()) {
// q is alive // q is alive
// point all the oops to the new location // point all the oops to the new location
size_t size = oop(q)->adjust_pointers(); size_t size = MarkSweep::adjust_pointers(oop(q));
debug_only(prev_q = q); debug_only(prev_q = q);
q += size; q += size;
} else { } else {

View File

@ -33,8 +33,6 @@
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
#include "runtime/java.hpp" #include "runtime/java.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
inline const char* PSOldGen::select_name() { inline const char* PSOldGen::select_name() {
return UseParallelOldGC ? "ParOldGen" : "PSOldGen"; return UseParallelOldGC ? "ParOldGen" : "PSOldGen";
} }
@ -440,9 +438,9 @@ void PSOldGen::print_on(outputStream* st) const {
capacity_in_bytes()/K, used_in_bytes()/K); capacity_in_bytes()/K, used_in_bytes()/K);
} }
st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")", st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")",
virtual_space()->low_boundary(), p2i(virtual_space()->low_boundary()),
virtual_space()->high(), p2i(virtual_space()->high()),
virtual_space()->high_boundary()); p2i(virtual_space()->high_boundary()));
st->print(" object"); object_space()->print_on(st); st->print(" object"); object_space()->print_on(st);
} }

View File

@ -50,7 +50,6 @@
#include "memory/referenceProcessor.hpp" #include "memory/referenceProcessor.hpp"
#include "oops/methodData.hpp" #include "oops/methodData.hpp"
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
#include "oops/oop.pcgc.inline.hpp"
#include "runtime/atomic.inline.hpp" #include "runtime/atomic.inline.hpp"
#include "runtime/fprofiler.hpp" #include "runtime/fprofiler.hpp"
#include "runtime/safepoint.hpp" #include "runtime/safepoint.hpp"
@ -63,8 +62,6 @@
#include <math.h> #include <math.h>
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// All sizes are in HeapWords. // All sizes are in HeapWords.
const size_t ParallelCompactData::Log2RegionSize = 16; // 64K words const size_t ParallelCompactData::Log2RegionSize = 16; // 64K words
const size_t ParallelCompactData::RegionSize = (size_t)1 << Log2RegionSize; const size_t ParallelCompactData::RegionSize = (size_t)1 << Log2RegionSize;
@ -223,7 +220,7 @@ print_generic_summary_region(size_t i, const ParallelCompactData::RegionData* c)
REGION_IDX_FORMAT " " PTR_FORMAT " " REGION_IDX_FORMAT " " PTR_FORMAT " "
REGION_DATA_FORMAT " " REGION_DATA_FORMAT " " REGION_DATA_FORMAT " " REGION_DATA_FORMAT " "
REGION_DATA_FORMAT " " REGION_IDX_FORMAT " %d", REGION_DATA_FORMAT " " REGION_IDX_FORMAT " %d",
i, c->data_location(), dci, c->destination(), i, p2i(c->data_location()), dci, p2i(c->destination()),
c->partial_obj_size(), c->live_obj_size(), c->partial_obj_size(), c->live_obj_size(),
c->data_size(), c->source_region(), c->destination_count()); c->data_size(), c->source_region(), c->destination_count());
@ -273,7 +270,7 @@ print_initial_summary_region(size_t i,
tty->print(SIZE_FORMAT_W(5) " " PTR_FORMAT " " tty->print(SIZE_FORMAT_W(5) " " PTR_FORMAT " "
SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " "
SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " %d", SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " %d",
i, c->destination(), i, p2i(c->destination()),
c->partial_obj_size(), c->live_obj_size(), c->partial_obj_size(), c->live_obj_size(),
c->data_size(), c->source_region(), c->destination_count()); c->data_size(), c->source_region(), c->destination_count());
if (newline) tty->cr(); if (newline) tty->cr();
@ -634,13 +631,13 @@ ParallelCompactData::summarize_split_space(size_t src_region,
const char * split_type = partial_obj_size == 0 ? "easy" : "hard"; const char * split_type = partial_obj_size == 0 ? "easy" : "hard";
gclog_or_tty->print_cr("%s split: src=" PTR_FORMAT " src_c=" SIZE_FORMAT gclog_or_tty->print_cr("%s split: src=" PTR_FORMAT " src_c=" SIZE_FORMAT
" pos=" SIZE_FORMAT, " pos=" SIZE_FORMAT,
split_type, source_next, split_region, split_type, p2i(source_next), split_region,
partial_obj_size); partial_obj_size);
gclog_or_tty->print_cr("%s split: dst=" PTR_FORMAT " dst_c=" SIZE_FORMAT gclog_or_tty->print_cr("%s split: dst=" PTR_FORMAT " dst_c=" SIZE_FORMAT
" tn=" PTR_FORMAT, " tn=" PTR_FORMAT,
split_type, split_destination, split_type, p2i(split_destination),
addr_to_region_idx(split_destination), addr_to_region_idx(split_destination),
*target_next); p2i(*target_next));
if (partial_obj_size != 0) { if (partial_obj_size != 0) {
HeapWord* const po_beg = split_info.destination(); HeapWord* const po_beg = split_info.destination();
@ -649,8 +646,8 @@ ParallelCompactData::summarize_split_space(size_t src_region,
"po_beg=" PTR_FORMAT " " SIZE_FORMAT " " "po_beg=" PTR_FORMAT " " SIZE_FORMAT " "
"po_end=" PTR_FORMAT " " SIZE_FORMAT, "po_end=" PTR_FORMAT " " SIZE_FORMAT,
split_type, split_type,
po_beg, addr_to_region_idx(po_beg), p2i(po_beg), addr_to_region_idx(po_beg),
po_end, addr_to_region_idx(po_end)); p2i(po_end), addr_to_region_idx(po_end));
} }
} }
@ -667,8 +664,8 @@ bool ParallelCompactData::summarize(SplitInfo& split_info,
HeapWord* const source_next_val = source_next == NULL ? NULL : *source_next; HeapWord* const source_next_val = source_next == NULL ? NULL : *source_next;
tty->print_cr("sb=" PTR_FORMAT " se=" PTR_FORMAT " sn=" PTR_FORMAT tty->print_cr("sb=" PTR_FORMAT " se=" PTR_FORMAT " sn=" PTR_FORMAT
"tb=" PTR_FORMAT " te=" PTR_FORMAT " tn=" PTR_FORMAT, "tb=" PTR_FORMAT " te=" PTR_FORMAT " tn=" PTR_FORMAT,
source_beg, source_end, source_next_val, p2i(source_beg), p2i(source_end), p2i(source_next_val),
target_beg, target_end, *target_next); p2i(target_beg), p2i(target_end), p2i(*target_next));
} }
size_t cur_region = addr_to_region_idx(source_beg); size_t cur_region = addr_to_region_idx(source_beg);
@ -1133,9 +1130,9 @@ PSParallelCompact::compute_dense_prefix_via_density(const SpaceId id,
const size_t cur_deadwood = pointer_delta(dense_prefix, region_destination); const size_t cur_deadwood = pointer_delta(dense_prefix, region_destination);
if (TraceParallelOldGCDensePrefix && Verbose) { if (TraceParallelOldGCDensePrefix && Verbose) {
tty->print_cr("c#=" SIZE_FORMAT_W(4) " dst=" PTR_FORMAT " " tty->print_cr("c#=" SIZE_FORMAT_W(4) " dst=" PTR_FORMAT " "
"dp=" SIZE_FORMAT_W(8) " " "cdw=" SIZE_FORMAT_W(8), "dp=" PTR_FORMAT " " "cdw=" SIZE_FORMAT_W(8),
sd.region(cp), region_destination, sd.region(cp), p2i(region_destination),
dense_prefix, cur_deadwood); p2i(dense_prefix), cur_deadwood);
} }
if (cur_deadwood >= deadwood_goal) { if (cur_deadwood >= deadwood_goal) {
@ -1201,7 +1198,7 @@ void PSParallelCompact::print_dense_prefix_stats(const char* const algorithm,
"d2l=" SIZE_FORMAT " d2l%%=%6.4f " "d2l=" SIZE_FORMAT " d2l%%=%6.4f "
"d2r=" SIZE_FORMAT " l2r=" SIZE_FORMAT "d2r=" SIZE_FORMAT " l2r=" SIZE_FORMAT
" ratio=%10.8f", " ratio=%10.8f",
algorithm, addr, region_idx, algorithm, p2i(addr), region_idx,
space_live, space_live,
dead_to_left, dead_to_left_pct, dead_to_left, dead_to_left_pct,
dead_to_right, live_to_right, dead_to_right, live_to_right,
@ -1469,7 +1466,7 @@ PSParallelCompact::fill_with_live_objects(SpaceId id, HeapWord* const start,
{ {
if (TraceParallelOldGCSummaryPhase) { if (TraceParallelOldGCSummaryPhase) {
tty->print_cr("fill_with_live_objects [" PTR_FORMAT " " PTR_FORMAT ") " tty->print_cr("fill_with_live_objects [" PTR_FORMAT " " PTR_FORMAT ") "
SIZE_FORMAT, start, start + words, words); SIZE_FORMAT, p2i(start), p2i(start + words), words);
} }
ObjectStartArray* const start_array = _space_info[id].start_array(); ObjectStartArray* const start_array = _space_info[id].start_array();
@ -1811,9 +1808,9 @@ PSParallelCompact::summarize_space(SpaceId id, bool maximum_compaction)
tty->print_cr("id=%d cap=" SIZE_FORMAT " dp=" PTR_FORMAT " " tty->print_cr("id=%d cap=" SIZE_FORMAT " dp=" PTR_FORMAT " "
"dp_region=" SIZE_FORMAT " " "dp_count=" SIZE_FORMAT " " "dp_region=" SIZE_FORMAT " " "dp_count=" SIZE_FORMAT " "
"cr_count=" SIZE_FORMAT " " "nt=" PTR_FORMAT, "cr_count=" SIZE_FORMAT " " "nt=" PTR_FORMAT,
id, space->capacity_in_words(), dense_prefix_end, id, space->capacity_in_words(), p2i(dense_prefix_end),
dp_region, dp_words / region_size, dp_region, dp_words / region_size,
cr_words / region_size, new_top); cr_words / region_size, p2i(new_top));
} }
} }
@ -1831,10 +1828,10 @@ void PSParallelCompact::summary_phase_msg(SpaceId dst_space_id,
SIZE_FORMAT "-" SIZE_FORMAT, SIZE_FORMAT "-" SIZE_FORMAT,
src_space_id, space_names[src_space_id], src_space_id, space_names[src_space_id],
dst_space_id, space_names[dst_space_id], dst_space_id, space_names[dst_space_id],
src_beg, src_end, p2i(src_beg), p2i(src_end),
_summary_data.addr_to_region_idx(src_beg), _summary_data.addr_to_region_idx(src_beg),
_summary_data.addr_to_region_idx(src_end), _summary_data.addr_to_region_idx(src_end),
dst_beg, dst_end, p2i(dst_beg), p2i(dst_end),
_summary_data.addr_to_region_idx(dst_beg), _summary_data.addr_to_region_idx(dst_beg),
_summary_data.addr_to_region_idx(dst_end)); _summary_data.addr_to_region_idx(dst_end));
} }
@ -2234,8 +2231,8 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
heap->trace_heap_after_gc(&_gc_tracer); heap->trace_heap_after_gc(&_gc_tracer);
if (PrintGCTaskTimeStamps) { if (PrintGCTaskTimeStamps) {
gclog_or_tty->print_cr("VM-Thread " INT64_FORMAT " " INT64_FORMAT " " gclog_or_tty->print_cr("VM-Thread " JLONG_FORMAT " " JLONG_FORMAT " "
INT64_FORMAT, JLONG_FORMAT,
marking_start.ticks(), compaction_start.ticks(), marking_start.ticks(), compaction_start.ticks(),
collection_exit.ticks()); collection_exit.ticks());
gc_task_manager()->print_task_time_stamps(); gc_task_manager()->print_task_time_stamps();
@ -2754,7 +2751,7 @@ void PSParallelCompact::verify_complete(SpaceId space_id) {
const RegionData* const c = sd.region(cur_region); const RegionData* const c = sd.region(cur_region);
if (!c->completed()) { if (!c->completed()) {
warning("region " SIZE_FORMAT " not filled: " warning("region " SIZE_FORMAT " not filled: "
"destination_count=" SIZE_FORMAT, "destination_count=%u",
cur_region, c->destination_count()); cur_region, c->destination_count());
issued_a_warning = true; issued_a_warning = true;
} }
@ -2764,7 +2761,7 @@ void PSParallelCompact::verify_complete(SpaceId space_id) {
const RegionData* const c = sd.region(cur_region); const RegionData* const c = sd.region(cur_region);
if (!c->available()) { if (!c->available()) {
warning("region " SIZE_FORMAT " not empty: " warning("region " SIZE_FORMAT " not empty: "
"destination_count=" SIZE_FORMAT, "destination_count=%u",
cur_region, c->destination_count()); cur_region, c->destination_count());
issued_a_warning = true; issued_a_warning = true;
} }
@ -2776,6 +2773,11 @@ void PSParallelCompact::verify_complete(SpaceId space_id) {
} }
#endif // #ifdef ASSERT #endif // #ifdef ASSERT
inline void UpdateOnlyClosure::do_addr(HeapWord* addr) {
_start_array->allocate_block(addr);
compaction_manager()->update_contents(oop(addr));
}
// Update interior oops in the ranges of regions [beg_region, end_region). // Update interior oops in the ranges of regions [beg_region, end_region).
void void
PSParallelCompact::update_and_deadwood_in_dense_prefix(ParCompactionManager* cm, PSParallelCompact::update_and_deadwood_in_dense_prefix(ParCompactionManager* cm,
@ -2876,7 +2878,7 @@ void PSParallelCompact::update_deferred_objects(ParCompactionManager* cm,
if (start_array != NULL) { if (start_array != NULL) {
start_array->allocate_block(addr); start_array->allocate_block(addr);
} }
oop(addr)->update_contents(cm); cm->update_contents(oop(addr));
assert(oop(addr)->is_oop_or_null(), err_msg("Expected an oop or NULL at " PTR_FORMAT, p2i(oop(addr)))); assert(oop(addr)->is_oop_or_null(), err_msg("Expected an oop or NULL at " PTR_FORMAT, p2i(oop(addr))));
} }
} }
@ -3294,7 +3296,7 @@ jlong PSParallelCompact::millis_since_last_gc() {
jlong ret_val = now - _time_of_last_gc; jlong ret_val = now - _time_of_last_gc;
// XXX See note in genCollectedHeap::millis_since_last_gc(). // XXX See note in genCollectedHeap::millis_since_last_gc().
if (ret_val < 0) { if (ret_val < 0) {
NOT_PRODUCT(warning("time warp: "INT64_FORMAT, ret_val);) NOT_PRODUCT(warning("time warp: " JLONG_FORMAT, ret_val);)
return 0; return 0;
} }
return ret_val; return ret_val;
@ -3360,7 +3362,7 @@ MoveAndUpdateClosure::do_addr(HeapWord* addr, size_t words) {
} }
oop moved_oop = (oop) destination(); oop moved_oop = (oop) destination();
moved_oop->update_contents(compaction_manager()); compaction_manager()->update_contents(moved_oop);
assert(moved_oop->is_oop_or_null(), err_msg("Expected an oop or NULL at " PTR_FORMAT, p2i(moved_oop))); assert(moved_oop->is_oop_or_null(), err_msg("Expected an oop or NULL at " PTR_FORMAT, p2i(moved_oop)));
update_state(words); update_state(words);

View File

@ -1025,9 +1025,6 @@ class PSParallelCompact : AllStatic {
bool maximum_heap_compaction, bool maximum_heap_compaction,
ParallelOldTracer *gc_tracer); ParallelOldTracer *gc_tracer);
template <class T>
static inline void follow_root(ParCompactionManager* cm, T* p);
// Compute the dense prefix for the designated space. This is an experimental // Compute the dense prefix for the designated space. This is an experimental
// implementation currently not used in production. // implementation currently not used in production.
static HeapWord* compute_dense_prefix_via_density(const SpaceId id, static HeapWord* compute_dense_prefix_via_density(const SpaceId id,
@ -1335,23 +1332,6 @@ inline bool PSParallelCompact::is_marked(oop obj) {
return mark_bitmap()->is_marked(obj); return mark_bitmap()->is_marked(obj);
} }
template <class T>
inline void PSParallelCompact::follow_root(ParCompactionManager* cm, T* p) {
assert(!Universe::heap()->is_in_reserved(p),
"roots shouldn't be things within the heap");
T heap_oop = oopDesc::load_heap_oop(p);
if (!oopDesc::is_null(heap_oop)) {
oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
if (mark_bitmap()->is_unmarked(obj)) {
if (mark_obj(obj)) {
obj->follow_contents(cm);
}
}
}
cm->follow_marking_stacks();
}
template <class T> template <class T>
inline void PSParallelCompact::mark_and_push(ParCompactionManager* cm, T* p) { inline void PSParallelCompact::mark_and_push(ParCompactionManager* cm, T* p) {
T heap_oop = oopDesc::load_heap_oop(p); T heap_oop = oopDesc::load_heap_oop(p);
@ -1524,12 +1504,6 @@ class UpdateOnlyClosure: public ParMarkBitMapClosure {
inline void do_addr(HeapWord* addr); inline void do_addr(HeapWord* addr);
}; };
inline void UpdateOnlyClosure::do_addr(HeapWord* addr)
{
_start_array->allocate_block(addr);
oop(addr)->update_contents(compaction_manager());
}
class FillClosure: public ParMarkBitMapClosure class FillClosure: public ParMarkBitMapClosure
{ {
public: public:

View File

@ -33,11 +33,8 @@
#include "memory/memRegion.hpp" #include "memory/memRegion.hpp"
#include "memory/padded.inline.hpp" #include "memory/padded.inline.hpp"
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
#include "oops/oop.psgc.inline.hpp"
#include "utilities/stack.inline.hpp" #include "utilities/stack.inline.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
PaddedEnd<PSPromotionManager>* PSPromotionManager::_manager_array = NULL; PaddedEnd<PSPromotionManager>* PSPromotionManager::_manager_array = NULL;
OopStarTaskQueueSet* PSPromotionManager::_stack_array_depth = NULL; OopStarTaskQueueSet* PSPromotionManager::_stack_array_depth = NULL;
PSOldGen* PSPromotionManager::_old_gen = NULL; PSOldGen* PSPromotionManager::_old_gen = NULL;
@ -325,7 +322,7 @@ oop PSPromotionManager::oop_promotion_failed(oop obj, markOop obj_mark) {
_promotion_failed_info.register_copy_failure(obj->size()); _promotion_failed_info.register_copy_failure(obj->size());
obj->push_contents(this); push_contents(obj);
// Save the mark if needed // Save the mark if needed
PSScavenge::oop_promotion_failed(obj, obj_mark); PSScavenge::oop_promotion_failed(obj, obj_mark);
@ -342,7 +339,7 @@ oop PSPromotionManager::oop_promotion_failed(oop obj, markOop obj_mark) {
gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " (%d)}", gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " (%d)}",
"promotion-failure", "promotion-failure",
obj->klass()->internal_name(), obj->klass()->internal_name(),
(void *)obj, obj->size()); p2i(obj), obj->size());
} }
#endif #endif

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -212,6 +212,8 @@ class PSPromotionManager VALUE_OBJ_CLASS_SPEC {
template <class T> inline void claim_or_forward_depth(T* p); template <class T> inline void claim_or_forward_depth(T* p);
TASKQUEUE_STATS_ONLY(inline void record_steal(StarTask& p);) TASKQUEUE_STATS_ONLY(inline void record_steal(StarTask& p);)
void push_contents(oop obj);
}; };
#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_HPP #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_HPP

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -91,6 +91,9 @@ inline void PSPromotionManager::promotion_trace_event(oop new_obj, oop old_obj,
} }
} }
inline void PSPromotionManager::push_contents(oop obj) {
obj->push_contents(this);
}
// //
// This method is pretty bulky. It would be nice to split it up // This method is pretty bulky. It would be nice to split it up
// into smaller submethods, but we need to be careful not to hurt // into smaller submethods, but we need to be careful not to hurt
@ -227,7 +230,7 @@ oop PSPromotionManager::copy_to_survivor_space(oop o) {
TASKQUEUE_STATS_ONLY(++_arrays_chunked; ++_masked_pushes); TASKQUEUE_STATS_ONLY(++_arrays_chunked; ++_masked_pushes);
} else { } else {
// we'll just push its contents // we'll just push its contents
new_obj->push_contents(this); push_contents(new_obj);
} }
} else { } else {
// We lost, someone else "owns" this object // We lost, someone else "owns" this object

View File

@ -46,7 +46,6 @@
#include "memory/referenceProcessor.hpp" #include "memory/referenceProcessor.hpp"
#include "memory/resourceArea.hpp" #include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
#include "oops/oop.psgc.inline.hpp"
#include "runtime/biasedLocking.hpp" #include "runtime/biasedLocking.hpp"
#include "runtime/fprofiler.hpp" #include "runtime/fprofiler.hpp"
#include "runtime/handles.inline.hpp" #include "runtime/handles.inline.hpp"
@ -56,8 +55,6 @@
#include "services/memoryService.hpp" #include "services/memoryService.hpp"
#include "utilities/stack.inline.hpp" #include "utilities/stack.inline.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
HeapWord* PSScavenge::_to_space_top_before_gc = NULL; HeapWord* PSScavenge::_to_space_top_before_gc = NULL;
int PSScavenge::_consecutive_skipped_scavenges = 0; int PSScavenge::_consecutive_skipped_scavenges = 0;
ReferenceProcessor* PSScavenge::_ref_processor = NULL; ReferenceProcessor* PSScavenge::_ref_processor = NULL;
@ -551,8 +548,8 @@ bool PSScavenge::invoke_no_policy() {
if (PrintTenuringDistribution) { if (PrintTenuringDistribution) {
gclog_or_tty->cr(); gclog_or_tty->cr();
gclog_or_tty->print_cr("Desired survivor size " SIZE_FORMAT " bytes, new threshold " gclog_or_tty->print_cr("Desired survivor size " SIZE_FORMAT " bytes, new threshold %u"
UINTX_FORMAT " (max threshold " UINTX_FORMAT ")", " (max threshold " UINTX_FORMAT ")",
size_policy->calculated_survivor_size_in_bytes(), size_policy->calculated_survivor_size_in_bytes(),
_tenuring_threshold, MaxTenuringThreshold); _tenuring_threshold, MaxTenuringThreshold);
} }
@ -694,7 +691,7 @@ bool PSScavenge::invoke_no_policy() {
scavenge_exit.update(); scavenge_exit.update();
if (PrintGCTaskTimeStamps) { if (PrintGCTaskTimeStamps) {
tty->print_cr("VM-Thread " INT64_FORMAT " " INT64_FORMAT " " INT64_FORMAT, tty->print_cr("VM-Thread " JLONG_FORMAT " " JLONG_FORMAT " " JLONG_FORMAT,
scavenge_entry.ticks(), scavenge_midpoint.ticks(), scavenge_entry.ticks(), scavenge_midpoint.ticks(),
scavenge_exit.ticks()); scavenge_exit.ticks());
gc_task_manager()->print_task_time_stamps(); gc_task_manager()->print_task_time_stamps();

View File

@ -35,7 +35,6 @@
#include "memory/iterator.hpp" #include "memory/iterator.hpp"
#include "memory/universe.hpp" #include "memory/universe.hpp"
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
#include "oops/oop.psgc.inline.hpp"
#include "runtime/fprofiler.hpp" #include "runtime/fprofiler.hpp"
#include "runtime/thread.hpp" #include "runtime/thread.hpp"
#include "runtime/vmThread.hpp" #include "runtime/vmThread.hpp"

View File

@ -27,8 +27,6 @@
#include "runtime/os.hpp" #include "runtime/os.hpp"
#include "runtime/virtualspace.hpp" #include "runtime/virtualspace.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// PSVirtualSpace // PSVirtualSpace
PSVirtualSpace::PSVirtualSpace(ReservedSpace rs, size_t alignment) : PSVirtualSpace::PSVirtualSpace(ReservedSpace rs, size_t alignment) :
@ -218,22 +216,22 @@ void PSVirtualSpace::verify() const {
void PSVirtualSpace::print() const { void PSVirtualSpace::print() const {
gclog_or_tty->print_cr("virtual space [" PTR_FORMAT "]: alignment=" gclog_or_tty->print_cr("virtual space [" PTR_FORMAT "]: alignment="
SIZE_FORMAT "K grows %s%s", SIZE_FORMAT "K grows %s%s",
this, alignment() / K, grows_up() ? "up" : "down", p2i(this), alignment() / K, grows_up() ? "up" : "down",
special() ? " (pinned in memory)" : ""); special() ? " (pinned in memory)" : "");
gclog_or_tty->print_cr(" reserved=" SIZE_FORMAT "K" gclog_or_tty->print_cr(" reserved=" SIZE_FORMAT "K"
" [" PTR_FORMAT "," PTR_FORMAT "]" " [" PTR_FORMAT "," PTR_FORMAT "]"
" committed=" SIZE_FORMAT "K" " committed=" SIZE_FORMAT "K"
" [" PTR_FORMAT "," PTR_FORMAT "]", " [" PTR_FORMAT "," PTR_FORMAT "]",
reserved_size() / K, reserved_size() / K,
reserved_low_addr(), reserved_high_addr(), p2i(reserved_low_addr()), p2i(reserved_high_addr()),
committed_size() / K, committed_size() / K,
committed_low_addr(), committed_high_addr()); p2i(committed_low_addr()), p2i(committed_high_addr()));
} }
#endif // #ifndef PRODUCT #endif // #ifndef PRODUCT
void PSVirtualSpace::print_space_boundaries_on(outputStream* st) const { void PSVirtualSpace::print_space_boundaries_on(outputStream* st) const {
st->print_cr(" [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ")", st->print_cr(" [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ")",
low_boundary(), high(), high_boundary()); p2i(low_boundary()), p2i(high()), p2i(high_boundary()));
} }
PSVirtualSpaceHighToLow::PSVirtualSpaceHighToLow(ReservedSpace rs, PSVirtualSpaceHighToLow::PSVirtualSpaceHighToLow(ReservedSpace rs,
@ -350,5 +348,5 @@ size_t PSVirtualSpaceHighToLow::expand_into(PSVirtualSpace* other_space,
void void
PSVirtualSpaceHighToLow::print_space_boundaries_on(outputStream* st) const { PSVirtualSpaceHighToLow::print_space_boundaries_on(outputStream* st) const {
st->print_cr(" (" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT "]", st->print_cr(" (" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT "]",
high_boundary(), low(), low_boundary()); p2i(high_boundary()), p2i(low()), p2i(low_boundary()));
} }

View File

@ -33,8 +33,6 @@
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
#include "runtime/java.hpp" #include "runtime/java.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
PSYoungGen::PSYoungGen(size_t initial_size, PSYoungGen::PSYoungGen(size_t initial_size,
size_t min_size, size_t min_size,
size_t max_size) : size_t max_size) :
@ -419,20 +417,22 @@ void PSYoungGen::mangle_survivors(MutableSpace* s1,
// s1 // s1
gclog_or_tty->print_cr("Current region: [" PTR_FORMAT ", " PTR_FORMAT ") " gclog_or_tty->print_cr("Current region: [" PTR_FORMAT ", " PTR_FORMAT ") "
"New region: [" PTR_FORMAT ", " PTR_FORMAT ")", "New region: [" PTR_FORMAT ", " PTR_FORMAT ")",
s1->bottom(), s1->end(), s1MR.start(), s1MR.end()); p2i(s1->bottom()), p2i(s1->end()),
p2i(s1MR.start()), p2i(s1MR.end()));
gclog_or_tty->print_cr(" Mangle before: [" PTR_FORMAT ", " gclog_or_tty->print_cr(" Mangle before: [" PTR_FORMAT ", "
PTR_FORMAT ") Mangle after: [" PTR_FORMAT ", " PTR_FORMAT ")", PTR_FORMAT ") Mangle after: [" PTR_FORMAT ", " PTR_FORMAT ")",
delta1_left.start(), delta1_left.end(), delta1_right.start(), p2i(delta1_left.start()), p2i(delta1_left.end()),
delta1_right.end()); p2i(delta1_right.start()), p2i(delta1_right.end()));
// s2 // s2
gclog_or_tty->print_cr("Current region: [" PTR_FORMAT ", " PTR_FORMAT ") " gclog_or_tty->print_cr("Current region: [" PTR_FORMAT ", " PTR_FORMAT ") "
"New region: [" PTR_FORMAT ", " PTR_FORMAT ")", "New region: [" PTR_FORMAT ", " PTR_FORMAT ")",
s2->bottom(), s2->end(), s2MR.start(), s2MR.end()); p2i(s2->bottom()), p2i(s2->end()),
p2i(s2MR.start()), p2i(s2MR.end()));
gclog_or_tty->print_cr(" Mangle before: [" PTR_FORMAT ", " gclog_or_tty->print_cr(" Mangle before: [" PTR_FORMAT ", "
PTR_FORMAT ") Mangle after: [" PTR_FORMAT ", " PTR_FORMAT ")", PTR_FORMAT ") Mangle after: [" PTR_FORMAT ", " PTR_FORMAT ")",
delta2_left.start(), delta2_left.end(), delta2_right.start(), p2i(delta2_left.start()), p2i(delta2_left.end()),
delta2_right.end()); p2i(delta2_right.start()), p2i(delta2_right.end()));
} }
} }
@ -456,22 +456,22 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size,
requested_eden_size, requested_survivor_size); requested_eden_size, requested_survivor_size);
gclog_or_tty->print_cr(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") " gclog_or_tty->print_cr(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") "
SIZE_FORMAT, SIZE_FORMAT,
eden_space()->bottom(), p2i(eden_space()->bottom()),
eden_space()->end(), p2i(eden_space()->end()),
pointer_delta(eden_space()->end(), pointer_delta(eden_space()->end(),
eden_space()->bottom(), eden_space()->bottom(),
sizeof(char))); sizeof(char)));
gclog_or_tty->print_cr(" from: [" PTR_FORMAT ".." PTR_FORMAT ") " gclog_or_tty->print_cr(" from: [" PTR_FORMAT ".." PTR_FORMAT ") "
SIZE_FORMAT, SIZE_FORMAT,
from_space()->bottom(), p2i(from_space()->bottom()),
from_space()->end(), p2i(from_space()->end()),
pointer_delta(from_space()->end(), pointer_delta(from_space()->end(),
from_space()->bottom(), from_space()->bottom(),
sizeof(char))); sizeof(char)));
gclog_or_tty->print_cr(" to: [" PTR_FORMAT ".." PTR_FORMAT ") " gclog_or_tty->print_cr(" to: [" PTR_FORMAT ".." PTR_FORMAT ") "
SIZE_FORMAT, SIZE_FORMAT,
to_space()->bottom(), p2i(to_space()->bottom()),
to_space()->end(), p2i(to_space()->end()),
pointer_delta( to_space()->end(), pointer_delta( to_space()->end(),
to_space()->bottom(), to_space()->bottom(),
sizeof(char))); sizeof(char)));
@ -572,18 +572,18 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size,
if (PrintAdaptiveSizePolicy && Verbose) { if (PrintAdaptiveSizePolicy && Verbose) {
gclog_or_tty->print_cr(" [eden_start .. eden_end): " gclog_or_tty->print_cr(" [eden_start .. eden_end): "
"[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
eden_start, p2i(eden_start),
eden_end, p2i(eden_end),
pointer_delta(eden_end, eden_start, sizeof(char))); pointer_delta(eden_end, eden_start, sizeof(char)));
gclog_or_tty->print_cr(" [from_start .. from_end): " gclog_or_tty->print_cr(" [from_start .. from_end): "
"[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
from_start, p2i(from_start),
from_end, p2i(from_end),
pointer_delta(from_end, from_start, sizeof(char))); pointer_delta(from_end, from_start, sizeof(char)));
gclog_or_tty->print_cr(" [ to_start .. to_end): " gclog_or_tty->print_cr(" [ to_start .. to_end): "
"[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
to_start, p2i(to_start),
to_end, p2i(to_end),
pointer_delta( to_end, to_start, sizeof(char))); pointer_delta( to_end, to_start, sizeof(char)));
} }
} else { } else {
@ -629,18 +629,18 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size,
if (PrintAdaptiveSizePolicy && Verbose) { if (PrintAdaptiveSizePolicy && Verbose) {
gclog_or_tty->print_cr(" [eden_start .. eden_end): " gclog_or_tty->print_cr(" [eden_start .. eden_end): "
"[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
eden_start, p2i(eden_start),
eden_end, p2i(eden_end),
pointer_delta(eden_end, eden_start, sizeof(char))); pointer_delta(eden_end, eden_start, sizeof(char)));
gclog_or_tty->print_cr(" [ to_start .. to_end): " gclog_or_tty->print_cr(" [ to_start .. to_end): "
"[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
to_start, p2i(to_start),
to_end, p2i(to_end),
pointer_delta( to_end, to_start, sizeof(char))); pointer_delta( to_end, to_start, sizeof(char)));
gclog_or_tty->print_cr(" [from_start .. from_end): " gclog_or_tty->print_cr(" [from_start .. from_end): "
"[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
from_start, p2i(from_start),
from_end, p2i(from_end),
pointer_delta(from_end, from_start, sizeof(char))); pointer_delta(from_end, from_start, sizeof(char)));
} }
} }

View File

@ -32,8 +32,6 @@
#include "oops/objArrayKlass.inline.hpp" #include "oops/objArrayKlass.inline.hpp"
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
uint MarkSweep::_total_invocations = 0; uint MarkSweep::_total_invocations = 0;
Stack<oop, mtGC> MarkSweep::_marking_stack; Stack<oop, mtGC> MarkSweep::_marking_stack;
@ -64,18 +62,22 @@ void MarkSweep::follow_class_loader(ClassLoaderData* cld) {
MarkSweep::follow_cld_closure.do_cld(cld); MarkSweep::follow_cld_closure.do_cld(cld);
} }
void MarkSweep::follow_array(objArrayOop array, int index) {
ObjArrayKlass* k = (ObjArrayKlass*)array->klass();
k->oop_follow_contents(array, index);
}
void MarkSweep::follow_stack() { void MarkSweep::follow_stack() {
do { do {
while (!_marking_stack.is_empty()) { while (!_marking_stack.is_empty()) {
oop obj = _marking_stack.pop(); oop obj = _marking_stack.pop();
assert (obj->is_gc_marked(), "p must be marked"); assert (obj->is_gc_marked(), "p must be marked");
obj->follow_contents(); follow_object(obj);
} }
// Process ObjArrays one at a time to avoid marking stack bloat. // Process ObjArrays one at a time to avoid marking stack bloat.
if (!_objarray_stack.is_empty()) { if (!_objarray_stack.is_empty()) {
ObjArrayTask task = _objarray_stack.pop(); ObjArrayTask task = _objarray_stack.pop();
ObjArrayKlass* k = (ObjArrayKlass*)task.obj()->klass(); follow_array(objArrayOop(task.obj()), task.index());
k->oop_follow_contents(task.obj(), task.index());
} }
} while (!_marking_stack.is_empty() || !_objarray_stack.is_empty()); } while (!_marking_stack.is_empty() || !_objarray_stack.is_empty());
} }

View File

@ -160,10 +160,16 @@ class MarkSweep : AllStatic {
static void follow_stack(); // Empty marking stack. static void follow_stack(); // Empty marking stack.
static void follow_object(oop obj);
static void follow_array(objArrayOop array, int index);
static void follow_klass(Klass* klass); static void follow_klass(Klass* klass);
static void follow_class_loader(ClassLoaderData* cld); static void follow_class_loader(ClassLoaderData* cld);
static int adjust_pointers(oop obj);
static void preserve_mark(oop p, markOop mark); static void preserve_mark(oop p, markOop mark);
// Save the mark word so it can be restored later // Save the mark word so it can be restored later
static void adjust_marks(); // Adjust the pointers in the preserved marks table static void adjust_marks(); // Adjust the pointers in the preserved marks table

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -58,6 +58,10 @@ inline void MarkSweep::follow_klass(Klass* klass) {
MarkSweep::mark_and_push(&op); MarkSweep::mark_and_push(&op);
} }
inline void MarkSweep::follow_object(oop obj) {
obj->follow_contents();
}
template <class T> inline void MarkSweep::follow_root(T* p) { template <class T> inline void MarkSweep::follow_root(T* p) {
assert(!Universe::heap()->is_in_reserved(p), assert(!Universe::heap()->is_in_reserved(p),
"roots shouldn't be things within the heap"); "roots shouldn't be things within the heap");
@ -66,7 +70,7 @@ template <class T> inline void MarkSweep::follow_root(T* p) {
oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
if (!obj->mark()->is_marked()) { if (!obj->mark()->is_marked()) {
mark_object(obj); mark_object(obj);
obj->follow_contents(); follow_object(obj);
} }
} }
follow_stack(); follow_stack();
@ -90,6 +94,10 @@ void MarkSweep::push_objarray(oop obj, size_t index) {
_objarray_stack.push(task); _objarray_stack.push(task);
} }
inline int MarkSweep::adjust_pointers(oop obj) {
return obj->adjust_pointers();
}
template <class T> inline void MarkSweep::adjust_pointer(T* p) { template <class T> inline void MarkSweep::adjust_pointer(T* p) {
T heap_oop = oopDesc::load_heap_oop(p); T heap_oop = oopDesc::load_heap_oop(p);
if (!oopDesc::is_null(heap_oop)) { if (!oopDesc::is_null(heap_oop)) {

View File

@ -31,8 +31,6 @@
#include "runtime/atomic.inline.hpp" #include "runtime/atomic.inline.hpp"
#include "runtime/thread.inline.hpp" #include "runtime/thread.inline.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
MutableNUMASpace::MutableNUMASpace(size_t alignment) : MutableSpace(alignment) { MutableNUMASpace::MutableNUMASpace(size_t alignment) : MutableSpace(alignment) {
_lgrp_spaces = new (ResourceObj::C_HEAP, mtGC) GrowableArray<LGRPSpace*>(0, true); _lgrp_spaces = new (ResourceObj::C_HEAP, mtGC) GrowableArray<LGRPSpace*>(0, true);
_page_size = os::vm_page_size(); _page_size = os::vm_page_size();
@ -973,7 +971,7 @@ void MutableNUMASpace::LGRPSpace::scan_pages(size_t page_size, size_t page_count
break; break;
} }
if (e != scan_end) { if (e != scan_end) {
assert(e < scan_end, err_msg("e: " PTR_FORMAT " scan_end: " PTR_FORMAT, e, scan_end)); assert(e < scan_end, err_msg("e: " PTR_FORMAT " scan_end: " PTR_FORMAT, p2i(e), p2i(scan_end)));
if ((page_expected.size != page_size || page_expected.lgrp_id != lgrp_id()) if ((page_expected.size != page_size || page_expected.lgrp_id != lgrp_id())
&& page_expected.size != 0) { && page_expected.size != 0) {

View File

@ -33,8 +33,6 @@
#include "runtime/thread.hpp" #include "runtime/thread.hpp"
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_ALL_GCS
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
MutableSpace::MutableSpace(size_t alignment): ImmutableSpace(), _top(NULL), _alignment(alignment) { MutableSpace::MutableSpace(size_t alignment): ImmutableSpace(), _top(NULL), _alignment(alignment) {
assert(MutableSpace::alignment() % os::vm_page_size() == 0, assert(MutableSpace::alignment() % os::vm_page_size() == 0,
"Space should be aligned"); "Space should be aligned");
@ -253,7 +251,7 @@ void MutableSpace::print() const { print_on(tty); }
void MutableSpace::print_on(outputStream* st) const { void MutableSpace::print_on(outputStream* st) const {
MutableSpace::print_short_on(st); MutableSpace::print_short_on(st);
st->print_cr(" [" INTPTR_FORMAT "," INTPTR_FORMAT "," INTPTR_FORMAT ")", st->print_cr(" [" INTPTR_FORMAT "," INTPTR_FORMAT "," INTPTR_FORMAT ")",
bottom(), top(), end()); p2i(bottom()), p2i(top()), p2i(end()));
} }
void MutableSpace::verify() { void MutableSpace::verify() {

View File

@ -27,8 +27,6 @@
#include "memory/space.inline.hpp" #include "memory/space.inline.hpp"
#include "utilities/copy.hpp" #include "utilities/copy.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// Catch-all file for utility classes // Catch-all file for utility classes
#ifndef PRODUCT #ifndef PRODUCT
@ -86,7 +84,7 @@ void SpaceMangler::mangle_region(MemRegion mr) {
assert(ZapUnusedHeapArea, "Mangling should not be in use"); assert(ZapUnusedHeapArea, "Mangling should not be in use");
#ifdef ASSERT #ifdef ASSERT
if(TraceZapUnusedHeapArea) { if(TraceZapUnusedHeapArea) {
gclog_or_tty->print("Mangling [" PTR_FORMAT " to " PTR_FORMAT ")", mr.start(), mr.end()); gclog_or_tty->print("Mangling [" PTR_FORMAT " to " PTR_FORMAT ")", p2i(mr.start()), p2i(mr.end()));
} }
Copy::fill_to_words(mr.start(), mr.word_size(), badHeapWord); Copy::fill_to_words(mr.start(), mr.word_size(), badHeapWord);
if(TraceZapUnusedHeapArea) { if(TraceZapUnusedHeapArea) {

View File

@ -190,11 +190,12 @@ GenCollectorPolicy::GenCollectorPolicy() :
_min_young_size(0), _min_young_size(0),
_initial_young_size(0), _initial_young_size(0),
_max_young_size(0), _max_young_size(0),
_gen_alignment(0),
_min_old_size(0), _min_old_size(0),
_initial_old_size(0), _initial_old_size(0),
_max_old_size(0), _max_old_size(0),
_generations(NULL) _gen_alignment(0),
_young_gen_spec(NULL),
_old_gen_spec(NULL)
{} {}
size_t GenCollectorPolicy::scale_by_NewRatio_aligned(size_t base_size) { size_t GenCollectorPolicy::scale_by_NewRatio_aligned(size_t base_size) {
@ -912,9 +913,8 @@ void MarkSweepPolicy::initialize_alignments() {
} }
void MarkSweepPolicy::initialize_generations() { void MarkSweepPolicy::initialize_generations() {
_generations = NEW_C_HEAP_ARRAY(GenerationSpecPtr, number_of_generations(), mtGC); _young_gen_spec = new GenerationSpec(Generation::DefNew, _initial_young_size, _max_young_size, _gen_alignment);
_generations[0] = new GenerationSpec(Generation::DefNew, _initial_young_size, _max_young_size); _old_gen_spec = new GenerationSpec(Generation::MarkSweepCompact, _initial_old_size, _max_old_size, _gen_alignment);
_generations[1] = new GenerationSpec(Generation::MarkSweepCompact, _initial_old_size, _max_old_size);
} }
void MarkSweepPolicy::initialize_gc_policy_counters() { void MarkSweepPolicy::initialize_gc_policy_counters() {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -208,7 +208,8 @@ class ClearedAllSoftRefs : public StackObj {
}; };
class GenCollectorPolicy : public CollectorPolicy { class GenCollectorPolicy : public CollectorPolicy {
friend class TestGenCollectorPolicy; friend class TestGenCollectorPolicy;
friend class VMStructs;
protected: protected:
size_t _min_young_size; size_t _min_young_size;
size_t _initial_young_size; size_t _initial_young_size;
@ -221,7 +222,8 @@ friend class TestGenCollectorPolicy;
// time. When using large pages they can differ. // time. When using large pages they can differ.
size_t _gen_alignment; size_t _gen_alignment;
GenerationSpec **_generations; GenerationSpec* _young_gen_spec;
GenerationSpec* _old_gen_spec;
// Return true if an allocation should be attempted in the older generation // Return true if an allocation should be attempted in the older generation
// if it fails in the younger generation. Return false, otherwise. // if it fails in the younger generation. Return false, otherwise.
@ -261,9 +263,14 @@ friend class TestGenCollectorPolicy;
int number_of_generations() { return 2; } int number_of_generations() { return 2; }
virtual GenerationSpec **generations() { GenerationSpec* young_gen_spec() const {
assert(_generations != NULL, "Sanity check"); assert(_young_gen_spec != NULL, "_young_gen_spec should have been initialized");
return _generations; return _young_gen_spec;
}
GenerationSpec* old_gen_spec() const {
assert(_old_gen_spec != NULL, "_old_gen_spec should have been initialized");
return _old_gen_spec;
} }
virtual GenCollectorPolicy* as_generation_policy() { return this; } virtual GenCollectorPolicy* as_generation_policy() { return this; }

View File

@ -49,8 +49,6 @@
#include "utilities/globalDefinitions.hpp" #include "utilities/globalDefinitions.hpp"
#include "utilities/stack.inline.hpp" #include "utilities/stack.inline.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// //
// DefNewGeneration functions. // DefNewGeneration functions.
@ -137,7 +135,7 @@ void KlassScanClosure::do_klass(Klass* klass) {
if (TraceScavenge) { if (TraceScavenge) {
ResourceMark rm; ResourceMark rm;
gclog_or_tty->print_cr("KlassScanClosure::do_klass " PTR_FORMAT ", %s, dirty: %s", gclog_or_tty->print_cr("KlassScanClosure::do_klass " PTR_FORMAT ", %s, dirty: %s",
klass, p2i(klass),
klass->external_name(), klass->external_name(),
klass->has_modified_oops() ? "true" : "false"); klass->has_modified_oops() ? "true" : "false");
} }
@ -380,7 +378,7 @@ void DefNewGeneration::compute_new_size() {
int next_level = level() + 1; int next_level = level() + 1;
GenCollectedHeap* gch = GenCollectedHeap::heap(); GenCollectedHeap* gch = GenCollectedHeap::heap();
assert(next_level < gch->_n_gens, assert(next_level < gch->n_gens(),
"DefNewGeneration cannot be an oldest gen"); "DefNewGeneration cannot be an oldest gen");
Generation* old_gen = gch->old_gen(); Generation* old_gen = gch->old_gen();

View File

@ -90,7 +90,6 @@ GenCollectedHeap::GenCollectedHeap(GenCollectorPolicy *policy) :
jint GenCollectedHeap::initialize() { jint GenCollectedHeap::initialize() {
CollectedHeap::pre_initialize(); CollectedHeap::pre_initialize();
int i;
_n_gens = gen_policy()->number_of_generations(); _n_gens = gen_policy()->number_of_generations();
assert(_n_gens == 2, "There is no support for more than two generations"); assert(_n_gens == 2, "There is no support for more than two generations");
@ -101,16 +100,6 @@ jint GenCollectedHeap::initialize() {
// HeapWordSize). // HeapWordSize).
guarantee(HeapWordSize == wordSize, "HeapWordSize must equal wordSize"); guarantee(HeapWordSize == wordSize, "HeapWordSize must equal wordSize");
// The heap must be at least as aligned as generations.
size_t gen_alignment = Generation::GenGrain;
_gen_specs = gen_policy()->generations();
// Make sure the sizes are all aligned.
for (i = 0; i < _n_gens; i++) {
_gen_specs[i]->align(gen_alignment);
}
// Allocate space for the heap. // Allocate space for the heap.
char* heap_address; char* heap_address;
@ -133,12 +122,12 @@ jint GenCollectedHeap::initialize() {
_gch = this; _gch = this;
ReservedSpace young_rs = heap_rs.first_part(_gen_specs[0]->max_size(), false, false); ReservedSpace young_rs = heap_rs.first_part(gen_policy()->young_gen_spec()->max_size(), false, false);
_young_gen = _gen_specs[0]->init(young_rs, 0, rem_set()); _young_gen = gen_policy()->young_gen_spec()->init(young_rs, 0, rem_set());
heap_rs = heap_rs.last_part(_gen_specs[0]->max_size()); heap_rs = heap_rs.last_part(gen_policy()->young_gen_spec()->max_size());
ReservedSpace old_rs = heap_rs.first_part(_gen_specs[1]->max_size(), false, false); ReservedSpace old_rs = heap_rs.first_part(gen_policy()->old_gen_spec()->max_size(), false, false);
_old_gen = _gen_specs[1]->init(old_rs, 1, rem_set()); _old_gen = gen_policy()->old_gen_spec()->init(old_rs, 1, rem_set());
clear_incremental_collection_failed(); clear_incremental_collection_failed();
#if INCLUDE_ALL_GCS #if INCLUDE_ALL_GCS
@ -155,21 +144,18 @@ jint GenCollectedHeap::initialize() {
char* GenCollectedHeap::allocate(size_t alignment, char* GenCollectedHeap::allocate(size_t alignment,
ReservedSpace* heap_rs){ ReservedSpace* heap_rs){
const char overflow_msg[] = "The size of the object heap + VM data exceeds "
"the maximum representable size";
// Now figure out the total size. // Now figure out the total size.
size_t total_reserved = 0; const size_t pageSize = UseLargePages ? os::large_page_size() : os::vm_page_size();
const size_t pageSize = UseLargePages ?
os::large_page_size() : os::vm_page_size();
assert(alignment % pageSize == 0, "Must be"); assert(alignment % pageSize == 0, "Must be");
for (int i = 0; i < _n_gens; i++) { GenerationSpec* young_spec = gen_policy()->young_gen_spec();
total_reserved += _gen_specs[i]->max_size(); GenerationSpec* old_spec = gen_policy()->old_gen_spec();
if (total_reserved < _gen_specs[i]->max_size()) {
vm_exit_during_initialization(overflow_msg); // Check for overflow.
} size_t total_reserved = young_spec->max_size() + old_spec->max_size();
if (total_reserved < young_spec->max_size()) {
vm_exit_during_initialization("The size of the object heap + VM data exceeds "
"the maximum representable size");
} }
assert(total_reserved % alignment == 0, assert(total_reserved % alignment == 0,
err_msg("Gen size; total_reserved=" SIZE_FORMAT ", alignment=" err_msg("Gen size; total_reserved=" SIZE_FORMAT ", alignment="
@ -1351,7 +1337,7 @@ jlong GenCollectedHeap::millis_since_last_gc() {
// back a time later than 'now'. // back a time later than 'now'.
jlong retVal = now - tolgc_cl.time(); jlong retVal = now - tolgc_cl.time();
if (retVal < 0) { if (retVal < 0) {
NOT_PRODUCT(warning("time warp: "INT64_FORMAT, (int64_t) retVal);) NOT_PRODUCT(warning("time warp: " JLONG_FORMAT, retVal);)
return 0; return 0;
} }
return retVal; return retVal;

View File

@ -67,8 +67,6 @@ public:
Generation* _young_gen; Generation* _young_gen;
Generation* _old_gen; Generation* _old_gen;
GenerationSpec** _gen_specs;
// The singleton Gen Remembered Set. // The singleton Gen Remembered Set.
GenRemSet* _rem_set; GenRemSet* _rem_set;
@ -145,8 +143,8 @@ public:
return CollectedHeap::GenCollectedHeap; return CollectedHeap::GenCollectedHeap;
} }
Generation* young_gen() { return _young_gen; } Generation* young_gen() const { return _young_gen; }
Generation* old_gen() { return _old_gen; } Generation* old_gen() const { return _old_gen; }
// The generational collector policy. // The generational collector policy.
GenCollectorPolicy* gen_policy() const { return _gen_policy; } GenCollectorPolicy* gen_policy() const { return _gen_policy; }

View File

@ -42,8 +42,6 @@
#include "utilities/copy.hpp" #include "utilities/copy.hpp"
#include "utilities/events.hpp" #include "utilities/events.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
Generation::Generation(ReservedSpace rs, size_t initial_size, int level) : Generation::Generation(ReservedSpace rs, size_t initial_size, int level) :
_level(level), _level(level),
_ref_processor(NULL) { _ref_processor(NULL) {
@ -63,8 +61,8 @@ Generation::Generation(ReservedSpace rs, size_t initial_size, int level) :
GenerationSpec* Generation::spec() { GenerationSpec* Generation::spec() {
GenCollectedHeap* gch = GenCollectedHeap::heap(); GenCollectedHeap* gch = GenCollectedHeap::heap();
assert(0 <= level() && level() < gch->_n_gens, "Bad gen level"); assert(level() == 0 || level() == 1, "Bad gen level");
return gch->_gen_specs[level()]; return level() == 0 ? gch->gen_policy()->young_gen_spec() : gch->gen_policy()->old_gen_spec();
} }
size_t Generation::max_capacity() const { size_t Generation::max_capacity() const {
@ -103,9 +101,9 @@ void Generation::print_on(outputStream* st) const {
st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K", st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K",
capacity()/K, used()/K); capacity()/K, used()/K);
st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")", st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")",
_virtual_space.low_boundary(), p2i(_virtual_space.low_boundary()),
_virtual_space.high(), p2i(_virtual_space.high()),
_virtual_space.high_boundary()); p2i(_virtual_space.high_boundary()));
} }
void Generation::print_summary_info() { print_summary_info_on(tty); } void Generation::print_summary_info() { print_summary_info_on(tty); }

View File

@ -399,7 +399,7 @@ class Generation: public CHeapObj<mtGC> {
// have to guard against non-monotonicity. // have to guard against non-monotonicity.
NOT_PRODUCT( NOT_PRODUCT(
if (now < _time_of_last_gc) { if (now < _time_of_last_gc) {
warning("time warp: "INT64_FORMAT" to "INT64_FORMAT, (int64_t)_time_of_last_gc, (int64_t)now); warning("time warp: " JLONG_FORMAT " to " JLONG_FORMAT, _time_of_last_gc, now);
} }
) )
return _time_of_last_gc; return _time_of_last_gc;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -39,11 +39,11 @@ private:
size_t _max_size; size_t _max_size;
public: public:
GenerationSpec(Generation::Name name, size_t init_size, size_t max_size) { GenerationSpec(Generation::Name name, size_t init_size, size_t max_size, size_t alignment) :
_name = name; _name(name),
_init_size = init_size; _init_size(align_size_up(init_size, alignment)),
_max_size = max_size; _max_size(align_size_up(max_size, alignment))
} { }
Generation* init(ReservedSpace rs, int level, GenRemSet* remset); Generation* init(ReservedSpace rs, int level, GenRemSet* remset);
@ -53,12 +53,6 @@ public:
void set_init_size(size_t size) { _init_size = size; } void set_init_size(size_t size) { _init_size = size; }
size_t max_size() const { return _max_size; } size_t max_size() const { return _max_size; }
void set_max_size(size_t size) { _max_size = size; } void set_max_size(size_t size) { _max_size = size; }
// Alignment
void align(size_t alignment) {
set_init_size(align_size_up(init_size(), alignment));
set_max_size(align_size_up(max_size(), alignment));
}
}; };
typedef GenerationSpec* GenerationSpecPtr; typedef GenerationSpec* GenerationSpecPtr;

View File

@ -38,8 +38,6 @@
#include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_ALL_GCS
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// HeapInspection // HeapInspection
inline KlassInfoEntry::~KlassInfoEntry() { inline KlassInfoEntry::~KlassInfoEntry() {
@ -100,8 +98,8 @@ void KlassInfoEntry::print_on(outputStream* st) const {
// simplify the formatting (ILP32 vs LP64) - always cast the numbers to 64-bit // simplify the formatting (ILP32 vs LP64) - always cast the numbers to 64-bit
st->print_cr(INT64_FORMAT_W(13) " " UINT64_FORMAT_W(13) " %s", st->print_cr(INT64_FORMAT_W(13) " " UINT64_FORMAT_W(13) " %s",
(jlong) _instance_count, (int64_t)_instance_count,
(julong) _instance_words * HeapWordSize, (uint64_t)_instance_words * HeapWordSize,
name()); name());
} }
@ -240,8 +238,8 @@ void KlassInfoHisto::sort() {
void KlassInfoHisto::print_elements(outputStream* st) const { void KlassInfoHisto::print_elements(outputStream* st) const {
// simplify the formatting (ILP32 vs LP64) - store the sum in 64-bit // simplify the formatting (ILP32 vs LP64) - store the sum in 64-bit
jlong total = 0; int64_t total = 0;
julong totalw = 0; uint64_t totalw = 0;
for(int i=0; i < elements()->length(); i++) { for(int i=0; i < elements()->length(); i++) {
st->print("%4d: ", i+1); st->print("%4d: ", i+1);
elements()->at(i)->print_on(st); elements()->at(i)->print_on(st);
@ -451,7 +449,7 @@ static void print_classname(outputStream* st, Klass* klass) {
if (loader_oop == NULL) { if (loader_oop == NULL) {
st->print("null"); st->print("null");
} else { } else {
st->print(INTPTR_FORMAT, klass->class_loader_data()); st->print(INTPTR_FORMAT, p2i(klass->class_loader_data()));
} }
} }
@ -557,13 +555,13 @@ void KlassInfoHisto::print_class_stats(outputStream* st,
} }
if (csv_format) { if (csv_format) {
st->print("%d,%d", e->index(), super_index); st->print("%ld,%d", e->index(), super_index);
for (int c=0; c<KlassSizeStats::_num_columns; c++) { for (int c=0; c<KlassSizeStats::_num_columns; c++) {
if (selected[c]) {st->print("," JULONG_FORMAT, col_table[c]);} if (selected[c]) {st->print("," JULONG_FORMAT, col_table[c]);}
} }
st->print(",%s",e->name()); st->print(",%s",e->name());
} else { } else {
st->print("%5d %5d", e->index(), super_index); st->print("%5ld %5d", e->index(), super_index);
for (int c=0; c<KlassSizeStats::_num_columns; c++) { for (int c=0; c<KlassSizeStats::_num_columns; c++) {
if (selected[c]) {print_julong(st, width_table[c], col_table[c]);} if (selected[c]) {print_julong(st, width_table[c], col_table[c]);}
} }

View File

@ -28,8 +28,6 @@
#include "utilities/copy.hpp" #include "utilities/copy.hpp"
#include "utilities/debug.hpp" #include "utilities/debug.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
class VirtualSpaceNode; class VirtualSpaceNode;
const size_t metadata_chunk_initialize = 0xf7f7f7f7; const size_t metadata_chunk_initialize = 0xf7f7f7f7;
@ -92,7 +90,7 @@ void Metachunk::print_on(outputStream* st) const {
st->print_cr("Metachunk:" st->print_cr("Metachunk:"
" bottom " PTR_FORMAT " top " PTR_FORMAT " bottom " PTR_FORMAT " top " PTR_FORMAT
" end " PTR_FORMAT " size " SIZE_FORMAT, " end " PTR_FORMAT " size " SIZE_FORMAT,
bottom(), _top, end(), word_size()); p2i(bottom()), p2i(_top), p2i(end()), word_size());
if (Verbose) { if (Verbose) {
st->print_cr(" used " SIZE_FORMAT " free " SIZE_FORMAT, st->print_cr(" used " SIZE_FORMAT " free " SIZE_FORMAT,
used_word_size(), free_word_size()); used_word_size(), free_word_size());

View File

@ -49,8 +49,6 @@
#include "utilities/debug.hpp" #include "utilities/debug.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
typedef BinaryTreeDictionary<Metablock, FreeList<Metablock> > BlockTreeDictionary; typedef BinaryTreeDictionary<Metablock, FreeList<Metablock> > BlockTreeDictionary;
typedef BinaryTreeDictionary<Metachunk, FreeList<Metachunk> > ChunkTreeDictionary; typedef BinaryTreeDictionary<Metachunk, FreeList<Metachunk> > ChunkTreeDictionary;
@ -388,7 +386,7 @@ class VirtualSpaceNode : public CHeapObj<mtClass> {
#define assert_is_ptr_aligned(ptr, alignment) \ #define assert_is_ptr_aligned(ptr, alignment) \
assert(is_ptr_aligned(ptr, alignment), \ assert(is_ptr_aligned(ptr, alignment), \
err_msg(PTR_FORMAT " is not aligned to " \ err_msg(PTR_FORMAT " is not aligned to " \
SIZE_FORMAT, ptr, alignment)) SIZE_FORMAT, p2i(ptr), alignment))
#define assert_is_size_aligned(size, alignment) \ #define assert_is_size_aligned(size, alignment) \
assert(is_size_aligned(size, alignment), \ assert(is_size_aligned(size, alignment), \
@ -800,7 +798,7 @@ void VirtualSpaceNode::inc_container_count() {
_container_count++; _container_count++;
assert(_container_count == container_count_slow(), assert(_container_count == container_count_slow(),
err_msg("Inconsistency in container_count _container_count " SIZE_FORMAT err_msg("Inconsistency in container_count _container_count " SIZE_FORMAT
" container_count_slow() " SIZE_FORMAT, " container_count_slow() %u",
_container_count, container_count_slow())); _container_count, container_count_slow()));
} }
@ -813,7 +811,7 @@ void VirtualSpaceNode::dec_container_count() {
void VirtualSpaceNode::verify_container_count() { void VirtualSpaceNode::verify_container_count() {
assert(_container_count == container_count_slow(), assert(_container_count == container_count_slow(),
err_msg("Inconsistency in container_count _container_count " SIZE_FORMAT err_msg("Inconsistency in container_count _container_count " SIZE_FORMAT
" container_count_slow() " SIZE_FORMAT, _container_count, container_count_slow())); " container_count_slow() %u", _container_count, container_count_slow()));
} }
#endif #endif
@ -916,7 +914,7 @@ Metachunk* VirtualSpaceNode::take_from_committed(size_t chunk_word_size) {
if (!is_available(chunk_word_size)) { if (!is_available(chunk_word_size)) {
if (TraceMetadataChunkAllocation) { if (TraceMetadataChunkAllocation) {
gclog_or_tty->print("VirtualSpaceNode::take_from_committed() not available %d words ", chunk_word_size); gclog_or_tty->print("VirtualSpaceNode::take_from_committed() not available " SIZE_FORMAT " words ", chunk_word_size);
// Dump some information about the virtual space that is nearly full // Dump some information about the virtual space that is nearly full
print_on(gclog_or_tty); print_on(gclog_or_tty);
} }
@ -989,7 +987,7 @@ bool VirtualSpaceNode::initialize() {
assert(reserved()->start() == (HeapWord*) _rs.base(), assert(reserved()->start() == (HeapWord*) _rs.base(),
err_msg("Reserved start was not set properly " PTR_FORMAT err_msg("Reserved start was not set properly " PTR_FORMAT
" != " PTR_FORMAT, reserved()->start(), _rs.base())); " != " PTR_FORMAT, p2i(reserved()->start()), p2i(_rs.base())));
assert(reserved()->word_size() == _rs.size() / BytesPerWord, assert(reserved()->word_size() == _rs.size() / BytesPerWord,
err_msg("Reserved size was not set properly " SIZE_FORMAT err_msg("Reserved size was not set properly " SIZE_FORMAT
" != " SIZE_FORMAT, reserved()->word_size(), " != " SIZE_FORMAT, reserved()->word_size(),
@ -1003,13 +1001,13 @@ void VirtualSpaceNode::print_on(outputStream* st) const {
size_t used = used_words_in_vs(); size_t used = used_words_in_vs();
size_t capacity = capacity_words_in_vs(); size_t capacity = capacity_words_in_vs();
VirtualSpace* vs = virtual_space(); VirtualSpace* vs = virtual_space();
st->print_cr(" space @ " PTR_FORMAT " " SIZE_FORMAT "K, %3d%% used " st->print_cr(" space @ " PTR_FORMAT " " SIZE_FORMAT "K, " SIZE_FORMAT_W(3) "%% used "
"[" PTR_FORMAT ", " PTR_FORMAT ", " "[" PTR_FORMAT ", " PTR_FORMAT ", "
PTR_FORMAT ", " PTR_FORMAT ")", PTR_FORMAT ", " PTR_FORMAT ")",
vs, capacity / K, p2i(vs), capacity / K,
capacity == 0 ? 0 : used * 100 / capacity, capacity == 0 ? 0 : used * 100 / capacity,
bottom(), top(), end(), p2i(bottom()), p2i(top()), p2i(end()),
vs->high_boundary()); p2i(vs->high_boundary()));
} }
#ifdef ASSERT #ifdef ASSERT
@ -1812,7 +1810,7 @@ Metachunk* ChunkManager::free_chunks_get(size_t word_size) {
if (TraceMetadataChunkAllocation && Verbose) { if (TraceMetadataChunkAllocation && Verbose) {
gclog_or_tty->print_cr("ChunkManager::free_chunks_get: free_list " gclog_or_tty->print_cr("ChunkManager::free_chunks_get: free_list "
PTR_FORMAT " head " PTR_FORMAT " size " SIZE_FORMAT, PTR_FORMAT " head " PTR_FORMAT " size " SIZE_FORMAT,
free_list, chunk, chunk->word_size()); p2i(free_list), p2i(chunk), chunk->word_size());
} }
} else { } else {
chunk = humongous_dictionary()->get_chunk( chunk = humongous_dictionary()->get_chunk(
@ -1872,7 +1870,7 @@ Metachunk* ChunkManager::chunk_freelist_allocate(size_t word_size) {
} }
gclog_or_tty->print("ChunkManager::chunk_freelist_allocate: " PTR_FORMAT " chunk " gclog_or_tty->print("ChunkManager::chunk_freelist_allocate: " PTR_FORMAT " chunk "
PTR_FORMAT " size " SIZE_FORMAT " count " SIZE_FORMAT " ", PTR_FORMAT " size " SIZE_FORMAT " count " SIZE_FORMAT " ",
this, chunk, chunk->word_size(), list_count); p2i(this), p2i(chunk), chunk->word_size(), list_count);
locked_print_free_chunks(gclog_or_tty); locked_print_free_chunks(gclog_or_tty);
} }
@ -2019,7 +2017,7 @@ void SpaceManager::locked_print_chunks_in_use_on(outputStream* st) const {
for (ChunkIndex i = ZeroIndex; i < NumberOfInUseLists; i = next_chunk_index(i)) { for (ChunkIndex i = ZeroIndex; i < NumberOfInUseLists; i = next_chunk_index(i)) {
Metachunk* chunk = chunks_in_use(i); Metachunk* chunk = chunks_in_use(i);
st->print("SpaceManager: %s " PTR_FORMAT, st->print("SpaceManager: %s " PTR_FORMAT,
chunk_size_name(i), chunk); chunk_size_name(i), p2i(chunk));
if (chunk != NULL) { if (chunk != NULL) {
st->print_cr(" free " SIZE_FORMAT, st->print_cr(" free " SIZE_FORMAT,
chunk->free_word_size()); chunk->free_word_size());
@ -2130,8 +2128,8 @@ void SpaceManager::print_on(outputStream* st) const {
for (ChunkIndex i = ZeroIndex; for (ChunkIndex i = ZeroIndex;
i < NumberOfInUseLists ; i < NumberOfInUseLists ;
i = next_chunk_index(i) ) { i = next_chunk_index(i) ) {
st->print_cr(" chunks_in_use " PTR_FORMAT " chunk size " PTR_FORMAT, st->print_cr(" chunks_in_use " PTR_FORMAT " chunk size " SIZE_FORMAT,
chunks_in_use(i), p2i(chunks_in_use(i)),
chunks_in_use(i) == NULL ? 0 : chunks_in_use(i)->word_size()); chunks_in_use(i) == NULL ? 0 : chunks_in_use(i)->word_size());
} }
st->print_cr(" waste: Small " SIZE_FORMAT " Medium " SIZE_FORMAT st->print_cr(" waste: Small " SIZE_FORMAT " Medium " SIZE_FORMAT
@ -2194,7 +2192,7 @@ void SpaceManager::initialize() {
} }
_current_chunk = NULL; _current_chunk = NULL;
if (TraceMetadataChunkAllocation && Verbose) { if (TraceMetadataChunkAllocation && Verbose) {
gclog_or_tty->print_cr("SpaceManager(): " PTR_FORMAT, this); gclog_or_tty->print_cr("SpaceManager(): " PTR_FORMAT, p2i(this));
} }
} }
@ -2238,7 +2236,7 @@ SpaceManager::~SpaceManager() {
dec_total_from_size_metrics(); dec_total_from_size_metrics();
if (TraceMetadataChunkAllocation && Verbose) { if (TraceMetadataChunkAllocation && Verbose) {
gclog_or_tty->print_cr("~SpaceManager(): " PTR_FORMAT, this); gclog_or_tty->print_cr("~SpaceManager(): " PTR_FORMAT, p2i(this));
locked_print_chunks_in_use_on(gclog_or_tty); locked_print_chunks_in_use_on(gclog_or_tty);
} }
@ -2258,7 +2256,7 @@ SpaceManager::~SpaceManager() {
for (ChunkIndex i = ZeroIndex; i < HumongousIndex; i = next_chunk_index(i)) { for (ChunkIndex i = ZeroIndex; i < HumongousIndex; i = next_chunk_index(i)) {
if (TraceMetadataChunkAllocation && Verbose) { if (TraceMetadataChunkAllocation && Verbose) {
gclog_or_tty->print_cr("returned %d %s chunks to freelist", gclog_or_tty->print_cr("returned " SIZE_FORMAT " %s chunks to freelist",
sum_count_in_chunks_in_use(i), sum_count_in_chunks_in_use(i),
chunk_size_name(i)); chunk_size_name(i));
} }
@ -2266,7 +2264,7 @@ SpaceManager::~SpaceManager() {
chunk_manager()->return_chunks(i, chunks); chunk_manager()->return_chunks(i, chunks);
set_chunks_in_use(i, NULL); set_chunks_in_use(i, NULL);
if (TraceMetadataChunkAllocation && Verbose) { if (TraceMetadataChunkAllocation && Verbose) {
gclog_or_tty->print_cr("updated freelist count %d %s", gclog_or_tty->print_cr("updated freelist count " SSIZE_FORMAT " %s",
chunk_manager()->free_chunks(i)->count(), chunk_manager()->free_chunks(i)->count(),
chunk_size_name(i)); chunk_size_name(i));
} }
@ -2279,7 +2277,7 @@ SpaceManager::~SpaceManager() {
// Humongous chunks // Humongous chunks
if (TraceMetadataChunkAllocation && Verbose) { if (TraceMetadataChunkAllocation && Verbose) {
gclog_or_tty->print_cr("returned %d %s humongous chunks to dictionary", gclog_or_tty->print_cr("returned " SIZE_FORMAT " %s humongous chunks to dictionary",
sum_count_in_chunks_in_use(HumongousIndex), sum_count_in_chunks_in_use(HumongousIndex),
chunk_size_name(HumongousIndex)); chunk_size_name(HumongousIndex));
gclog_or_tty->print("Humongous chunk dictionary: "); gclog_or_tty->print("Humongous chunk dictionary: ");
@ -2293,14 +2291,14 @@ SpaceManager::~SpaceManager() {
#endif #endif
if (TraceMetadataChunkAllocation && Verbose) { if (TraceMetadataChunkAllocation && Verbose) {
gclog_or_tty->print(PTR_FORMAT " (" SIZE_FORMAT ") ", gclog_or_tty->print(PTR_FORMAT " (" SIZE_FORMAT ") ",
humongous_chunks, p2i(humongous_chunks),
humongous_chunks->word_size()); humongous_chunks->word_size());
} }
assert(humongous_chunks->word_size() == (size_t) assert(humongous_chunks->word_size() == (size_t)
align_size_up(humongous_chunks->word_size(), align_size_up(humongous_chunks->word_size(),
smallest_chunk_size()), smallest_chunk_size()),
err_msg("Humongous chunk size is wrong: word size " SIZE_FORMAT err_msg("Humongous chunk size is wrong: word size " SIZE_FORMAT
" granularity %d", " granularity " SIZE_FORMAT,
humongous_chunks->word_size(), smallest_chunk_size())); humongous_chunks->word_size(), smallest_chunk_size()));
Metachunk* next_humongous_chunks = humongous_chunks->next(); Metachunk* next_humongous_chunks = humongous_chunks->next();
humongous_chunks->container()->dec_container_count(); humongous_chunks->container()->dec_container_count();
@ -2309,7 +2307,7 @@ SpaceManager::~SpaceManager() {
} }
if (TraceMetadataChunkAllocation && Verbose) { if (TraceMetadataChunkAllocation && Verbose) {
gclog_or_tty->cr(); gclog_or_tty->cr();
gclog_or_tty->print_cr("updated dictionary count %d %s", gclog_or_tty->print_cr("updated dictionary count " SIZE_FORMAT " %s",
chunk_manager()->humongous_dictionary()->total_count(), chunk_manager()->humongous_dictionary()->total_count(),
chunk_size_name(HumongousIndex)); chunk_size_name(HumongousIndex));
} }
@ -2399,7 +2397,7 @@ void SpaceManager::add_chunk(Metachunk* new_chunk, bool make_current) {
assert(new_chunk->is_empty(), "Not ready for reuse"); assert(new_chunk->is_empty(), "Not ready for reuse");
if (TraceMetadataChunkAllocation && Verbose) { if (TraceMetadataChunkAllocation && Verbose) {
gclog_or_tty->print("SpaceManager::add_chunk: %d) ", gclog_or_tty->print("SpaceManager::add_chunk: " SIZE_FORMAT ") ",
sum_count_in_chunks_in_use()); sum_count_in_chunks_in_use());
new_chunk->print_on(gclog_or_tty); new_chunk->print_on(gclog_or_tty);
chunk_manager()->locked_print_free_chunks(gclog_or_tty); chunk_manager()->locked_print_free_chunks(gclog_or_tty);
@ -3097,7 +3095,7 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a
metaspace_rs = ReservedSpace(compressed_class_space_size(), metaspace_rs = ReservedSpace(compressed_class_space_size(),
_reserve_alignment, large_pages); _reserve_alignment, large_pages);
if (!metaspace_rs.is_reserved()) { if (!metaspace_rs.is_reserved()) {
vm_exit_during_initialization(err_msg("Could not allocate metaspace: %d bytes", vm_exit_during_initialization(err_msg("Could not allocate metaspace: " SIZE_FORMAT " bytes",
compressed_class_space_size())); compressed_class_space_size()));
} }
} }
@ -3119,10 +3117,10 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a
initialize_class_space(metaspace_rs); initialize_class_space(metaspace_rs);
if (PrintCompressedOopsMode || (PrintMiscellaneous && Verbose)) { if (PrintCompressedOopsMode || (PrintMiscellaneous && Verbose)) {
gclog_or_tty->print_cr("Narrow klass base: " PTR_FORMAT ", Narrow klass shift: " SIZE_FORMAT, gclog_or_tty->print_cr("Narrow klass base: " PTR_FORMAT ", Narrow klass shift: %d",
Universe::narrow_klass_base(), Universe::narrow_klass_shift()); p2i(Universe::narrow_klass_base()), Universe::narrow_klass_shift());
gclog_or_tty->print_cr("Compressed class space size: " SIZE_FORMAT " Address: " PTR_FORMAT " Req Addr: " PTR_FORMAT, gclog_or_tty->print_cr("Compressed class space size: " SIZE_FORMAT " Address: " PTR_FORMAT " Req Addr: " PTR_FORMAT,
compressed_class_space_size(), metaspace_rs.base(), requested_addr); compressed_class_space_size(), p2i(metaspace_rs.base()), p2i(requested_addr));
} }
} }
@ -3251,7 +3249,7 @@ void Metaspace::global_initialize() {
vm_exit_during_initialization("Unable to dump shared archive.", vm_exit_during_initialization("Unable to dump shared archive.",
err_msg("Size of archive (" SIZE_FORMAT ") + compressed class space (" err_msg("Size of archive (" SIZE_FORMAT ") + compressed class space ("
SIZE_FORMAT ") == total (" SIZE_FORMAT ") is larger than compressed " SIZE_FORMAT ") == total (" SIZE_FORMAT ") is larger than compressed "
"klass limit: " SIZE_FORMAT, cds_total, compressed_class_space_size(), "klass limit: " UINT64_FORMAT, cds_total, compressed_class_space_size(),
cds_total + compressed_class_space_size(), UnscaledClassSpaceMax)); cds_total + compressed_class_space_size(), UnscaledClassSpaceMax));
} }
@ -3262,7 +3260,7 @@ void Metaspace::global_initialize() {
Universe::set_narrow_klass_base((address)_space_list->current_virtual_space()->bottom()); Universe::set_narrow_klass_base((address)_space_list->current_virtual_space()->bottom());
if (TraceMetavirtualspaceAllocation && Verbose) { if (TraceMetavirtualspaceAllocation && Verbose) {
gclog_or_tty->print_cr("Setting_narrow_klass_base to Address: " PTR_FORMAT, gclog_or_tty->print_cr("Setting_narrow_klass_base to Address: " PTR_FORMAT,
_space_list->current_virtual_space()->bottom()); p2i(_space_list->current_virtual_space()->bottom()));
} }
Universe::set_narrow_klass_shift(0); Universe::set_narrow_klass_shift(0);
@ -3768,10 +3766,10 @@ void Metaspace::verify() {
} }
void Metaspace::dump(outputStream* const out) const { void Metaspace::dump(outputStream* const out) const {
out->print_cr("\nVirtual space manager: " INTPTR_FORMAT, vsm()); out->print_cr("\nVirtual space manager: " INTPTR_FORMAT, p2i(vsm()));
vsm()->dump(out); vsm()->dump(out);
if (using_class_space()) { if (using_class_space()) {
out->print_cr("\nClass space manager: " INTPTR_FORMAT, class_vsm()); out->print_cr("\nClass space manager: " INTPTR_FORMAT, p2i(class_vsm()));
class_vsm()->dump(out); class_vsm()->dump(out);
} }
} }
@ -3932,13 +3930,13 @@ class TestVirtualSpaceNodeTest {
assert(vsn.is_available(word_size), \ assert(vsn.is_available(word_size), \
err_msg(#word_size ": " PTR_FORMAT " bytes were not available in " \ err_msg(#word_size ": " PTR_FORMAT " bytes were not available in " \
"VirtualSpaceNode [" PTR_FORMAT ", " PTR_FORMAT ")", \ "VirtualSpaceNode [" PTR_FORMAT ", " PTR_FORMAT ")", \
(uintptr_t)(word_size * BytesPerWord), vsn.bottom(), vsn.end())); (uintptr_t)(word_size * BytesPerWord), p2i(vsn.bottom()), p2i(vsn.end())));
#define assert_is_available_negative(word_size) \ #define assert_is_available_negative(word_size) \
assert(!vsn.is_available(word_size), \ assert(!vsn.is_available(word_size), \
err_msg(#word_size ": " PTR_FORMAT " bytes should not be available in " \ err_msg(#word_size ": " PTR_FORMAT " bytes should not be available in " \
"VirtualSpaceNode [" PTR_FORMAT ", " PTR_FORMAT ")", \ "VirtualSpaceNode [" PTR_FORMAT ", " PTR_FORMAT ")", \
(uintptr_t)(word_size * BytesPerWord), vsn.bottom(), vsn.end())); (uintptr_t)(word_size * BytesPerWord), p2i(vsn.bottom()), p2i(vsn.end())));
static void test_is_available_positive() { static void test_is_available_positive() {
// Reserve some memory. // Reserve some memory.

View File

@ -35,8 +35,6 @@
#include "runtime/java.hpp" #include "runtime/java.hpp"
#include "runtime/jniHandles.hpp" #include "runtime/jniHandles.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
ReferencePolicy* ReferenceProcessor::_always_clear_soft_ref_policy = NULL; ReferencePolicy* ReferenceProcessor::_always_clear_soft_ref_policy = NULL;
ReferencePolicy* ReferenceProcessor::_default_soft_ref_policy = NULL; ReferencePolicy* ReferenceProcessor::_default_soft_ref_policy = NULL;
bool ReferenceProcessor::_pending_list_uses_discovered_field = false; bool ReferenceProcessor::_pending_list_uses_discovered_field = false;
@ -161,7 +159,7 @@ void ReferenceProcessor::update_soft_ref_master_clock() {
NOT_PRODUCT( NOT_PRODUCT(
if (now < _soft_ref_timestamp_clock) { if (now < _soft_ref_timestamp_clock) {
warning("time warp: "INT64_FORMAT" to "INT64_FORMAT, warning("time warp: " JLONG_FORMAT " to " JLONG_FORMAT,
_soft_ref_timestamp_clock, now); _soft_ref_timestamp_clock, now);
} }
) )
@ -361,7 +359,7 @@ void ReferenceProcessor::enqueue_discovered_reflist(DiscoveredList& refs_list,
// field. // field.
if (TraceReferenceGC && PrintGCDetails) { if (TraceReferenceGC && PrintGCDetails) {
gclog_or_tty->print_cr("ReferenceProcessor::enqueue_discovered_reflist list " gclog_or_tty->print_cr("ReferenceProcessor::enqueue_discovered_reflist list "
INTPTR_FORMAT, (address)refs_list.head()); INTPTR_FORMAT, p2i(refs_list.head()));
} }
oop obj = NULL; oop obj = NULL;
@ -375,7 +373,7 @@ void ReferenceProcessor::enqueue_discovered_reflist(DiscoveredList& refs_list,
next_d = java_lang_ref_Reference::discovered(obj); next_d = java_lang_ref_Reference::discovered(obj);
if (TraceReferenceGC && PrintGCDetails) { if (TraceReferenceGC && PrintGCDetails) {
gclog_or_tty->print_cr(" obj " INTPTR_FORMAT "/next_d " INTPTR_FORMAT, gclog_or_tty->print_cr(" obj " INTPTR_FORMAT "/next_d " INTPTR_FORMAT,
(void *)obj, (void *)next_d); p2i(obj), p2i(next_d));
} }
assert(java_lang_ref_Reference::next(obj) == NULL, assert(java_lang_ref_Reference::next(obj) == NULL,
"Reference not active; should not be discovered"); "Reference not active; should not be discovered");
@ -402,7 +400,7 @@ void ReferenceProcessor::enqueue_discovered_reflist(DiscoveredList& refs_list,
next_d = java_lang_ref_Reference::discovered(obj); next_d = java_lang_ref_Reference::discovered(obj);
if (TraceReferenceGC && PrintGCDetails) { if (TraceReferenceGC && PrintGCDetails) {
gclog_or_tty->print_cr(" obj " INTPTR_FORMAT "/next_d " INTPTR_FORMAT, gclog_or_tty->print_cr(" obj " INTPTR_FORMAT "/next_d " INTPTR_FORMAT,
(void *)obj, (void *)next_d); p2i(obj), p2i(next_d));
} }
assert(java_lang_ref_Reference::next(obj) == NULL, assert(java_lang_ref_Reference::next(obj) == NULL,
"The reference should not be enqueued"); "The reference should not be enqueued");
@ -565,7 +563,7 @@ ReferenceProcessor::process_phase1(DiscoveredList& refs_list,
!policy->should_clear_reference(iter.obj(), _soft_ref_timestamp_clock)) { !policy->should_clear_reference(iter.obj(), _soft_ref_timestamp_clock)) {
if (TraceReferenceGC) { if (TraceReferenceGC) {
gclog_or_tty->print_cr("Dropping reference (" INTPTR_FORMAT ": %s" ") by policy", gclog_or_tty->print_cr("Dropping reference (" INTPTR_FORMAT ": %s" ") by policy",
(void *)iter.obj(), iter.obj()->klass()->internal_name()); p2i(iter.obj()), iter.obj()->klass()->internal_name());
} }
// Remove Reference object from list // Remove Reference object from list
iter.remove(); iter.remove();
@ -582,9 +580,9 @@ ReferenceProcessor::process_phase1(DiscoveredList& refs_list,
complete_gc->do_void(); complete_gc->do_void();
NOT_PRODUCT( NOT_PRODUCT(
if (PrintGCDetails && TraceReferenceGC) { if (PrintGCDetails && TraceReferenceGC) {
gclog_or_tty->print_cr(" Dropped %d dead Refs out of %d " gclog_or_tty->print_cr(" Dropped " SIZE_FORMAT " dead Refs out of " SIZE_FORMAT
"discovered Refs by policy, from list " INTPTR_FORMAT, " discovered Refs by policy, from list " INTPTR_FORMAT,
iter.removed(), iter.processed(), (address)refs_list.head()); iter.removed(), iter.processed(), p2i(refs_list.head()));
} }
) )
} }
@ -604,7 +602,7 @@ ReferenceProcessor::pp2_work(DiscoveredList& refs_list,
if (iter.is_referent_alive()) { if (iter.is_referent_alive()) {
if (TraceReferenceGC) { if (TraceReferenceGC) {
gclog_or_tty->print_cr("Dropping strongly reachable reference (" INTPTR_FORMAT ": %s)", gclog_or_tty->print_cr("Dropping strongly reachable reference (" INTPTR_FORMAT ": %s)",
(void *)iter.obj(), iter.obj()->klass()->internal_name()); p2i(iter.obj()), iter.obj()->klass()->internal_name());
} }
// The referent is reachable after all. // The referent is reachable after all.
// Remove Reference object from list. // Remove Reference object from list.
@ -620,9 +618,9 @@ ReferenceProcessor::pp2_work(DiscoveredList& refs_list,
} }
NOT_PRODUCT( NOT_PRODUCT(
if (PrintGCDetails && TraceReferenceGC && (iter.processed() > 0)) { if (PrintGCDetails && TraceReferenceGC && (iter.processed() > 0)) {
gclog_or_tty->print_cr(" Dropped %d active Refs out of %d " gclog_or_tty->print_cr(" Dropped " SIZE_FORMAT " active Refs out of " SIZE_FORMAT
"Refs in discovered list " INTPTR_FORMAT, " Refs in discovered list " INTPTR_FORMAT,
iter.removed(), iter.processed(), (address)refs_list.head()); iter.removed(), iter.processed(), p2i(refs_list.head()));
} }
) )
} }
@ -659,9 +657,9 @@ ReferenceProcessor::pp2_work_concurrent_discovery(DiscoveredList& refs_list,
complete_gc->do_void(); complete_gc->do_void();
NOT_PRODUCT( NOT_PRODUCT(
if (PrintGCDetails && TraceReferenceGC && (iter.processed() > 0)) { if (PrintGCDetails && TraceReferenceGC && (iter.processed() > 0)) {
gclog_or_tty->print_cr(" Dropped %d active Refs out of %d " gclog_or_tty->print_cr(" Dropped " SIZE_FORMAT " active Refs out of " SIZE_FORMAT
"Refs in discovered list " INTPTR_FORMAT, " Refs in discovered list " INTPTR_FORMAT,
iter.removed(), iter.processed(), (address)refs_list.head()); iter.removed(), iter.processed(), p2i(refs_list.head()));
} }
) )
} }
@ -690,7 +688,7 @@ ReferenceProcessor::process_phase3(DiscoveredList& refs_list,
if (TraceReferenceGC) { if (TraceReferenceGC) {
gclog_or_tty->print_cr("Adding %sreference (" INTPTR_FORMAT ": %s) as pending", gclog_or_tty->print_cr("Adding %sreference (" INTPTR_FORMAT ": %s) as pending",
clear_referent ? "cleared " : "", clear_referent ? "cleared " : "",
(void *)iter.obj(), iter.obj()->klass()->internal_name()); p2i(iter.obj()), iter.obj()->klass()->internal_name());
} }
assert(iter.obj()->is_oop(UseConcMarkSweepGC), "Adding a bad reference"); assert(iter.obj()->is_oop(UseConcMarkSweepGC), "Adding a bad reference");
iter.next(); iter.next();
@ -807,11 +805,11 @@ void ReferenceProcessor::balance_queues(DiscoveredList ref_lists[])
for (uint i = 0; i < _max_num_q; ++i) { for (uint i = 0; i < _max_num_q; ++i) {
total_refs += ref_lists[i].length(); total_refs += ref_lists[i].length();
if (TraceReferenceGC && PrintGCDetails) { if (TraceReferenceGC && PrintGCDetails) {
gclog_or_tty->print("%d ", ref_lists[i].length()); gclog_or_tty->print(SIZE_FORMAT " ", ref_lists[i].length());
} }
} }
if (TraceReferenceGC && PrintGCDetails) { if (TraceReferenceGC && PrintGCDetails) {
gclog_or_tty->print_cr(" = %d", total_refs); gclog_or_tty->print_cr(" = " SIZE_FORMAT, total_refs);
} }
size_t avg_refs = total_refs / _num_q + 1; size_t avg_refs = total_refs / _num_q + 1;
uint to_idx = 0; uint to_idx = 0;
@ -877,11 +875,11 @@ void ReferenceProcessor::balance_queues(DiscoveredList ref_lists[])
for (uint i = 0; i < _max_num_q; ++i) { for (uint i = 0; i < _max_num_q; ++i) {
balanced_total_refs += ref_lists[i].length(); balanced_total_refs += ref_lists[i].length();
if (TraceReferenceGC && PrintGCDetails) { if (TraceReferenceGC && PrintGCDetails) {
gclog_or_tty->print("%d ", ref_lists[i].length()); gclog_or_tty->print(SIZE_FORMAT " ", ref_lists[i].length());
} }
} }
if (TraceReferenceGC && PrintGCDetails) { if (TraceReferenceGC && PrintGCDetails) {
gclog_or_tty->print_cr(" = %d", balanced_total_refs); gclog_or_tty->print_cr(" = " SIZE_FORMAT, balanced_total_refs);
gclog_or_tty->flush(); gclog_or_tty->flush();
} }
assert(total_refs == balanced_total_refs, "Balancing was incomplete"); assert(total_refs == balanced_total_refs, "Balancing was incomplete");
@ -923,7 +921,7 @@ ReferenceProcessor::process_discovered_reflist(
size_t total_list_count = total_count(refs_lists); size_t total_list_count = total_count(refs_lists);
if (PrintReferenceGC && PrintGCDetails) { if (PrintReferenceGC && PrintGCDetails) {
gclog_or_tty->print(", %u refs", total_list_count); gclog_or_tty->print(", " SIZE_FORMAT " refs", total_list_count);
} }
// Phase 1 (soft refs only): // Phase 1 (soft refs only):
@ -1016,7 +1014,7 @@ inline DiscoveredList* ReferenceProcessor::get_discovered_list(ReferenceType rt)
ShouldNotReachHere(); ShouldNotReachHere();
} }
if (TraceReferenceGC && PrintGCDetails) { if (TraceReferenceGC && PrintGCDetails) {
gclog_or_tty->print_cr("Thread %d gets list " INTPTR_FORMAT, id, list); gclog_or_tty->print_cr("Thread %d gets list " INTPTR_FORMAT, id, p2i(list));
} }
return list; return list;
} }
@ -1043,14 +1041,14 @@ ReferenceProcessor::add_to_discovered_list_mt(DiscoveredList& refs_list,
if (TraceReferenceGC) { if (TraceReferenceGC) {
gclog_or_tty->print_cr("Discovered reference (mt) (" INTPTR_FORMAT ": %s)", gclog_or_tty->print_cr("Discovered reference (mt) (" INTPTR_FORMAT ": %s)",
(void *)obj, obj->klass()->internal_name()); p2i(obj), obj->klass()->internal_name());
} }
} else { } else {
// If retest was non NULL, another thread beat us to it: // If retest was non NULL, another thread beat us to it:
// The reference has already been discovered... // The reference has already been discovered...
if (TraceReferenceGC) { if (TraceReferenceGC) {
gclog_or_tty->print_cr("Already discovered reference (" INTPTR_FORMAT ": %s)", gclog_or_tty->print_cr("Already discovered reference (" INTPTR_FORMAT ": %s)",
(void *)obj, obj->klass()->internal_name()); p2i(obj), obj->klass()->internal_name());
} }
} }
} }
@ -1065,7 +1063,7 @@ void ReferenceProcessor::verify_referent(oop obj) {
assert(da ? referent->is_oop() : referent->is_oop_or_null(), assert(da ? referent->is_oop() : referent->is_oop_or_null(),
err_msg("Bad referent " INTPTR_FORMAT " found in Reference " err_msg("Bad referent " INTPTR_FORMAT " found in Reference "
INTPTR_FORMAT " during %satomic discovery ", INTPTR_FORMAT " during %satomic discovery ",
(void *)referent, (void *)obj, da ? "" : "non-")); p2i(referent), p2i(obj), da ? "" : "non-"));
} }
#endif #endif
@ -1145,7 +1143,7 @@ bool ReferenceProcessor::discover_reference(oop obj, ReferenceType rt) {
// The reference has already been discovered... // The reference has already been discovered...
if (TraceReferenceGC) { if (TraceReferenceGC) {
gclog_or_tty->print_cr("Already discovered reference (" INTPTR_FORMAT ": %s)", gclog_or_tty->print_cr("Already discovered reference (" INTPTR_FORMAT ": %s)",
(void *)obj, obj->klass()->internal_name()); p2i(obj), obj->klass()->internal_name());
} }
if (RefDiscoveryPolicy == ReferentBasedDiscovery) { if (RefDiscoveryPolicy == ReferentBasedDiscovery) {
// assumes that an object is not processed twice; // assumes that an object is not processed twice;
@ -1203,7 +1201,7 @@ bool ReferenceProcessor::discover_reference(oop obj, ReferenceType rt) {
if (TraceReferenceGC) { if (TraceReferenceGC) {
gclog_or_tty->print_cr("Discovered reference (" INTPTR_FORMAT ": %s)", gclog_or_tty->print_cr("Discovered reference (" INTPTR_FORMAT ": %s)",
(void *)obj, obj->klass()->internal_name()); p2i(obj), obj->klass()->internal_name());
} }
} }
assert(obj->is_oop(), "Discovered a bad reference"); assert(obj->is_oop(), "Discovered a bad reference");
@ -1314,7 +1312,7 @@ ReferenceProcessor::preclean_discovered_reflist(DiscoveredList& refs_list,
// active; we need to trace and mark its cohort. // active; we need to trace and mark its cohort.
if (TraceReferenceGC) { if (TraceReferenceGC) {
gclog_or_tty->print_cr("Precleaning Reference (" INTPTR_FORMAT ": %s)", gclog_or_tty->print_cr("Precleaning Reference (" INTPTR_FORMAT ": %s)",
(void *)iter.obj(), iter.obj()->klass()->internal_name()); p2i(iter.obj()), iter.obj()->klass()->internal_name());
} }
// Remove Reference object from list // Remove Reference object from list
iter.remove(); iter.remove();
@ -1337,9 +1335,9 @@ ReferenceProcessor::preclean_discovered_reflist(DiscoveredList& refs_list,
NOT_PRODUCT( NOT_PRODUCT(
if (PrintGCDetails && PrintReferenceGC && (iter.processed() > 0)) { if (PrintGCDetails && PrintReferenceGC && (iter.processed() > 0)) {
gclog_or_tty->print_cr(" Dropped %d Refs out of %d " gclog_or_tty->print_cr(" Dropped " SIZE_FORMAT " Refs out of " SIZE_FORMAT
"Refs in discovered list " INTPTR_FORMAT, " Refs in discovered list " INTPTR_FORMAT,
iter.removed(), iter.processed(), (address)refs_list.head()); iter.removed(), iter.processed(), p2i(refs_list.head()));
} }
) )
} }

View File

@ -35,8 +35,6 @@
#include "utilities/copy.hpp" #include "utilities/copy.hpp"
#include "utilities/workgroup.hpp" #include "utilities/workgroup.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
SharedHeap* SharedHeap::_sh; SharedHeap* SharedHeap::_sh;
SharedHeap::SharedHeap(CollectorPolicy* policy_) : SharedHeap::SharedHeap(CollectorPolicy* policy_) :
@ -102,17 +100,3 @@ void SharedHeap::post_initialize() {
} }
void SharedHeap::ref_processing_init() {} void SharedHeap::ref_processing_init() {}
// Some utilities.
void SharedHeap::print_size_transition(outputStream* out,
size_t bytes_before,
size_t bytes_after,
size_t capacity) {
out->print(" " SIZE_FORMAT "%s->" SIZE_FORMAT "%s(" SIZE_FORMAT "%s)",
byte_size_in_proper_unit(bytes_before),
proper_unit_for_byte_size(bytes_before),
byte_size_in_proper_unit(bytes_after),
proper_unit_for_byte_size(bytes_after),
byte_size_in_proper_unit(capacity),
proper_unit_for_byte_size(capacity));
}

View File

@ -214,16 +214,6 @@ public:
// Sets the number of parallel threads that will be doing tasks // Sets the number of parallel threads that will be doing tasks
// (such as process roots) subsequently. // (such as process roots) subsequently.
virtual void set_par_threads(uint t); virtual void set_par_threads(uint t);
//
// New methods from CollectedHeap
//
// Some utilities.
void print_size_transition(outputStream* out,
size_t bytes_before,
size_t bytes_after,
size_t capacity);
}; };
#endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP #endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP

View File

@ -44,8 +44,6 @@
#include "utilities/globalDefinitions.hpp" #include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
HeapWord* DirtyCardToOopClosure::get_actual_top(HeapWord* top, HeapWord* DirtyCardToOopClosure::get_actual_top(HeapWord* top,
HeapWord* top_obj) { HeapWord* top_obj) {
if (top_obj != NULL) { if (top_obj != NULL) {
@ -456,20 +454,20 @@ void Space::print() const { print_on(tty); }
void Space::print_on(outputStream* st) const { void Space::print_on(outputStream* st) const {
print_short_on(st); print_short_on(st);
st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ")", st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ")",
bottom(), end()); p2i(bottom()), p2i(end()));
} }
void ContiguousSpace::print_on(outputStream* st) const { void ContiguousSpace::print_on(outputStream* st) const {
print_short_on(st); print_short_on(st);
st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")", st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")",
bottom(), top(), end()); p2i(bottom()), p2i(top()), p2i(end()));
} }
void OffsetTableContigSpace::print_on(outputStream* st) const { void OffsetTableContigSpace::print_on(outputStream* st) const {
print_short_on(st); print_short_on(st);
st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", "
INTPTR_FORMAT ", " INTPTR_FORMAT ")", INTPTR_FORMAT ", " INTPTR_FORMAT ")",
bottom(), top(), _offsets.threshold(), end()); p2i(bottom()), p2i(top()), p2i(_offsets.threshold()), p2i(end()));
} }
void ContiguousSpace::verify() const { void ContiguousSpace::verify() const {
@ -592,7 +590,7 @@ ALL_SINCE_SAVE_MARKS_CLOSURES(ContigSpace_OOP_SINCE_SAVE_MARKS_DEFN)
HeapWord* ContiguousSpace::block_start_const(const void* p) const { HeapWord* ContiguousSpace::block_start_const(const void* p) const {
assert(MemRegion(bottom(), end()).contains(p), assert(MemRegion(bottom(), end()).contains(p),
err_msg("p (" PTR_FORMAT ") not in space [" PTR_FORMAT ", " PTR_FORMAT ")", err_msg("p (" PTR_FORMAT ") not in space [" PTR_FORMAT ", " PTR_FORMAT ")",
p, bottom(), end())); p2i(p), p2i(bottom()), p2i(end())));
if (p >= top()) { if (p >= top()) {
return top(); return top();
} else { } else {
@ -603,7 +601,7 @@ HeapWord* ContiguousSpace::block_start_const(const void* p) const {
cur += oop(cur)->size(); cur += oop(cur)->size();
} }
assert(oop(last)->is_oop(), assert(oop(last)->is_oop(),
err_msg(PTR_FORMAT " should be an object start", last)); err_msg(PTR_FORMAT " should be an object start", p2i(last)));
return last; return last;
} }
} }
@ -611,15 +609,15 @@ HeapWord* ContiguousSpace::block_start_const(const void* p) const {
size_t ContiguousSpace::block_size(const HeapWord* p) const { size_t ContiguousSpace::block_size(const HeapWord* p) const {
assert(MemRegion(bottom(), end()).contains(p), assert(MemRegion(bottom(), end()).contains(p),
err_msg("p (" PTR_FORMAT ") not in space [" PTR_FORMAT ", " PTR_FORMAT ")", err_msg("p (" PTR_FORMAT ") not in space [" PTR_FORMAT ", " PTR_FORMAT ")",
p, bottom(), end())); p2i(p), p2i(bottom()), p2i(end())));
HeapWord* current_top = top(); HeapWord* current_top = top();
assert(p <= current_top, assert(p <= current_top,
err_msg("p > current top - p: " PTR_FORMAT ", current top: " PTR_FORMAT, err_msg("p > current top - p: " PTR_FORMAT ", current top: " PTR_FORMAT,
p, current_top)); p2i(p), p2i(current_top)));
assert(p == current_top || oop(p)->is_oop(), assert(p == current_top || oop(p)->is_oop(),
err_msg("p (" PTR_FORMAT ") is not a block start - " err_msg("p (" PTR_FORMAT ") is not a block start - "
"current_top: " PTR_FORMAT ", is_oop: %s", "current_top: " PTR_FORMAT ", is_oop: %s",
p, current_top, BOOL_TO_STR(oop(p)->is_oop()))); p2i(p), p2i(current_top), BOOL_TO_STR(oop(p)->is_oop())));
if (p < current_top) { if (p < current_top) {
return oop(p)->size(); return oop(p)->size();
} else { } else {

View File

@ -214,7 +214,7 @@ inline void CompactibleSpace::scan_and_adjust_pointers(SpaceType* space) {
assert(space->block_is_obj(q), "should be at block boundaries, and should be looking at objs"); assert(space->block_is_obj(q), "should be at block boundaries, and should be looking at objs");
// point all the oops to the new location // point all the oops to the new location
size_t size = oop(q)->adjust_pointers(); size_t size = MarkSweep::adjust_pointers(oop(q));
size = space->adjust_obj_size(size); size = space->adjust_obj_size(size);
q += size; q += size;
@ -238,7 +238,7 @@ inline void CompactibleSpace::scan_and_adjust_pointers(SpaceType* space) {
if (oop(q)->is_gc_marked()) { if (oop(q)->is_gc_marked()) {
// q is alive // q is alive
// point all the oops to the new location // point all the oops to the new location
size_t size = oop(q)->adjust_pointers(); size_t size = MarkSweep::adjust_pointers(oop(q));
size = space->adjust_obj_size(size); size = space->adjust_obj_size(size);
debug_only(prev_q = q); debug_only(prev_q = q);
q += size; q += size;

View File

@ -31,8 +31,6 @@
#include "runtime/thread.inline.hpp" #include "runtime/thread.inline.hpp"
#include "utilities/copy.hpp" #include "utilities/copy.hpp"
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// Thread-Local Edens support // Thread-Local Edens support
// static member initialization // static member initialization
@ -154,7 +152,7 @@ void ThreadLocalAllocBuffer::resize() {
if (PrintTLAB && Verbose) { if (PrintTLAB && Verbose) {
gclog_or_tty->print("TLAB new size: thread: " INTPTR_FORMAT " [id: %2d]" gclog_or_tty->print("TLAB new size: thread: " INTPTR_FORMAT " [id: %2d]"
" refills %d alloc: %8.6f desired_size: " SIZE_FORMAT " -> " SIZE_FORMAT "\n", " refills %d alloc: %8.6f desired_size: " SIZE_FORMAT " -> " SIZE_FORMAT "\n",
myThread(), myThread()->osthread()->thread_id(), p2i(myThread()), myThread()->osthread()->thread_id(),
_target_refills, _allocation_fraction.average(), desired_size(), aligned_new_size); _target_refills, _allocation_fraction.average(), desired_size(), aligned_new_size);
} }
set_desired_size(aligned_new_size); set_desired_size(aligned_new_size);
@ -263,7 +261,7 @@ void ThreadLocalAllocBuffer::print_stats(const char* tag) {
" slow allocs: %d refill waste: " SIZE_FORMAT "B" " slow allocs: %d refill waste: " SIZE_FORMAT "B"
" alloc:%8.5f %8.0fKB refills: %d waste %4.1f%% gc: %dB" " alloc:%8.5f %8.0fKB refills: %d waste %4.1f%% gc: %dB"
" slow: %dB fast: %dB\n", " slow: %dB fast: %dB\n",
tag, thrd, thrd->osthread()->thread_id(), tag, p2i(thrd), thrd->osthread()->thread_id(),
_desired_size / (K / HeapWordSize), _desired_size / (K / HeapWordSize),
_slow_allocations, _refill_waste_limit * HeapWordSize, _slow_allocations, _refill_waste_limit * HeapWordSize,
_allocation_fraction.average(), _allocation_fraction.average(),

View File

@ -84,8 +84,6 @@
#include "classfile/sharedClassUtil.hpp" #include "classfile/sharedClassUtil.hpp"
#endif #endif
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
// Known objects // Known objects
Klass* Universe::_boolArrayKlassObj = NULL; Klass* Universe::_boolArrayKlassObj = NULL;
Klass* Universe::_byteArrayKlassObj = NULL; Klass* Universe::_byteArrayKlassObj = NULL;
@ -792,12 +790,12 @@ jint Universe::initialize_heap() {
void Universe::print_compressed_oops_mode() { void Universe::print_compressed_oops_mode() {
tty->cr(); tty->cr();
tty->print("heap address: " PTR_FORMAT ", size: " SIZE_FORMAT " MB", tty->print("heap address: " PTR_FORMAT ", size: " SIZE_FORMAT " MB",
Universe::heap()->base(), Universe::heap()->reserved_region().byte_size()/M); p2i(Universe::heap()->base()), Universe::heap()->reserved_region().byte_size()/M);
tty->print(", Compressed Oops mode: %s", narrow_oop_mode_to_string(narrow_oop_mode())); tty->print(", Compressed Oops mode: %s", narrow_oop_mode_to_string(narrow_oop_mode()));
if (Universe::narrow_oop_base() != 0) { if (Universe::narrow_oop_base() != 0) {
tty->print(": " PTR_FORMAT, Universe::narrow_oop_base()); tty->print(": " PTR_FORMAT, p2i(Universe::narrow_oop_base()));
} }
if (Universe::narrow_oop_shift() != 0) { if (Universe::narrow_oop_shift() != 0) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -42,7 +42,6 @@
#if INCLUDE_ALL_GCS #if INCLUDE_ALL_GCS
#include "gc_implementation/parNew/parOopClosures.inline.hpp" #include "gc_implementation/parNew/parOopClosures.inline.hpp"
#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
#include "oops/oop.pcgc.inline.hpp"
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_ALL_GCS
// Macro to define InstanceClassLoaderKlass::oop_oop_iterate for virtual/nonvirtual for // Macro to define InstanceClassLoaderKlass::oop_oop_iterate for virtual/nonvirtual for

View File

@ -74,7 +74,6 @@
#include "gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp" #include "gc_implementation/parallelScavenge/parallelScavengeHeap.inline.hpp"
#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
#include "oops/oop.pcgc.inline.hpp"
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_ALL_GCS
#ifdef COMPILER1 #ifdef COMPILER1
#include "c1/c1_Compiler.hpp" #include "c1/c1_Compiler.hpp"

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -47,7 +47,6 @@
#include "gc_implementation/parNew/parOopClosures.inline.hpp" #include "gc_implementation/parNew/parOopClosures.inline.hpp"
#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
#include "oops/oop.pcgc.inline.hpp"
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_ALL_GCS
int InstanceMirrorKlass::_offset_of_static_fields = 0; int InstanceMirrorKlass::_offset_of_static_fields = 0;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -43,7 +43,6 @@
#include "gc_implementation/parNew/parOopClosures.inline.hpp" #include "gc_implementation/parNew/parOopClosures.inline.hpp"
#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
#include "oops/oop.pcgc.inline.hpp"
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_ALL_GCS
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC

View File

@ -55,7 +55,6 @@
#include "gc_implementation/parallelScavenge/psCompactionManager.hpp" #include "gc_implementation/parallelScavenge/psCompactionManager.hpp"
#include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp" #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
#include "gc_implementation/parallelScavenge/psScavenge.inline.hpp" #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
#include "oops/oop.pcgc.inline.hpp"
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_ALL_GCS
ObjArrayKlass* ObjArrayKlass::allocate(ClassLoaderData* loader_data, int n, KlassHandle klass_handle, Symbol* name, TRAPS) { ObjArrayKlass* ObjArrayKlass::allocate(ClassLoaderData* loader_data, int n, KlassHandle klass_handle, Symbol* name, TRAPS) {

View File

@ -527,11 +527,11 @@ typedef CompactHashtable<Symbol*, char> SymbolCompactHashTable;
nonstatic_field(CollectedHeap, _defer_initial_card_mark, bool) \ nonstatic_field(CollectedHeap, _defer_initial_card_mark, bool) \
nonstatic_field(CollectedHeap, _is_gc_active, bool) \ nonstatic_field(CollectedHeap, _is_gc_active, bool) \
nonstatic_field(CollectedHeap, _total_collections, unsigned int) \ nonstatic_field(CollectedHeap, _total_collections, unsigned int) \
\
nonstatic_field(CompactibleSpace, _compaction_top, HeapWord*) \ nonstatic_field(CompactibleSpace, _compaction_top, HeapWord*) \
nonstatic_field(CompactibleSpace, _first_dead, HeapWord*) \ nonstatic_field(CompactibleSpace, _first_dead, HeapWord*) \
nonstatic_field(CompactibleSpace, _end_of_live, HeapWord*) \ nonstatic_field(CompactibleSpace, _end_of_live, HeapWord*) \
\ \
\
nonstatic_field(ContiguousSpace, _top, HeapWord*) \ nonstatic_field(ContiguousSpace, _top, HeapWord*) \
nonstatic_field(ContiguousSpace, _concurrent_iteration_safe_limit, HeapWord*) \ nonstatic_field(ContiguousSpace, _concurrent_iteration_safe_limit, HeapWord*) \
nonstatic_field(ContiguousSpace, _saved_mark_word, HeapWord*) \ nonstatic_field(ContiguousSpace, _saved_mark_word, HeapWord*) \
@ -559,7 +559,9 @@ typedef CompactHashtable<Symbol*, char> SymbolCompactHashTable;
nonstatic_field(GenCollectedHeap, _young_gen, Generation*) \ nonstatic_field(GenCollectedHeap, _young_gen, Generation*) \
nonstatic_field(GenCollectedHeap, _old_gen, Generation*) \ nonstatic_field(GenCollectedHeap, _old_gen, Generation*) \
nonstatic_field(GenCollectedHeap, _n_gens, int) \ nonstatic_field(GenCollectedHeap, _n_gens, int) \
nonstatic_field(GenCollectedHeap, _gen_specs, GenerationSpec**) \ \
nonstatic_field(GenCollectorPolicy, _young_gen_spec, GenerationSpec*) \
nonstatic_field(GenCollectorPolicy, _old_gen_spec, GenerationSpec*) \
\ \
nonstatic_field(HeapWord, i, char*) \ nonstatic_field(HeapWord, i, char*) \
\ \
@ -1505,6 +1507,7 @@ typedef CompactHashtable<Symbol*, char> SymbolCompactHashTable;
declare_type(DefNewGeneration, Generation) \ declare_type(DefNewGeneration, Generation) \
declare_type(CardGeneration, Generation) \ declare_type(CardGeneration, Generation) \
declare_type(TenuredGeneration, CardGeneration) \ declare_type(TenuredGeneration, CardGeneration) \
declare_toplevel_type(GenCollectorPolicy) \
declare_toplevel_type(Space) \ declare_toplevel_type(Space) \
declare_toplevel_type(BitMap) \ declare_toplevel_type(BitMap) \
declare_type(CompactibleSpace, Space) \ declare_type(CompactibleSpace, Space) \

View File

@ -130,8 +130,7 @@ void MemoryService::add_gen_collected_heap_info(GenCollectedHeap* heap) {
GenCollectorPolicy* gen_policy = policy->as_generation_policy(); GenCollectorPolicy* gen_policy = policy->as_generation_policy();
if (gen_policy != NULL) { if (gen_policy != NULL) {
GenerationSpec** specs = gen_policy->generations(); Generation::Name kind = gen_policy->young_gen_spec()->name();
Generation::Name kind = specs[0]->name();
switch (kind) { switch (kind) {
case Generation::DefNew: case Generation::DefNew:
_minor_gc_manager = MemoryManager::get_copy_memory_manager(); _minor_gc_manager = MemoryManager::get_copy_memory_manager();