mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-15 08:34:30 +02:00
8338490: Serial: Move Generation::print_on to subclasses
Reviewed-by: gli
This commit is contained in:
parent
80adea8e0a
commit
918cf11454
7 changed files with 28 additions and 38 deletions
|
@ -846,7 +846,15 @@ void DefNewGeneration::verify() {
|
|||
}
|
||||
|
||||
void DefNewGeneration::print_on(outputStream* st) const {
|
||||
Generation::print_on(st);
|
||||
st->print(" %-10s", name());
|
||||
|
||||
st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K",
|
||||
capacity()/K, used()/K);
|
||||
st->print_cr(" [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ")",
|
||||
p2i(_virtual_space.low_boundary()),
|
||||
p2i(_virtual_space.high()),
|
||||
p2i(_virtual_space.high_boundary()));
|
||||
|
||||
st->print(" eden");
|
||||
eden()->print_on(st);
|
||||
st->print(" from");
|
||||
|
@ -855,11 +863,6 @@ void DefNewGeneration::print_on(outputStream* st) const {
|
|||
to()->print_on(st);
|
||||
}
|
||||
|
||||
|
||||
const char* DefNewGeneration::name() const {
|
||||
return "def new generation";
|
||||
}
|
||||
|
||||
HeapWord* DefNewGeneration::allocate(size_t word_size) {
|
||||
// This is the slow-path allocation for the DefNewGeneration.
|
||||
// Most allocations are fast-path in compiled code.
|
||||
|
|
|
@ -234,8 +234,7 @@ class DefNewGeneration: public Generation {
|
|||
void update_counters();
|
||||
|
||||
// Printing
|
||||
virtual const char* name() const;
|
||||
virtual const char* short_name() const { return "DefNew"; }
|
||||
const char* name() const { return "DefNew"; }
|
||||
|
||||
void print_on(outputStream* st) const;
|
||||
|
||||
|
|
|
@ -58,15 +58,3 @@ Generation::Generation(ReservedSpace rs, size_t initial_size) :
|
|||
size_t Generation::max_capacity() const {
|
||||
return reserved().byte_size();
|
||||
}
|
||||
|
||||
void Generation::print() const { print_on(tty); }
|
||||
|
||||
void Generation::print_on(outputStream* st) const {
|
||||
st->print(" %-20s", name());
|
||||
st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K",
|
||||
capacity()/K, used()/K);
|
||||
st->print_cr(" [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ")",
|
||||
p2i(_virtual_space.low_boundary()),
|
||||
p2i(_virtual_space.high()),
|
||||
p2i(_virtual_space.high_boundary()));
|
||||
}
|
||||
|
|
|
@ -103,13 +103,6 @@ class Generation: public CHeapObj<mtGC> {
|
|||
return _reserved.contains(p);
|
||||
}
|
||||
|
||||
// Printing
|
||||
virtual const char* name() const = 0;
|
||||
virtual const char* short_name() const = 0;
|
||||
|
||||
virtual void print() const;
|
||||
virtual void print_on(outputStream* st) const;
|
||||
|
||||
virtual void verify() = 0;
|
||||
|
||||
public:
|
||||
|
|
|
@ -882,12 +882,12 @@ void SerialHeap::verify(VerifyOption option /* ignored */) {
|
|||
}
|
||||
|
||||
void SerialHeap::print_on(outputStream* st) const {
|
||||
if (_young_gen != nullptr) {
|
||||
_young_gen->print_on(st);
|
||||
}
|
||||
if (_old_gen != nullptr) {
|
||||
_old_gen->print_on(st);
|
||||
}
|
||||
assert(_young_gen != nullptr, "precondition");
|
||||
assert(_old_gen != nullptr, "precondition");
|
||||
|
||||
_young_gen->print_on(st);
|
||||
_old_gen->print_on(st);
|
||||
|
||||
MetaspaceUtils::print_on(st);
|
||||
}
|
||||
|
||||
|
@ -908,7 +908,7 @@ void SerialHeap::print_heap_change(const PreGenGCValues& pre_gc_values) const {
|
|||
log_info(gc, heap)(HEAP_CHANGE_FORMAT" "
|
||||
HEAP_CHANGE_FORMAT" "
|
||||
HEAP_CHANGE_FORMAT,
|
||||
HEAP_CHANGE_FORMAT_ARGS(def_new_gen->short_name(),
|
||||
HEAP_CHANGE_FORMAT_ARGS(def_new_gen->name(),
|
||||
pre_gc_values.young_gen_used(),
|
||||
pre_gc_values.young_gen_capacity(),
|
||||
def_new_gen->used(),
|
||||
|
@ -924,7 +924,7 @@ void SerialHeap::print_heap_change(const PreGenGCValues& pre_gc_values) const {
|
|||
def_new_gen->from()->used(),
|
||||
def_new_gen->from()->capacity()));
|
||||
log_info(gc, heap)(HEAP_CHANGE_FORMAT,
|
||||
HEAP_CHANGE_FORMAT_ARGS(old_gen()->short_name(),
|
||||
HEAP_CHANGE_FORMAT_ARGS(old_gen()->name(),
|
||||
pre_gc_values.old_gen_used(),
|
||||
pre_gc_values.old_gen_capacity(),
|
||||
old_gen()->used(),
|
||||
|
|
|
@ -440,7 +440,15 @@ void TenuredGeneration::verify() {
|
|||
}
|
||||
|
||||
void TenuredGeneration::print_on(outputStream* st) const {
|
||||
Generation::print_on(st);
|
||||
st->print(" %-10s", name());
|
||||
|
||||
st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K",
|
||||
capacity()/K, used()/K);
|
||||
st->print_cr(" [" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT ")",
|
||||
p2i(_virtual_space.low_boundary()),
|
||||
p2i(_virtual_space.high()),
|
||||
p2i(_virtual_space.high_boundary()));
|
||||
|
||||
st->print(" the");
|
||||
_the_space->print_on(st);
|
||||
}
|
||||
|
|
|
@ -121,8 +121,7 @@ public:
|
|||
CardTableRS* remset);
|
||||
|
||||
// Printing
|
||||
const char* name() const { return "tenured generation"; }
|
||||
const char* short_name() const { return "Tenured"; }
|
||||
const char* name() const { return "Tenured"; }
|
||||
|
||||
// Iteration
|
||||
void object_iterate(ObjectClosure* blk);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue