Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8246134: ZGC: Restructure hs_err sections
Reviewed-by: pliden, eosterlund
  • Loading branch information
stefank committed May 29, 2020
1 parent 56b7960 commit 26a18414f670169628e4cd868932171bca8d6322
@@ -95,3 +95,7 @@ void ZBarrierSet::on_thread_detach(Thread* thread) {
// Flush and free any remaining mark stacks
ZHeap::heap()->mark_flush_and_free(thread);
}

void ZBarrierSet::print_on(outputStream* st) const {
st->print_cr("ZBarrierSet");
}
@@ -40,7 +40,7 @@ class ZBarrierSet : public BarrierSet {
virtual void on_thread_attach(Thread* thread);
virtual void on_thread_detach(Thread* thread);

virtual void print_on(outputStream* st) const {}
virtual void print_on(outputStream* st) const;

template <DecoratorSet decorators, typename BarrierSetT = ZBarrierSet>
class AccessBarrier : public BarrierSet::AccessBarrier<decorators, BarrierSetT> {
@@ -305,20 +305,24 @@ void ZCollectedHeap::print_on(outputStream* st) const {
}

void ZCollectedHeap::print_on_error(outputStream* st) const {
st->print_cr("ZGC Globals:");
st->print_cr(" GlobalPhase: %u (%s)", ZGlobalPhase, ZGlobalPhaseToString());
st->print_cr(" GlobalSeqNum: %u", ZGlobalSeqNum);
st->print_cr(" Offset Max: " SIZE_FORMAT "%s (" PTR_FORMAT ")",
byte_size_in_exact_unit(ZAddressOffsetMax),
exact_unit_for_byte_size(ZAddressOffsetMax),
ZAddressOffsetMax);
st->print_cr(" Page Size Small: " SIZE_FORMAT "M", ZPageSizeSmall / M);
st->print_cr(" Page Size Medium: " SIZE_FORMAT "M", ZPageSizeMedium / M);
st->cr();
st->print_cr("ZGC Metadata Bits:");
st->print_cr(" Good: " PTR_FORMAT, ZAddressGoodMask);
st->print_cr(" Bad: " PTR_FORMAT, ZAddressBadMask);
st->print_cr(" WeakBad: " PTR_FORMAT, ZAddressWeakBadMask);
st->print_cr(" Marked: " PTR_FORMAT, ZAddressMetadataMarked);
st->print_cr(" Remapped: " PTR_FORMAT, ZAddressMetadataRemapped);
st->cr();
CollectedHeap::print_on_error(st);

st->print_cr( "Heap");
st->print_cr( " GlobalPhase: %u", ZGlobalPhase);
st->print_cr( " GlobalSeqNum: %u", ZGlobalSeqNum);
st->print_cr( " Offset Max: " SIZE_FORMAT_W(-15) " (" PTR_FORMAT ")", ZAddressOffsetMax, ZAddressOffsetMax);
st->print_cr( " Page Size Small: " SIZE_FORMAT_W(-15) " (" PTR_FORMAT ")", ZPageSizeSmall, ZPageSizeSmall);
st->print_cr( " Page Size Medium: " SIZE_FORMAT_W(-15) " (" PTR_FORMAT ")", ZPageSizeMedium, ZPageSizeMedium);
st->print_cr( "Metadata Bits");
st->print_cr( " Good: " PTR_FORMAT, ZAddressGoodMask);
st->print_cr( " Bad: " PTR_FORMAT, ZAddressBadMask);
st->print_cr( " WeakBad: " PTR_FORMAT, ZAddressWeakBadMask);
st->print_cr( " Marked: " PTR_FORMAT, ZAddressMetadataMarked);
st->print_cr( " Remapped: " PTR_FORMAT, ZAddressMetadataRemapped);
}

void ZCollectedHeap::print_extended_on(outputStream* st) const {
@@ -54,3 +54,19 @@ uintptr_t ZAddressMetadataMarked0;
uintptr_t ZAddressMetadataMarked1;
uintptr_t ZAddressMetadataRemapped;
uintptr_t ZAddressMetadataFinalizable;

const char* ZGlobalPhaseToString() {
switch (ZGlobalPhase) {
case ZPhaseMark:
return "Mark";

case ZPhaseMarkCompleted:
return "MarkCompleted";

case ZPhaseRelocate:
return "Relocate";

default:
return "Unknown";
}
}
@@ -36,6 +36,7 @@ extern uint32_t ZGlobalPhase;
const uint32_t ZPhaseMark = 0;
const uint32_t ZPhaseMarkCompleted = 1;
const uint32_t ZPhaseRelocate = 2;
const char* ZGlobalPhaseToString();

// Global sequence number
extern uint32_t ZGlobalSeqNum;
@@ -505,15 +505,14 @@ void ZHeap::print_extended_on(outputStream* st) const {
_page_allocator.enable_deferred_delete();

// Print all pages
st->print_cr("ZGC Page Table:");
ZPageTableIterator iter(&_page_table);
for (ZPage* page; iter.next(&page);) {
page->print_on(st);
}

// Allow pages to be deleted
_page_allocator.enable_deferred_delete();

st->cr();
}

bool ZHeap::print_location(outputStream* st, uintptr_t addr) const {

0 comments on commit 26a1841

Please sign in to comment.