< prev index next >
src/share/vm/gc/g1/youngList.cpp
Print this page
@@ -27,10 +27,11 @@
#include "gc/g1/g1CollectorPolicy.hpp"
#include "gc/g1/heapRegion.hpp"
#include "gc/g1/heapRegion.inline.hpp"
#include "gc/g1/heapRegionRemSet.hpp"
#include "gc/g1/youngList.hpp"
+#include "logging/log.hpp"
#include "utilities/ostream.hpp"
YoungList::YoungList(G1CollectedHeap* g1h) :
_g1h(g1h), _head(NULL), _length(0), _last_sampled_rs_lengths(0),
_survivor_head(NULL), _survivor_tail(NULL), _survivor_length(0) {
@@ -96,11 +97,11 @@
uint length = 0;
HeapRegion* curr = _head;
HeapRegion* last = NULL;
while (curr != NULL) {
if (!curr->is_young()) {
- gclog_or_tty->print_cr("### YOUNG REGION " PTR_FORMAT "-" PTR_FORMAT " "
+ log_info(gc, verify)("### YOUNG REGION " PTR_FORMAT "-" PTR_FORMAT " "
"incorrectly tagged (y: %d, surv: %d)",
p2i(curr->bottom()), p2i(curr->end()),
curr->is_young(), curr->is_survivor());
ret = false;
}
@@ -109,36 +110,35 @@
curr = curr->get_next_young_region();
}
ret = ret && (length == _length);
if (!ret) {
- gclog_or_tty->print_cr("### YOUNG LIST seems not well formed!");
- gclog_or_tty->print_cr("### list has %u entries, _length is %u",
+ log_info(gc, verify)("### YOUNG LIST seems not well formed!");
+ log_info(gc, verify)("### list has %u entries, _length is %u",
length, _length);
}
return ret;
}
bool YoungList::check_list_empty(bool check_sample) {
bool ret = true;
if (_length != 0) {
- gclog_or_tty->print_cr("### YOUNG LIST should have 0 length, not %u",
- _length);
+ log_info(gc, verify)("### YOUNG LIST should have 0 length, not %u", _length);
ret = false;
}
if (check_sample && _last_sampled_rs_lengths != 0) {
- gclog_or_tty->print_cr("### YOUNG LIST has non-zero last sampled RS lengths");
+ log_info(gc, verify)("### YOUNG LIST has non-zero last sampled RS lengths");
ret = false;
}
if (_head != NULL) {
- gclog_or_tty->print_cr("### YOUNG LIST does not have a NULL head");
+ log_info(gc, verify)("### YOUNG LIST does not have a NULL head");
ret = false;
}
if (!ret) {
- gclog_or_tty->print_cr("### YOUNG LIST does not seem empty");
+ log_info(gc, verify)("### YOUNG LIST does not seem empty");
}
return ret;
}
@@ -169,11 +169,10 @@
}
_curr = _curr->get_next_young_region();
if (_curr == NULL) {
_last_sampled_rs_lengths = _sampled_rs_lengths;
- // gclog_or_tty->print_cr("last sampled RS lengths = %d", _last_sampled_rs_lengths);
}
}
void
YoungList::reset_auxilary_lists() {
@@ -220,22 +219,22 @@
void YoungList::print() {
HeapRegion* lists[] = {_head, _survivor_head};
const char* names[] = {"YOUNG", "SURVIVOR"};
for (uint list = 0; list < ARRAY_SIZE(lists); ++list) {
- gclog_or_tty->print_cr("%s LIST CONTENTS", names[list]);
+ tty->print_cr("%s LIST CONTENTS", names[list]);
HeapRegion *curr = lists[list];
if (curr == NULL) {
- gclog_or_tty->print_cr(" empty");
+ tty->print_cr(" empty");
}
while (curr != NULL) {
- gclog_or_tty->print_cr(" " HR_FORMAT ", P: " PTR_FORMAT ", N: " PTR_FORMAT ", age: %4d",
+ tty->print_cr(" " HR_FORMAT ", P: " PTR_FORMAT ", N: " PTR_FORMAT ", age: %4d",
HR_FORMAT_PARAMS(curr),
p2i(curr->prev_top_at_mark_start()),
p2i(curr->next_top_at_mark_start()),
curr->age_in_surv_rate_group_cond());
curr = curr->get_next_young_region();
}
}
- gclog_or_tty->cr();
+ tty->cr();
}
< prev index next >