mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8151603: Use error stream instead of tty for logging before ShouldNotReachHere()
Reviewed-by: mgerdin, sjohanss
This commit is contained in:
parent
7aaa74dca3
commit
4549d85d87
2 changed files with 20 additions and 17 deletions
|
@ -7047,13 +7047,13 @@ SweepClosure::SweepClosure(CMSCollector* collector,
|
||||||
}
|
}
|
||||||
|
|
||||||
void SweepClosure::print_on(outputStream* st) const {
|
void SweepClosure::print_on(outputStream* st) const {
|
||||||
tty->print_cr("_sp = [" PTR_FORMAT "," PTR_FORMAT ")",
|
st->print_cr("_sp = [" PTR_FORMAT "," PTR_FORMAT ")",
|
||||||
p2i(_sp->bottom()), p2i(_sp->end()));
|
p2i(_sp->bottom()), p2i(_sp->end()));
|
||||||
tty->print_cr("_limit = " PTR_FORMAT, p2i(_limit));
|
st->print_cr("_limit = " PTR_FORMAT, p2i(_limit));
|
||||||
tty->print_cr("_freeFinger = " PTR_FORMAT, p2i(_freeFinger));
|
st->print_cr("_freeFinger = " PTR_FORMAT, p2i(_freeFinger));
|
||||||
NOT_PRODUCT(tty->print_cr("_last_fc = " PTR_FORMAT, p2i(_last_fc));)
|
NOT_PRODUCT(st->print_cr("_last_fc = " PTR_FORMAT, p2i(_last_fc));)
|
||||||
tty->print_cr("_inFreeRange = %d, _freeRangeInFreeLists = %d, _lastFreeRangeCoalesced = %d",
|
st->print_cr("_inFreeRange = %d, _freeRangeInFreeLists = %d, _lastFreeRangeCoalesced = %d",
|
||||||
_inFreeRange, _freeRangeInFreeLists, _lastFreeRangeCoalesced);
|
_inFreeRange, _freeRangeInFreeLists, _lastFreeRangeCoalesced);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
|
@ -7066,8 +7066,10 @@ SweepClosure::~SweepClosure() {
|
||||||
assert(_limit >= _sp->bottom() && _limit <= _sp->end(),
|
assert(_limit >= _sp->bottom() && _limit <= _sp->end(),
|
||||||
"sweep _limit out of bounds");
|
"sweep _limit out of bounds");
|
||||||
if (inFreeRange()) {
|
if (inFreeRange()) {
|
||||||
warning("inFreeRange() should have been reset; dumping state of SweepClosure");
|
LogHandle(gc, sweep) log;
|
||||||
print();
|
log.error("inFreeRange() should have been reset; dumping state of SweepClosure");
|
||||||
|
ResourceMark rm;
|
||||||
|
print_on(log.error_stream());
|
||||||
ShouldNotReachHere();
|
ShouldNotReachHere();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,18 +82,19 @@ inline void ParScanClosure::do_oop_work(T* p,
|
||||||
if ((HeapWord*)obj < _boundary) {
|
if ((HeapWord*)obj < _boundary) {
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
if (_g->to()->is_in_reserved(obj)) {
|
if (_g->to()->is_in_reserved(obj)) {
|
||||||
tty->print_cr("Scanning field (" PTR_FORMAT ") twice?", p2i(p));
|
LogHandle(gc) log;
|
||||||
|
log.error("Scanning field (" PTR_FORMAT ") twice?", p2i(p));
|
||||||
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
GenCollectedHeap* gch = GenCollectedHeap::heap();
|
||||||
Space* sp = gch->space_containing(p);
|
Space* sp = gch->space_containing(p);
|
||||||
oop obj = oop(sp->block_start(p));
|
oop obj = oop(sp->block_start(p));
|
||||||
assert((HeapWord*)obj < (HeapWord*)p, "Error");
|
assert((HeapWord*)obj < (HeapWord*)p, "Error");
|
||||||
tty->print_cr("Object: " PTR_FORMAT, p2i((void *)obj));
|
log.error("Object: " PTR_FORMAT, p2i((void *)obj));
|
||||||
tty->print_cr("-------");
|
log.error("-------");
|
||||||
obj->print();
|
obj->print_on(log.error_stream());
|
||||||
tty->print_cr("-----");
|
log.error("-----");
|
||||||
tty->print_cr("Heap:");
|
log.error("Heap:");
|
||||||
tty->print_cr("-----");
|
log.error("-----");
|
||||||
gch->print();
|
gch->print_on(log.error_stream());
|
||||||
ShouldNotReachHere();
|
ShouldNotReachHere();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue