< prev index next >
src/share/vm/gc/g1/youngList.cpp
Print this page
*** 27,36 ****
--- 27,37 ----
#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,106 ****
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 " "
"incorrectly tagged (y: %d, surv: %d)",
p2i(curr->bottom()), p2i(curr->end()),
curr->is_young(), curr->is_survivor());
ret = false;
}
--- 97,107 ----
uint length = 0;
HeapRegion* curr = _head;
HeapRegion* last = NULL;
while (curr != NULL) {
if (!curr->is_young()) {
! 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,144 ****
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",
! 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);
ret = false;
}
if (check_sample && _last_sampled_rs_lengths != 0) {
! gclog_or_tty->print_cr("### 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");
ret = false;
}
if (!ret) {
! gclog_or_tty->print_cr("### YOUNG LIST does not seem empty");
}
return ret;
}
--- 110,143 ----
curr = curr->get_next_young_region();
}
ret = ret && (length == _length);
if (!ret) {
! 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) {
! log_info(gc, verify)("### YOUNG LIST should have 0 length, not %u", _length);
ret = false;
}
if (check_sample && _last_sampled_rs_lengths != 0) {
! log_info(gc, verify)("### YOUNG LIST has non-zero last sampled RS lengths");
ret = false;
}
if (_head != NULL) {
! log_info(gc, verify)("### YOUNG LIST does not have a NULL head");
ret = false;
}
if (!ret) {
! log_info(gc, verify)("### YOUNG LIST does not seem empty");
}
return ret;
}
*** 169,179 ****
}
_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() {
--- 168,177 ----
*** 220,241 ****
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]);
HeapRegion *curr = lists[list];
if (curr == NULL) {
! gclog_or_tty->print_cr(" empty");
}
while (curr != NULL) {
! gclog_or_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();
}
--- 218,239 ----
void YoungList::print() {
HeapRegion* lists[] = {_head, _survivor_head};
const char* names[] = {"YOUNG", "SURVIVOR"};
for (uint list = 0; list < ARRAY_SIZE(lists); ++list) {
! tty->print_cr("%s LIST CONTENTS", names[list]);
HeapRegion *curr = lists[list];
if (curr == NULL) {
! tty->print_cr(" empty");
}
while (curr != NULL) {
! 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();
}
}
! tty->cr();
}
< prev index next >