comparison src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp @ 7181:2fc0334f613a

7194633: G1: Assertion and guarantee failures in block offset table Summary: Add detailed error messages to assertions and guarantees in G1's block offset table. Reviewed-by: ysr, brutisso
author johnc
date Tue, 27 Nov 2012 14:11:37 -0800
parents da91efe96a93
children 78bbf4d43a14
comparison
equal deleted inserted replaced
7180:f34d701e952e 7181:2fc0334f613a
47 47
48 inline size_t G1BlockOffsetSharedArray::index_for(const void* p) const { 48 inline size_t G1BlockOffsetSharedArray::index_for(const void* p) const {
49 char* pc = (char*)p; 49 char* pc = (char*)p;
50 assert(pc >= (char*)_reserved.start() && 50 assert(pc >= (char*)_reserved.start() &&
51 pc < (char*)_reserved.end(), 51 pc < (char*)_reserved.end(),
52 "p not in range."); 52 err_msg("p (" PTR_FORMAT ") not in reserved [" PTR_FORMAT ", " PTR_FORMAT ")",
53 p, (char*)_reserved.start(), (char*)_reserved.end()));
53 size_t delta = pointer_delta(pc, _reserved.start(), sizeof(char)); 54 size_t delta = pointer_delta(pc, _reserved.start(), sizeof(char));
54 size_t result = delta >> LogN; 55 size_t result = delta >> LogN;
55 assert(result < _vs.committed_size(), "bad index from address"); 56 check_index(result, "bad index from address");
56 return result; 57 return result;
57 } 58 }
58 59
59 inline HeapWord* 60 inline HeapWord*
60 G1BlockOffsetSharedArray::address_for_index(size_t index) const { 61 G1BlockOffsetSharedArray::address_for_index(size_t index) const {
61 assert(index < _vs.committed_size(), "bad index"); 62 check_index(index, "index out of range");
62 HeapWord* result = _reserved.start() + (index << LogN_words); 63 HeapWord* result = _reserved.start() + (index << LogN_words);
63 assert(result >= _reserved.start() && result < _reserved.end(), 64 assert(result >= _reserved.start() && result < _reserved.end(),
64 err_msg("bad address from index result " PTR_FORMAT 65 err_msg("bad address from index result " PTR_FORMAT
65 " _reserved.start() " PTR_FORMAT " _reserved.end() " 66 " _reserved.start() " PTR_FORMAT " _reserved.end() "
66 PTR_FORMAT, 67 PTR_FORMAT,