Mercurial > hg > graal-jvmci-8
changeset 21114:2daf39328194
Better error reporting for missing card marks
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Thu, 23 Apr 2015 21:18:27 -0700 |
parents | 0cf5897db25a |
children | db96f9915540 |
files | src/share/vm/memory/cardTableRS.cpp |
diffstat | 1 files changed, 21 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/vm/memory/cardTableRS.cpp Wed Apr 22 16:42:05 2015 -0700 +++ b/src/share/vm/memory/cardTableRS.cpp Thu Apr 23 21:18:27 2015 -0700 @@ -352,15 +352,22 @@ "[_begin, _end) = [" PTR_FORMAT "," PTR_FORMAT ")", p2i(jp), p2i(_begin), p2i(_end))); oop obj = oopDesc::load_decode_heap_oop(p); - guarantee(obj == NULL || (HeapWord*)obj >= _boundary, - err_msg("pointer " PTR_FORMAT " at " PTR_FORMAT " on " - "clean card crosses boundary" PTR_FORMAT, - p2i((HeapWord*)obj), p2i(jp), p2i(_boundary))); + if (!(obj == NULL || (HeapWord*)obj >= _boundary)) { + tty->print_cr("pointer " PTR_FORMAT " at " PTR_FORMAT " on " + "clean card crosses boundary" PTR_FORMAT, + p2i((HeapWord*)obj), p2i(jp), p2i(_boundary)); +#ifndef PRODUCT + obj->print(); +#endif + had_error = true; + } } public: + bool had_error; + VerifyCleanCardClosure(HeapWord* b, HeapWord* begin, HeapWord* end) : - _boundary(b), _begin(begin), _end(end) { + _boundary(b), _begin(begin), _end(end), had_error(false) { assert(b <= begin, err_msg("Error: boundary " PTR_FORMAT " should be at or below begin " PTR_FORMAT, p2i(b), p2i(begin))); @@ -400,6 +407,7 @@ // We don't need to do young-gen spaces. if (s->end() <= gen_boundary) return; MemRegion used = s->used_region(); + bool had_error = false; jbyte* cur_entry = byte_for(used.start()); jbyte* limit = byte_after(used.last()); @@ -438,6 +446,13 @@ for (HeapWord* cur = start_block; cur < end; cur += s->block_size(cur)) { if (s->block_is_obj(cur) && s->obj_is_alive(cur)) { oop(cur)->oop_iterate_no_header(&verify_blk, mr); + had_error |= verify_blk.had_error; + if (verify_blk.had_error) { + verify_blk.had_error = false; +#ifndef PRODUCT + oop(cur)->print(); +#endif + } } } } @@ -598,6 +613,7 @@ cur_entry++; } } + guarantee(!had_error, "Card table errors found"); } void CardTableRS::verify() {