8268520: VirtualSpace::print_on() should be const

Reviewed-by: kbarrett, stuefe, tschatzl
This commit is contained in:
Ioi Lam 2021-06-14 05:55:20 +00:00
parent 1ba4e0cada
commit ba601b8407
3 changed files with 5 additions and 6 deletions

View file

@ -293,8 +293,7 @@ void EpsilonHeap::object_iterate(ObjectClosure *cl) {
void EpsilonHeap::print_on(outputStream *st) const { void EpsilonHeap::print_on(outputStream *st) const {
st->print_cr("Epsilon Heap"); st->print_cr("Epsilon Heap");
// Cast away constness: _virtual_space.print_on(st);
((VirtualSpace)_virtual_space).print_on(st);
if (_space != NULL) { if (_space != NULL) {
st->print_cr("Allocation space:"); st->print_cr("Allocation space:");

View file

@ -1036,7 +1036,7 @@ void VirtualSpace::check_for_contiguity() {
assert(high() <= upper_high(), "upper high"); assert(high() <= upper_high(), "upper high");
} }
void VirtualSpace::print_on(outputStream* out) { void VirtualSpace::print_on(outputStream* out) const {
out->print ("Virtual space:"); out->print ("Virtual space:");
if (special()) out->print(" (pinned in memory)"); if (special()) out->print(" (pinned in memory)");
out->cr(); out->cr();
@ -1046,7 +1046,7 @@ void VirtualSpace::print_on(outputStream* out) {
out->print_cr(" - [low_b, high_b]: [" INTPTR_FORMAT ", " INTPTR_FORMAT "]", p2i(low_boundary()), p2i(high_boundary())); out->print_cr(" - [low_b, high_b]: [" INTPTR_FORMAT ", " INTPTR_FORMAT "]", p2i(low_boundary()), p2i(high_boundary()));
} }
void VirtualSpace::print() { void VirtualSpace::print() const {
print_on(tty); print_on(tty);
} }

View file

@ -240,8 +240,8 @@ class VirtualSpace {
void check_for_contiguity() PRODUCT_RETURN; void check_for_contiguity() PRODUCT_RETURN;
// Debugging // Debugging
void print_on(outputStream* out) PRODUCT_RETURN; void print_on(outputStream* out) const PRODUCT_RETURN;
void print(); void print() const;
}; };
#endif // SHARE_MEMORY_VIRTUALSPACE_HPP #endif // SHARE_MEMORY_VIRTUALSPACE_HPP